[Commits] account.c 1.61.2.102 1.61.2.103 prefs_filtering.c 1.59.2.86 1.59.2.87 prefs_filtering.h 1.6.2.11 1.6.2.12
colin at claws-mail.org
colin at claws-mail.org
Tue Nov 22 20:37:35 CET 2011
Update of /home/claws-mail/claws/src
In directory claws-mail:/tmp/cvs-serv25771/src
Modified Files:
Tag: gtk2
account.c prefs_filtering.c prefs_filtering.h
Log Message:
2011-11-22 [colin] 3.7.10cvs99
* src/account.c
* src/prefs_filtering.c
* src/prefs_filtering.h
Partly revert 3.7.10cvs97 (bug #2404, bug #2406):
The existing functions should do the job as well
if not better, as they take into account the
separator.
Index: prefs_filtering.c
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_filtering.c,v
retrieving revision 1.59.2.86
retrieving revision 1.59.2.87
diff -u -d -r1.59.2.86 -r1.59.2.87
--- prefs_filtering.c 21 Nov 2011 22:14:40 -0000 1.59.2.86
+++ prefs_filtering.c 22 Nov 2011 19:37:32 -0000 1.59.2.87
@@ -765,83 +765,6 @@
return FALSE;
}
-static void rename_path_prefix(GSList *filters, const gchar *old_prefix,
- const gchar *new_prefix)
-{
- GSList *action_cur, *cur;
- gchar *new_path;
-
- for (cur = filters; cur != NULL; cur = cur->next) {
- FilteringProp *filtering = (FilteringProp *)cur->data;
-
- for(action_cur = filtering->action_list ; action_cur != NULL ;
- action_cur = action_cur->next) {
-
- FilteringAction *action = action_cur->data;
-
- if (action->type == MATCHACTION_SET_TAG ||
- action->type == MATCHACTION_UNSET_TAG)
- continue;
- if (!action->destination)
- continue;
- if (!g_str_has_prefix(action->destination, old_prefix))
- continue;
-
- new_path = g_strconcat(new_prefix,
- (action->destination + strlen(old_prefix)), NULL);
- g_free(action->destination);
- action->destination = new_path;
- }
- }
-}
-
-static gboolean prefs_filtering_rename_path_prefix_func(GNode *node, gpointer data)
-{
- GSList *filters;
- const gchar * old_prefix;
- const gchar * new_prefix;
- const gchar ** paths;
- FolderItem *item;
-
- paths = data;
- old_prefix = paths[0];
- new_prefix = paths[1];
-
- cm_return_val_if_fail(old_prefix != NULL, FALSE);
- cm_return_val_if_fail(new_prefix != NULL, FALSE);
- cm_return_val_if_fail(node != NULL, FALSE);
-
- item = node->data;
- if (!item || !item->prefs)
- return FALSE;
- filters = item->prefs->processing;
-
- rename_path_prefix(filters, old_prefix, new_prefix);
-
- return FALSE;
-}
-
-void prefs_filtering_rename_path_prefix(const gchar *old_prefix,
- const gchar *new_prefix)
-{
- GList * cur;
- const gchar *paths[2] = {NULL, NULL};
- paths[0] = old_prefix;
- paths[1] = new_prefix;
- for (cur = folder_get_list() ; cur != NULL ; cur = g_list_next(cur)) {
- Folder *folder;
- folder = (Folder *) cur->data;
- g_node_traverse(folder->node, G_PRE_ORDER, G_TRAVERSE_ALL, -1,
- prefs_filtering_rename_path_prefix_func, paths);
- }
-
- rename_path_prefix(pre_global_processing, old_prefix, new_prefix);
- rename_path_prefix(post_global_processing, old_prefix, new_prefix);
- rename_path_prefix(filtering_rules, old_prefix, new_prefix);
-
- prefs_matcher_write_config();
-}
-
static void rename_tag(GSList * filters,
const gchar * old_tag, const gchar * new_tag)
{
Index: prefs_filtering.h
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_filtering.h,v
retrieving revision 1.6.2.11
retrieving revision 1.6.2.12
diff -u -d -r1.6.2.11 -r1.6.2.12
--- prefs_filtering.h 21 Nov 2011 22:14:40 -0000 1.6.2.11
+++ prefs_filtering.h 22 Nov 2011 19:37:32 -0000 1.6.2.12
@@ -47,8 +47,6 @@
void prefs_filtering_rename_path (const gchar *old_path,
const gchar *new_path);
-void prefs_filtering_rename_path_prefix (const gchar *old_prefix,
- const gchar *new_prefix);
void prefs_filtering_delete_path (const gchar *path);
void prefs_filtering_rename_tag(const gchar *old_tag, const gchar *new_tag);
Index: account.c
===================================================================
RCS file: /home/claws-mail/claws/src/account.c,v
retrieving revision 1.61.2.102
retrieving revision 1.61.2.103
diff -u -d -r1.61.2.102 -r1.61.2.103
--- account.c 21 Nov 2011 22:14:40 -0000 1.61.2.102
+++ account.c 22 Nov 2011 19:37:32 -0000 1.61.2.103
@@ -118,8 +118,6 @@
static void account_list_view_set (void);
static void account_list_set (void);
-static void account_rename_path_prefix (const gchar *old_prefix,
- const gchar *new_prefix);
typedef struct FindAccountInStore {
gint account_id;
@@ -467,8 +465,8 @@
folder_prefs_save_config_recursive(FOLDER(ac_prefs->folder));
new_prefix = folder_get_identifier(FOLDER(ac_prefs->folder));
- account_rename_path_prefix(old_prefix, new_prefix);
- prefs_filtering_rename_path_prefix(old_prefix, new_prefix);
+ account_rename_path(old_prefix, new_prefix);
+ prefs_filtering_rename_path(old_prefix, new_prefix);
g_free(old_prefix);
g_free(new_prefix);
@@ -568,34 +566,6 @@
}
}
-#undef CHECK_CHANGE_FOLDER
-
-#define CHANGE_FOLDER_PREFIX(folder) { \
- if (folder && g_str_has_prefix(folder, old_prefix)) { \
- gchar *new_path = g_strconcat(new_prefix, \
- (folder + strlen(old_prefix)), NULL); \
- g_free(folder); \
- folder = new_path; \
- } \
-}
-
-static void account_rename_path_prefix(const gchar *old_prefix,
- const gchar *new_prefix)
-{
- GList *cur = account_list;
- for (; cur != NULL; cur = g_list_next(cur)) {
- PrefsAccount *ap = (PrefsAccount *)cur->data;
- CHANGE_FOLDER_PREFIX(ap->inbox);
- CHANGE_FOLDER_PREFIX(ap->local_inbox);
- CHANGE_FOLDER_PREFIX(ap->queue_folder);
- CHANGE_FOLDER_PREFIX(ap->sent_folder);
- CHANGE_FOLDER_PREFIX(ap->draft_folder);
- CHANGE_FOLDER_PREFIX(ap->trash_folder);
- }
-}
-
-#undef CHANGE_FOLDER_PREFIX
-
FolderItem *account_get_special_folder(PrefsAccount *ac_prefs,
SpecialFolderItemType type)
{
More information about the Commits
mailing list