[Github-comments] [geany/geany] Don't reopen project files that are already open (PR #2951)

elextr notifications at xxxxx
Sun Oct 24 01:18:38 UTC 2021


@elextr requested changes on this pull request.

Is this needed? What are the downsides of reloading projects?   Also does reloading a project have useful semantics that this would block, I'm not sure?

If this is desired it should be applied to UI activated opening as well, by doing this in the project open code, not socket code. 

Also technically it should be comparing `realpath`ed absolute filenames so it won't refuse to load projects of the same name in different directories.

> @@ -631,8 +631,13 @@ static void handle_input_filename(const gchar *buf)
 	{
 		if (g_str_has_suffix(locale_filename, ".geany"))
 		{
-			if (project_ask_close())
-				main_load_project_from_command_line(locale_filename, TRUE);
+			/* Don't open project when it is already opened */
+			if (!app->project || !(g_strcmp0(app->project->file_name, locale_filename) == 0

Do you need to compare to the locale filename?  IIUC the `project->file_name` has to be UTF-8 or GTK display will be broken, so just compare to UTF-8 filename.

-- 
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/2951#pullrequestreview-787458178
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211023/eb794646/attachment.htm>


More information about the Github-comments mailing list