aboutsummaryrefslogtreecommitdiffstats
path: root/importers
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-07-15 22:21:30 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-07-15 22:21:30 +0800
commit3ce841b4643d78a6b18604a4d4924823b97185c0 (patch)
treebfedb84a73ff650cac0e6e09a2f0ee1068a442ad /importers
parentda109858dab260533ab72053d5931cd2fd9d2c3d (diff)
downloadgsoc2013-evolution-3ce841b4643d78a6b18604a4d4924823b97185c0.tar.gz
gsoc2013-evolution-3ce841b4643d78a6b18604a4d4924823b97185c0.tar.zst
gsoc2013-evolution-3ce841b4643d78a6b18604a4d4924823b97185c0.zip
Replace filter-score with filter-int.
2002-07-15 Not Zed <NotZed@Ximian.com> * netscape-importer.c: Replace filter-score with filter-int. svn path=/trunk/; revision=17455
Diffstat (limited to 'importers')
-rw-r--r--importers/ChangeLog4
-rw-r--r--importers/netscape-importer.c48
2 files changed, 31 insertions, 21 deletions
diff --git a/importers/ChangeLog b/importers/ChangeLog
index edaf35c0ea..683559c841 100644
--- a/importers/ChangeLog
+++ b/importers/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-15 Not Zed <NotZed@Ximian.com>
+
+ * netscape-importer.c: Replace filter-score with filter-int.
+
2002-07-08 Peter Williams <peterw@ximian.com>
* Makefile.am: Fix cflags to get at ebook headers correctly.
diff --git a/importers/netscape-importer.c b/importers/netscape-importer.c
index 6a0d65b5b8..5ddba5b33c 100644
--- a/importers/netscape-importer.c
+++ b/importers/netscape-importer.c
@@ -56,7 +56,7 @@
#include <filter/filter-rule.h>
#include <filter/filter-option.h>
#include <filter/filter-folder.h>
-#include <filter/filter-score.h>
+#include <filter/filter-int.h>
#include <shell/evolution-shell-client.h>
#include "Mail.h"
@@ -709,6 +709,7 @@ netscape_create_priority_converter (FilterContext *fc, NsFilterActionValueType p
FilterRule *fr;
FilterElement *el;
char s[MAXLEN];
+ int v;
ff = filter_filter_new ();
fr = FILTER_RULE(ff);
@@ -732,25 +733,26 @@ netscape_create_priority_converter (FilterContext *fc, NsFilterActionValueType p
switch (priority) {
case LOWEST:
- ((FilterScore *)el)->score = -2;
+ v = -2;
break;
case LOW:
- ((FilterScore *)el)->score = -1;
+ v = -1;
break;
case NORMAL:
- ((FilterScore *)el)->score = 0;
+ v = 0;
break;
case HIGH:
- ((FilterScore *)el)->score = 1;
+ v = 1;
break;
case HIGHEST:
- ((FilterScore *)el)->score = 2;
+ v = 2;
break;
default:
gtk_object_unref (GTK_OBJECT(ff));
return NULL;
}
+ filter_int_set_value((FilterInt *)el, v);
filter_filter_add_action (ff, fp);
return FILTER_RULE(ff);
@@ -781,28 +783,32 @@ netscape_add_priority_workaround_filters (FilterContext *fc)
static gboolean
-netscape_filter_score_set (NsFilterCondition *cond, FilterScore *el)
+netscape_filter_score_set (NsFilterCondition *cond, FilterInt *el)
{
+ int v;
+
switch (cond->prop_val_id) {
case LOWEST:
- el->score = -2;
+ v = -2;
break;
case LOW:
- el->score = -1;
+ v = -1;
break;
case NORMAL:
- el->score = 0;
+ v = 0;
break;
case HIGH:
- el->score = 1;
+ v = 1;
break;
case HIGHEST:
- el->score = 2;
+ v = 2;
break;
default:
return FALSE;
}
+ filter_int_set_value(el, v);
+
return TRUE;
}
@@ -953,7 +959,7 @@ netscape_filter_to_evol_filter (FilterContext *fc, NsFilter *nsf, gboolean *prio
filter_option_set_current ((FilterOption*)el, "is");
el = filter_part_find_element (fp, "versus");
- if (!netscape_filter_score_set(cond, (FilterScore*)el)) {
+ if (!netscape_filter_score_set(cond, (FilterInt*)el)) {
filter_rule_remove_part (fr, fp);
gtk_object_unref (GTK_OBJECT(fp));
continue;
@@ -968,7 +974,7 @@ netscape_filter_to_evol_filter (FilterContext *fc, NsFilter *nsf, gboolean *prio
filter_option_set_current ((FilterOption*)el, "is-not");
el = filter_part_find_element (fp, "versus");
- if (!netscape_filter_score_set(cond, (FilterScore*)el)) {
+ if (!netscape_filter_score_set(cond, (FilterInt*)el)) {
filter_rule_remove_part (fr, fp);
gtk_object_unref (GTK_OBJECT(fp));
continue;
@@ -983,7 +989,7 @@ netscape_filter_to_evol_filter (FilterContext *fc, NsFilter *nsf, gboolean *prio
filter_option_set_current ((FilterOption*)el, "greater-than");
el = filter_part_find_element (fp, "versus");
- if (!netscape_filter_score_set(cond, (FilterScore*)el)) {
+ if (!netscape_filter_score_set(cond, (FilterInt*)el)) {
filter_rule_remove_part (fr, fp);
gtk_object_unref (GTK_OBJECT(fp));
continue;
@@ -998,7 +1004,7 @@ netscape_filter_to_evol_filter (FilterContext *fc, NsFilter *nsf, gboolean *prio
filter_option_set_current ((FilterOption*)el, "less-than");
el = filter_part_find_element (fp, "versus");
- if (!netscape_filter_score_set(cond, (FilterScore*)el)) {
+ if (!netscape_filter_score_set(cond, (FilterInt*)el)) {
filter_rule_remove_part (fr, fp);
gtk_object_unref (GTK_OBJECT(fp));
continue;
@@ -1098,23 +1104,23 @@ netscape_filter_to_evol_filter (FilterContext *fc, NsFilter *nsf, gboolean *prio
switch (nsf->action_val_id) {
case LOWEST:
- ((FilterScore *)el)->score = -2;
+ filter_int_set_value((FilterInt *)el, -2);
action_added = TRUE;
break;
case LOW:
- ((FilterScore *)el)->score = -1;
+ filter_int_set_value((FilterInt *)el, -1);
action_added = TRUE;
break;
case NORMAL:
- ((FilterScore *)el)->score = 0;
+ filter_int_set_value((FilterInt *)el, 0);
action_added = TRUE;
break;
case HIGH:
- ((FilterScore *)el)->score = 1;
+ filter_int_set_value((FilterInt *)el, 1);
action_added = TRUE;
break;
case HIGHEST:
- ((FilterScore *)el)->score = 2;
+ filter_int_set_value((FilterInt *)el, 2);
action_added = TRUE;
break;
default: