Просмотр исходного кода

tools: move reval logic to its own function

Daniele Bartolini 1 год назад
Родитель
Сommit
8b90c64de8
1 измененных файлов с 14 добавлено и 9 удалено
  1. 14 9
      tools/level_editor/project_browser.vala

+ 14 - 9
tools/level_editor/project_browser.vala

@@ -709,16 +709,8 @@ public class ProjectBrowser : Gtk.Bin
 			;
 	}
 
-	private void on_reveal(GLib.SimpleAction action, GLib.Variant? param)
+	private void reveal(string type, string name)
 	{
-		string type = (string)param.get_child_value(0);
-		string name = (string)param.get_child_value(1);
-
-		if (name.has_prefix("core/")) {
-			_hide_core_resources = false;
-			_tree_filter.refilter();
-		}
-
 		string parent_type = type;
 		string parent_name = name;
 		Gtk.TreePath filter_path = null;
@@ -749,6 +741,19 @@ public class ProjectBrowser : Gtk.Bin
 		} while (filter_path == null && parent_name != "");
 	}
 
+	private void on_reveal(GLib.SimpleAction action, GLib.Variant? param)
+	{
+		string type = (string)param.get_child_value(0);
+		string name = (string)param.get_child_value(1);
+
+		if (name.has_prefix("core/")) {
+			_hide_core_resources = false;
+			_tree_filter.refilter();
+		}
+
+		reveal(type, name);
+	}
+
 	private void on_open_directory(GLib.SimpleAction action, GLib.Variant? param)
 	{
 		string dir_name = param.get_string();