[Github-comments] [geany/geany] Rpg sidebar tree (see #259) (#1813)

Thomas Martitz notifications at xxxxx
Mon Jul 29 21:48:50 UTC 2019


kugel- commented on this pull request.



> +			break;
+		}
+		case TREE_CASE_CHLID_OF:
+		{
+			/* This dir is longer than existing so just add child */
+			tree_add_new_dir(parent, &data.best_iter, path);
+			break;
+		}
+		case TREE_CASE_PARENT_OF:
+		{
+			/* More complicated logic. This dir should be a parent
+			 * of existing, so reparent existing dir.  */
+			has_parent = gtk_tree_model_iter_parent(model, &iter, &data.best_iter);
+			tree_add_new_dir(parent, has_parent ? &iter : NULL, path);
+			tree_copy_recursive(&data.best_iter, parent);
+			gtk_tree_store_remove(store_openfiles, &data.best_iter);

Looking at this, your suggestion sounds good and would also make the intent of the function more clear.

The copy is currently mainly done because the shortname of a directory node may change (if a new parent is added in-between then child nodes could change from a/b/c/d to a->b/c/d, for example (after opening a/x.c))

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1813#discussion_r308452479
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190729/f2246338/attachment.html>


More information about the Github-comments mailing list