Przeglądaj źródła

tools: clear content when nothing is selected

Fixes: #219
Daniele Bartolini 1 rok temu
rodzic
commit
4eef4f2438
2 zmienionych plików z 5 dodań i 5 usunięć
  1. 1 0
      docs/changelog.rst
  2. 4 5
      tools/level_editor/project_browser.vala

+ 1 - 0
docs/changelog.rst

@@ -18,6 +18,7 @@ Changelog
 * Reduced clutter in the Project Browser by hiding all files with importable extensions.
 * Fixed missing/wrong previews and thumbnails in some circumnstances.
 * Improved unit previews and thumbnails with better lighting/dimensionality.
+* Fixed Project Browser showing stale files in some circumnstances.
 
 **Runtime**
 

+ 4 - 5
tools/level_editor/project_browser.vala

@@ -1403,16 +1403,15 @@ public class ProjectBrowser : Gtk.Bin
 
 	private void update_folder_view()
 	{
-		// Return if selection is empty.
+		_folder_list_store.clear();
+		_folder_view._list_store.clear();
+
+		// Get the selected node's type and name.
 		Gtk.TreeModel selected_model;
 		Gtk.TreeIter selected_iter;
 		if (!_tree_selection.get_selected(out selected_model, out selected_iter))
 			return;
 
-		_folder_list_store.clear();
-		_folder_view._list_store.clear();
-
-		// Get the selected node's type and name.
 		string selected_type;
 		string selected_name;
 		Value val;