Bug fix: Collection in multiple windows
authorColin Clark <colin.clark@cclark.uk>
Wed, 16 Aug 2017 08:42:42 +0000 (09:42 +0100)
committerColin Clark <colin.clark@cclark.uk>
Wed, 16 Aug 2017 08:42:42 +0000 (09:42 +0100)
The same collection can be opened in multiple windows, causing problems
when different files are appended to different windows.

This commit permits only one window per collection.

src/collect.c

index 695133a..30c481b 100644 (file)
@@ -1160,6 +1160,13 @@ CollectWindow *collection_window_new(const gchar *path)
        GtkWidget *extra_label;
        GdkGeometry geometry;
 
+       /* If the collection is already opened in another window, return that one */
+       cw = collection_window_find_by_path(path);
+       if (cw)
+               {
+               return cw;
+               }
+
        cw = g_new0(CollectWindow, 1);
 
        collection_window_list = g_list_append(collection_window_list, cw);