fixed toolbar change/save issues
authorThorsten Maerz <torte@netztorte.de>
Tue, 6 Aug 2002 22:18:39 +0000 (22:18 +0000)
committerThorsten Maerz <torte@netztorte.de>
Tue, 6 Aug 2002 22:18:39 +0000 (22:18 +0000)
ChangeLog.claws
configure.in
src/prefs_toolbar.c
src/toolbar.c
src/utils.c

index c992008e2061993c51e32681618ef883c5eb3a87..aae10ba62c65edd3040aad658eb281e3ea3e1ebc 100644 (file)
@@ -1,3 +1,12 @@
+2002-08-07 [thorsten]  0.8.1claws30
+
+       * src/prefs_toolbar.c
+               fix: crash on replace or add new button
+       * src/toolbar.c
+               fix: close xmlfile after reading
+       * src/utils.c
+               fix: unlink() file before rename()
+
 2002-08-06 [paul]      0.8.1claws29
 
        * sync with 0.8.cvs15
 2002-08-06 [paul]      0.8.1claws29
 
        * sync with 0.8.cvs15
@@ -28,7 +37,7 @@
        * src/toolbar.[ch]              **New File**
                o prefs_toolbar.[ch] custom toolbar frontend
                o toolbar.[ch]       backend 
        * src/toolbar.[ch]              **New File**
                o prefs_toolbar.[ch] custom toolbar frontend
                o toolbar.[ch]       backend 
+
 2002-08-06 [oliver]    0.8.1claws25
 
        * src/prefs_actions.[ch]
 2002-08-06 [oliver]    0.8.1claws25
 
        * src/prefs_actions.[ch]
index 5a7634527aa0cace6fd64bba6c92f7b1e7f26b4c..2ea60f74fe8f623e8d294cf08ddc2f245f4545dc 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws28
+EXTRA_VERSION=claws30
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 1005806812fb5f0f4fabcc5d87b8f169ed0ebf5f..7a48a2c11d4e20ce659ddd8c5bd74b4acb41fc7f 100644 (file)
@@ -134,7 +134,7 @@ static void prefs_toolbar_populate(void)
        GdkPixmap *xpm;
        GdkBitmap *xpmmask;
        gchar *avail[2];
        GdkPixmap *xpm;
        GdkBitmap *xpmmask;
        gchar *avail[2];
-       gchar *activ[5];
+       gchar *activ[5] = {0};
        gchar *act;
        
        gtk_clist_clear (clist_icons);
        gchar *act;
        
        gtk_clist_clear (clist_icons);
@@ -330,7 +330,7 @@ static gint prefs_toolbar_register(void)
        gint row_set = 0;
        GdkPixmap *xpm;
        GdkBitmap *xpmmask;
        gint row_set = 0;
        GdkPixmap *xpm;
        GdkBitmap *xpmmask;
-       gchar *item[5];
+       gchar *item[5] = {0};
 
        if (clist_icons->rows == 0) return -1; 
 
 
        if (clist_icons->rows == 0) return -1; 
 
@@ -392,7 +392,7 @@ static gint prefs_toolbar_substitute(void)
        gint row_set = 0;
        GdkPixmap *xpm;
        GdkBitmap *xpmmask;
        gint row_set = 0;
        GdkPixmap *xpm;
        GdkBitmap *xpmmask;
-       gchar *item[5];
+       gchar *item[5] = {0};
        gchar *ac_set;
 
        /* no rows or nothing selected */
        gchar *ac_set;
 
        /* no rows or nothing selected */
index 2d48df83f0360530d2c258b010a2d53caefc2f6d..84a84f95895ff5809fdb58062891ab1229e8b9d2 100644 (file)
@@ -400,19 +400,14 @@ void toolbar_read_config_file ()
        toolbar_clear_list();
 
        if (file) {
        toolbar_clear_list();
 
        if (file) {
-
-               if (setjmp (jumper)) {
-                       xml_close_file (file);
+               if ((setjmp (jumper))
+               || (xml_get_dtd (file))
+               || (xml_parse_next_tag (file))
+               || (!xml_compare_tag (file, TOOLBAR_TAG_INDEX))) {
+                       xml_close_file(file);
                        return;
                }
 
                        return;
                }
 
-               if (xml_get_dtd (file)) 
-                       return;
-               if (xml_parse_next_tag (file)) 
-                       return;
-               if (!xml_compare_tag (file, TOOLBAR_TAG_INDEX)) 
-                       return;
-                               
                attr = xml_get_current_tag_attr (file);
                
                retVal = TRUE;
                attr = xml_get_current_tag_attr (file);
                
                retVal = TRUE;
@@ -435,8 +430,9 @@ void toolbar_read_config_file ()
                        }
 
                }
                        }
 
                }
+               xml_close_file(file);
        }
        }
-       else {  
+       else {
                /* save default toolbar */
                toolbar_set_default_toolbar();
                toolbar_save_config_file();
                /* save default toolbar */
                toolbar_set_default_toolbar();
                toolbar_save_config_file();
index a353d43874992d04433a7d5b8ccffd587f09b5ba..26f48b74be605cd59238402838b611a7ba9efd72 100644 (file)
@@ -2166,6 +2166,7 @@ gint canonicalize_file_replace(const gchar *file)
        if (canonicalize_file(file, tmp_file) < 0)
                return -1;
 
        if (canonicalize_file(file, tmp_file) < 0)
                return -1;
 
+       unlink(file);
        if (rename(tmp_file, file) < 0) {
                FILE_OP_ERROR(file, "rename");
                unlink(tmp_file);
        if (rename(tmp_file, file) < 0) {
                FILE_OP_ERROR(file, "rename");
                unlink(tmp_file);