diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-07-01 07:08:47 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-07-01 07:08:47 +0000 |
commit | 0839e124a6910f5d134ec3b229466cd470b0c7ea (patch) | |
tree | 317bb69b15ac02089dd7f9d95a033bc4c2598a82 | |
parent | 0e676a1296e611abea9bcb6ce673cd8f55aa5691 (diff) |
fixed a bug in syncing folder path.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@388 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/filter.c | 12 | ||||
-rw-r--r-- | src/folderview.c | 37 |
4 files changed, 25 insertions, 34 deletions
@@ -1,3 +1,8 @@ +2005-07-01 + + * src/filter.c: fixed a bug in syncing folder path. + * src/folderview.c: some code cleanups. + 2005-06-30 * src/summaryview.c: summary_filter_func(): reflect flag changes to diff --git a/ChangeLog.ja b/ChangeLog.ja index b4c3ba67..a4550307 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2005-07-01 + + * src/filter.c: フォルダのパスの同期のバグを修正。 + * src/folderview.c: コードの整理。 + 2005-06-30 * src/summaryview.c: summary_filter_func(): フラグの変更を IMAP diff --git a/src/filter.c b/src/filter.c index 217c55da..b17134fa 100644 --- a/src/filter.c +++ b/src/filter.c @@ -1092,6 +1092,8 @@ void filter_rule_rename_dest_path(FilterRule *rule, const gchar *old_path, gchar *dest_path; gint oldpathlen; + oldpathlen = strlen(old_path); + for (cur = rule->action_list; cur != NULL; cur = cur->next) { action = (FilterAction *)cur->data; @@ -1099,10 +1101,11 @@ void filter_rule_rename_dest_path(FilterRule *rule, const gchar *old_path, action->type != FLT_ACTION_COPY) continue; - oldpathlen = strlen(old_path); if (action->str_value && !strncmp(old_path, action->str_value, oldpathlen)) { base = action->str_value + oldpathlen; + if (*base != G_DIR_SEPARATOR && *base != '\0') + continue; while (*base == G_DIR_SEPARATOR) base++; if (*base == '\0') dest_path = g_strdup(new_path); @@ -1121,6 +1124,9 @@ void filter_rule_delete_action_by_dest_path(FilterRule *rule, const gchar *path) FilterAction *action; GSList *cur; GSList *next; + gint pathlen; + + pathlen = strlen(path); for (cur = rule->action_list; cur != NULL; cur = next) { action = (FilterAction *)cur->data; @@ -1131,7 +1137,9 @@ void filter_rule_delete_action_by_dest_path(FilterRule *rule, const gchar *path) continue; if (action->str_value && - !strncmp(path, action->str_value, strlen(path))) { + !strncmp(path, action->str_value, pathlen) && + (action->str_value[pathlen] == G_DIR_SEPARATOR || + action->str_value[pathlen] == '\0')) { rule->action_list = g_slist_remove (rule->action_list, action); filter_action_free(action); diff --git a/src/folderview.c b/src/folderview.c index f5488fc8..27020fae 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -1298,19 +1298,10 @@ void folderview_new_folder(FolderView *folderview) g_return_if_fail(item->folder != NULL); - switch (FOLDER_TYPE(item->folder)) { - case F_MH: - case F_MBOX: - case F_MAILDIR: - case F_IMAP: + if (item->folder->klass->create_folder) folderview_new_folder_cb(folderview, 0, NULL); - break; - case F_NEWS: + else if (FOLDER_TYPE(item->folder) == F_NEWS) folderview_new_news_group_cb(folderview, 0, NULL); - break; - default: - break; - } } void folderview_rename_folder(FolderView *folderview) @@ -1326,17 +1317,8 @@ void folderview_rename_folder(FolderView *folderview) if (!item->path) return; if (item->stype != F_NORMAL) return; - switch (FOLDER_TYPE(item->folder)) { - case F_MH: - case F_MBOX: - case F_MAILDIR: - case F_IMAP: + if (item->folder->klass->rename_folder) folderview_rename_folder_cb(folderview, 0, NULL); - break; - case F_NEWS: - default: - break; - } } void folderview_delete_folder(FolderView *folderview) @@ -1352,19 +1334,10 @@ void folderview_delete_folder(FolderView *folderview) if (!item->path) return; if (item->stype != F_NORMAL) return; - switch (FOLDER_TYPE(item->folder)) { - case F_MH: - case F_MBOX: - case F_MAILDIR: - case F_IMAP: + if (item->folder->klass->remove_folder) folderview_delete_folder_cb(folderview, 0, NULL); - break; - case F_NEWS: + else if (FOLDER_TYPE(item->folder) == F_NEWS) folderview_rm_news_group_cb(folderview, 0, NULL); - break; - default: - break; - } } void folderview_check_new_selected(FolderView *folderview) |