diff src/bar_keywords.c @ 1593:7db2bc77d786

fixed keyword tree initialization
author nadvornik
date Thu, 07 May 2009 19:52:38 +0000
parents c8ac214a2fca
children 6146ec0c9ab9
line wrap: on
line diff
--- a/src/bar_keywords.c	Thu May 07 19:38:07 2009 +0000
+++ b/src/bar_keywords.c	Thu May 07 19:52:38 2009 +0000
@@ -1224,6 +1224,7 @@
 	GtkTreeModel *store;
 	GtkTreeViewColumn *column;
 	GtkCellRenderer *renderer;
+	GtkTreeIter iter;
 
 	pkd = g_new0(PaneKeywordsData, 1);
 
@@ -1273,7 +1274,11 @@
 	gtk_widget_show(scrolled);
 
 
-	if (!keyword_tree) keyword_tree_new_default();
+	if (!keyword_tree || !gtk_tree_model_get_iter_first(GTK_TREE_MODEL(keyword_tree), &iter))
+		{
+		/* keyword tree does not exist or is empty - fill with defaults */
+		keyword_tree_new_default();
+		}
 
 	store = gtk_tree_model_filter_new(GTK_TREE_MODEL(keyword_tree), NULL);