@techee requested changes on this pull request.
In projectorganizer/src/prjorg-sidebar.c:
> + } + } + 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, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.