[Github-comments] [geany/geany-plugins] Project Organizer: Add option to open current folder in file manager and terminal (PR #1126)

Jiří Techet notifications at xxxxx
Wed Nov 10 21:52:42 UTC 2021


@techee requested changes on this pull request.



> +		}
+	}
+	return path;
+}
+
+
+/* if get_dir_of_selection() fails,
+ * returns parent of current document, project folder, or home folder */
+static gchar *get_fallback_dir_of_selection(void)
+{
+	gchar *locale_path;
+
+	/* get path from treeview selection */
+	locale_path = get_dir_of_selection();
+
+	/* get path from current document */

I still don't understand why there are so many fallbacks tested - the purpose of the added functionality is to open terminal/file browser at the path from the sidebar - if the path for some reason doesn't exist (probably the directory was deleted and project not refreshed), the functionality basically cannot be performed. One option would be not opening the terminal at all which would be weird for the user though because he expects something happens. The other option is to open the terminal at some path we know that exists (but which is "wrong" because it doesn't correspond to the path in the sidebar). There's no "better" or "worse" path in this case - yes, e.g. project base dir or document dir are closer to what the user wanted but they aren't what the user wanted anyway. It's true that the base directory may also not exist so I'd just perform a single fallback to the home directory that you have at the very end of this function.

-- 
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-plugins/pull/1126#pullrequestreview-803182754
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211110/66e3e510/attachment.htm>


More information about the Github-comments mailing list