mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:02:45 +00:00 
			
		
		
		
	 6076deae1d
			
		
	
	
		6076deae1d
		
	
	
	
	
		
			
			The ToDoEntries and ToDoEntriesWidget classes now have methods for clearing the entries, before entries would stay permanently, even after switching to a new project.
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			845 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			845 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Federico Guerinoni <guerinoni.federico@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include "ToDoEntries.h"
 | |
| 
 | |
| namespace HackStudio {
 | |
| 
 | |
| ToDoEntries& HackStudio::ToDoEntries::the()
 | |
| {
 | |
|     static ToDoEntries s_instance;
 | |
|     return s_instance;
 | |
| }
 | |
| 
 | |
| void ToDoEntries::set_entries(String const& filename, Vector<Cpp::Parser::TodoEntry> const&& entries)
 | |
| {
 | |
|     m_document_to_entries.set(filename, move(entries));
 | |
|     if (on_update)
 | |
|         on_update();
 | |
| }
 | |
| 
 | |
| Vector<Cpp::Parser::TodoEntry> ToDoEntries::get_entries()
 | |
| {
 | |
|     Vector<Cpp::Parser::TodoEntry> ret;
 | |
|     for (auto& it : m_document_to_entries) {
 | |
|         for (auto& entry : it.value)
 | |
|             ret.append({ entry.content, it.key, entry.line, entry.column });
 | |
|     }
 | |
|     return ret;
 | |
| }
 | |
| 
 | |
| void ToDoEntries::clear_entries()
 | |
| {
 | |
|     m_document_to_entries.clear();
 | |
| }
 | |
| 
 | |
| }
 |