folderview.c: if configured font can't be loaded fall back to gtk default
authorPaul Mangan <paul@claws-mail.org>
Thu, 6 Mar 2003 12:21:10 +0000 (12:21 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 6 Mar 2003 12:21:10 +0000 (12:21 +0000)
ChangeLog.claws
configure.ac
src/folderview.c

index 1a75ace..c1d42a4 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-06 [paul]      0.8.10claws93
+
+       * src/folderview.c
+               if configured font can't be loaded fall back to gtk
+               default. (with thanks to Christoph)
+               
+               closes long-standing bug 15 'Crashes on startup'
+
 2003-03-06 [paul]      0.8.10claws92
 
        * src/compose.c
index ad74953..7bc3d28 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws92
+EXTRA_VERSION=claws93
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 694de7e..91210ff 100644 (file)
@@ -573,13 +573,28 @@ void folderview_init(FolderView *folderview)
        gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_NEW,hbox_new);
        gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_UNREAD,hbox_unread);
                        
-
-
-       if (!normalfont)
-               normalfont = gtkut_font_load(NORMAL_FONT);
-       if (!boldfont)
-               boldfont = gtkut_font_load(BOLD_FONT);
-
+       if (!normalfont) {
+               if (gtkut_font_load(NORMAL_FONT) == NULL) {
+                       GtkStyle *style = gtk_style_new();
+                       normalfont = style->font;
+                       gdk_font_ref(normalfont);
+                       gtk_style_unref(style);
+               } 
+               else 
+                       normalfont = gtkut_font_load(NORMAL_FONT);
+       }
+       
+       if (!boldfont) {
+               if (gtkut_font_load(BOLD_FONT) == NULL) {
+                       GtkStyle *style = gtk_style_new();
+                       boldfont = style->font;
+                       gdk_font_ref(boldfont);
+                       gtk_style_unref(style);
+               }
+               else
+                       boldfont = gtkut_font_load(BOLD_FONT);
+       }
+       
        if (!bold_style) {
                bold_style = gtk_style_copy(gtk_widget_get_style(ctree));
                bold_style->font = boldfont;