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 4ddd386..055ca5b 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 d4bb5f5..a53c051 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 497cd30..15b479f 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 302ddc0..dc3fbd4 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,