*src/prefs_filtering.c
authorColin Leroy <colin@colino.net>
Wed, 21 Aug 2002 10:19:26 +0000 (10:19 +0000)
committerColin Leroy <colin@colino.net>
Wed, 21 Aug 2002 10:19:26 +0000 (10:19 +0000)
                fix renaming rules on folder rename
                when folder is not a leaf folder

ChangeLog.claws
configure.in
src/prefs_filtering.c

index 308d89c7e2c4e00d083fe7346d75f8e662aa64b5..02bd3131ee89796d49c57452a288455329522c92 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-21 [colin]     0.8.1claws92
+       
+       *src/prefs_filtering.c
+               fix renaming rules on folder rename 
+               when folder is not a leaf folder
+
 2002-08-21 [paul]      0.8.1claws91
 
        * src/prefs_folder_item.c
index a1e490464b6bb204f6a7aa135de30bc6785c8235..62a6af39af14e5632a420f24e04d89ce5c5f0f88 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws91
+EXTRA_VERSION=claws92
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 1faf4b8fc1bfed2a324ba26750a58a2cafa788cc..c2bfb4b6ca9172c4ddaeb843ad018dda8ed59b6c 100644 (file)
@@ -615,6 +615,7 @@ void prefs_filtering_rename_path(const gchar *old_path, const gchar *new_path)
        gchar *prefix;
        gchar *suffix;
        gchar *dest_path;
+       gchar *old_path_with_sep;
        gint destlen;
        gint prefixlen;
        gint oldpathlen;
@@ -623,6 +624,7 @@ void prefs_filtering_rename_path(const gchar *old_path, const gchar *new_path)
        g_return_if_fail(new_path != NULL);
 
        oldpathlen = strlen(old_path);
+       old_path_with_sep = g_strconcat(old_path,G_DIR_SEPARATOR_S,NULL);
 
        for (cur = global_processing; cur != NULL; cur = cur->next) {
                FilteringProp   *filtering = (FilteringProp *)cur->data;
@@ -656,6 +658,17 @@ void prefs_filtering_rename_path(const gchar *old_path, const gchar *new_path)
                                g_free(prefix);
                                g_free(action->destination);
                                action->destination = dest_path;
+                       } else { /* for non-leaf folders */
+                               /* compare with trailing slash */
+                               if(!strncmp(old_path_with_sep, action->destination, oldpathlen+1)) {
+                                       
+                                       suffix = action->destination + oldpathlen + 1;
+                                       dest_path = g_strconcat(new_path,
+                                                               G_DIR_SEPARATOR_S,
+                                                               suffix, NULL);
+                                       g_free(action->destination);
+                                       action->destination = dest_path;
+                               }
                        }
                }
        }