Use folderview_freeze/thaw() functions outside of folderview.c.
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 21 Jul 2016 10:02:30 +0000 (12:02 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 21 Jul 2016 10:02:30 +0000 (12:02 +0200)
These are modeled after summary_freeze/thaw().

src/folderview.c
src/folderview.h
src/main.c
src/plugins/rssyl/rssyl_feed.c

index 4ddd38696ac4d060b3c73a480266d8a7b4230d31..055ca5baad9dff4ac03af2ace2d7d3702ede350b 100644 (file)
@@ -3172,3 +3172,15 @@ void folderview_unregister_popup(FolderViewPopup *fpopup)
        }       
        g_hash_table_remove(folderview_popups, fpopup->klass);
 }
+
+void folderview_freeze(FolderView *folderview)
+{
+       if (folderview)
+               gtk_cmclist_freeze(GTK_CMCLIST(folderview->ctree));
+}
+
+void folderview_thaw(FolderView *folderview)
+{
+       if (folderview)
+               gtk_cmclist_thaw(GTK_CMCLIST(folderview->ctree));
+}
index d4bb5f53bf589b331c207e801d82eb344c3103fd..a53c0511273838f2047edb6a113590508ee93600 100644 (file)
@@ -148,4 +148,7 @@ void folderview_finish_dnd          (const gchar            *data,
                                         FolderItem             *item);
 void folderview_close_opened           (FolderView             *folderview);
 
+void folderview_freeze(FolderView *folderview);
+void folderview_thaw(FolderView *folderview);
+
 #endif /* __FOLDERVIEW_H__ */
index 497cd30a495eef4d0a853325a48f8adcf3fc1008..15b479f67244bfb41c85489bef16e5ed7b11c5aa 100644 (file)
@@ -1300,7 +1300,7 @@ int main(int argc, char *argv[])
        manage_window_focus_in(mainwin->window, NULL, NULL);
        folderview = mainwin->folderview;
 
-       gtk_cmclist_freeze(GTK_CMCLIST(mainwin->folderview->ctree));
+       folderview_freeze(mainwin->folderview);
        folder_item_update_freeze();
 
        passwd_store_read_config();
@@ -1517,7 +1517,7 @@ int main(int argc, char *argv[])
 #endif
 
        folder_item_update_thaw();
-       gtk_cmclist_thaw(GTK_CMCLIST(mainwin->folderview->ctree));
+       folderview_thaw(mainwin->folderview);
        main_window_cursor_normal(mainwin);
 
        if (!cmd.target && prefs_common.goto_last_folder_on_startup &&
index 302ddc00e0c81ea59c825a445beef12169e4a105..dc3fbd4afa64ed7eef1655a84b13e11a58910c89 100644 (file)
@@ -63,7 +63,7 @@ FolderItem *rssyl_feed_subscribe_new(FolderItem *parent, const gchar *url,
 
        myurl = g_strchomp(myurl);
 
-       gtk_cmclist_freeze(GTK_CMCLIST(mainwindow_get_mainwindow()->folderview->ctree));
+       folderview_freeze(mainwindow_get_mainwindow()->folderview);
        folder_item_update_freeze();
 
        /* Create a feed folder with generic name. */
@@ -92,7 +92,7 @@ FolderItem *rssyl_feed_subscribe_new(FolderItem *parent, const gchar *url,
        }
 
        folder_item_update_thaw();
-       gtk_cmclist_thaw(GTK_CMCLIST(mainwindow_get_mainwindow()->folderview->ctree));
+       folderview_thaw(mainwindow_get_mainwindow()->folderview);
 
        if( success )
                log_print(LOG_PROTOCOL, RSSYL_LOG_SUBSCRIBED, ritem->official_title,