aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-02 10:00:15 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-02 10:00:15 +0000
commit67fecb1232183bad2ac2eec436c8affd4c3e49f7 (patch)
tree7a409a06ecffc8de96d9e2d2a47c5fb256c54c1d
parentcbc9395569bb7c7b51079ab3cb0db1d36345f03c (diff)
moved two functions from prefs_filter.c to filter.c.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@543 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.ja8
-rw-r--r--src/filter.c37
-rw-r--r--src/filter.h4
-rw-r--r--src/folderview.c14
-rw-r--r--src/prefs_filter.c37
-rw-r--r--src/prefs_filter.h4
-rw-r--r--src/sourcewindow.c1
8 files changed, 65 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index 84a0896c..73a78bca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-09-02
+ * src/sourcewindow.c: added missing include.
+ * src/filter.[ch]
+ src/prefs_filter.[ch]
+ src/folderview.c: moved prefs_filter_rename_path() and
+ prefs_filter_delete_path() to filter.c.
+
+2005-09-02
+
* src/main.c
src/filter.[ch]
src/prefs_filter.[ch]: moved prefs_filter_read_config() to filter.c.
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 3da3b620..3a30c995 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,13 @@
2005-09-02
+ * src/sourcewindow.c: 抜けていた include を追加。
+ * src/filter.[ch]
+ src/prefs_filter.[ch]
+ src/folderview.c: prefs_filter_rename_path() と
+ prefs_filter_delete_path() を filter.c に移動。
+
+2005-09-02
+
* src/main.c
src/filter.[ch]
src/prefs_filter.[ch]: prefs_filter_read_config() を filter.c
diff --git a/src/filter.c b/src/filter.c
index 873211c5..8d85b95c 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -1194,6 +1194,43 @@ void filter_rule_delete_action_by_dest_path(FilterRule *rule, const gchar *path)
}
}
+void filter_list_rename_path(const gchar *old_path, const gchar *new_path)
+{
+ GSList *cur;
+
+ g_return_if_fail(old_path != NULL);
+ g_return_if_fail(new_path != NULL);
+
+ for (cur = prefs_common.fltlist; cur != NULL; cur = cur->next) {
+ FilterRule *rule = (FilterRule *)cur->data;
+ filter_rule_rename_dest_path(rule, old_path, new_path);
+ }
+
+ filter_write_config();
+}
+
+void filter_list_delete_path(const gchar *path)
+{
+ GSList *cur;
+ GSList *next;
+
+ g_return_if_fail(path != NULL);
+
+ for (cur = prefs_common.fltlist; cur != NULL; cur = next) {
+ FilterRule *rule = (FilterRule *)cur->data;
+ next = cur->next;
+
+ filter_rule_delete_action_by_dest_path(rule, path);
+ if (!rule->action_list) {
+ prefs_common.fltlist =
+ g_slist_remove(prefs_common.fltlist, rule);
+ filter_rule_free(rule);
+ }
+ }
+
+ filter_write_config();
+}
+
void filter_rule_match_type_str_to_enum(const gchar *match_type,
FilterMatchType *type,
FilterMatchFlag *flag)
diff --git a/src/filter.h b/src/filter.h
index 98951856..0001dcd6 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -183,6 +183,10 @@ void filter_rule_delete_action_by_dest_path
(FilterRule *rule,
const gchar *path);
+void filter_list_rename_path (const gchar *old_path,
+ const gchar *new_path);
+void filter_list_delete_path (const gchar *path);
+
void filter_rule_match_type_str_to_enum (const gchar *type_str,
FilterMatchType *type,
FilterMatchFlag *flag);
diff --git a/src/folderview.c b/src/folderview.c
index dabbdb18..8b9ccaa2 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -59,8 +59,8 @@
#include "gtkutils.h"
#include "prefs_common.h"
#include "prefs_account.h"
-#include "prefs_filter.h"
#include "prefs_folder_item.h"
+#include "filter.h"
#include "account.h"
#include "account_dialog.h"
#include "folder.h"
@@ -2016,9 +2016,9 @@ static void folderview_rename_folder_cb(FolderView *folderview, guint action,
}
if (folder_get_default_folder() == item->folder)
- prefs_filter_rename_path(old_path, item->path);
+ filter_list_rename_path(old_path, item->path);
new_id = folder_item_get_identifier(item);
- prefs_filter_rename_path(old_id, new_id);
+ filter_list_rename_path(old_id, new_id);
g_free(old_id);
g_free(new_id);
@@ -2084,9 +2084,9 @@ static void folderview_move_folder_cb(FolderView *folderview, guint action,
}
if (folder_get_default_folder() == item->folder)
- prefs_filter_rename_path(old_path, item->path);
+ filter_list_rename_path(old_path, item->path);
new_id = folder_item_get_identifier(item);
- prefs_filter_rename_path(old_id, new_id);
+ filter_list_rename_path(old_id, new_id);
g_free(new_id);
g_free(old_id);
g_free(old_path);
@@ -2175,8 +2175,8 @@ static void folderview_delete_folder_cb(FolderView *folderview, guint action,
}
if (folder_get_default_folder() == folder)
- prefs_filter_delete_path(old_path);
- prefs_filter_delete_path(old_id);
+ filter_list_delete_path(old_path);
+ filter_list_delete_path(old_id);
g_free(old_id);
gtk_tree_store_remove(folderview->store, &iter);
diff --git a/src/prefs_filter.c b/src/prefs_filter.c
index fbda86ac..66a35778 100644
--- a/src/prefs_filter.c
+++ b/src/prefs_filter.c
@@ -360,43 +360,6 @@ static void prefs_filter_create(void)
rule_list_window.msg_hdr_table = NULL;
}
-void prefs_filter_rename_path(const gchar *old_path, const gchar *new_path)
-{
- GSList *cur;
-
- g_return_if_fail(old_path != NULL);
- g_return_if_fail(new_path != NULL);
-
- for (cur = prefs_common.fltlist; cur != NULL; cur = cur->next) {
- FilterRule *rule = (FilterRule *)cur->data;
- filter_rule_rename_dest_path(rule, old_path, new_path);
- }
-
- filter_write_config();
-}
-
-void prefs_filter_delete_path(const gchar *path)
-{
- GSList *cur;
- GSList *next;
-
- g_return_if_fail(path != NULL);
-
- for (cur = prefs_common.fltlist; cur != NULL; cur = next) {
- FilterRule *rule = (FilterRule *)cur->data;
- next = cur->next;
-
- filter_rule_delete_action_by_dest_path(rule, path);
- if (!rule->action_list) {
- prefs_common.fltlist =
- g_slist_remove(prefs_common.fltlist, rule);
- filter_rule_free(rule);
- }
- }
-
- filter_write_config();
-}
-
static void prefs_filter_set_dialog(void)
{
GSList *cur;
diff --git a/src/prefs_filter.h b/src/prefs_filter.h
index 157782ab..d41a9883 100644
--- a/src/prefs_filter.h
+++ b/src/prefs_filter.h
@@ -48,8 +48,4 @@ gchar *prefs_filter_get_msg_header_field (const gchar *header_name);
void prefs_filter_set_user_header_list (GSList *list);
void prefs_filter_set_msg_header_list (MsgInfo *msginfo);
-void prefs_filter_rename_path (const gchar *old_path,
- const gchar *new_path);
-void prefs_filter_delete_path (const gchar *path);
-
#endif /* __PREFS_FILTER_H__ */
diff --git a/src/sourcewindow.c b/src/sourcewindow.c
index 11e5c927..21b48af9 100644
--- a/src/sourcewindow.c
+++ b/src/sourcewindow.c
@@ -33,6 +33,7 @@
#include "sourcewindow.h"
#include "procmsg.h"
+#include "codeconv.h"
#include "utils.h"
#include "gtkutils.h"
#include "prefs_common.h"