summaryrefslogtreecommitdiff
path: root/misc/kdepim3/patches/patch-aa
blob: 0be2651bc61f0521d98b9842fe0c68394c83e5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$NetBSD: patch-aa,v 1.5 2004/02/06 10:48:58 markd Exp $

--- kmail/kmfilter.cpp.orig	2003-11-30 22:49:22.000000000 +1300
+++ kmail/kmfilter.cpp
@@ -147,9 +147,18 @@ void KMFilter::readConfig(KConfig* confi
   // that the pattern is purified.
   mPattern.readConfig(config);
 
-  if (bPopFilter)
+  if (bPopFilter) {
     // get the action description...
-    mAction = (KMPopFilterAction) config->readNumEntry( "action" );
+    QString action = config->readEntry( "action" );
+    if ( action == "down" )
+      mAction = Down;
+    else if ( action == "later" )
+      mAction = Later;
+    else if ( action == "delete" )
+      mAction = Delete;
+    else
+      mAction = NoAction;
+  }
   else {
     QStringList sets = config->readListEntry("apply-on");
     if ( sets.isEmpty() && !config->hasKey("apply-on") ) {
@@ -210,7 +219,19 @@ void KMFilter::writeConfig(KConfig* conf
   mPattern.writeConfig(config);
 
   if (bPopFilter) {
-    config->writeEntry( "action", mAction );
+    switch ( mAction ) {
+    case Down:
+      config->writeEntry( "action", "down" );
+      break;
+    case Later:
+      config->writeEntry( "action", "later" );
+      break;
+    case Delete:
+      config->writeEntry( "action", "delete" );
+      break;
+    default:
+      config->writeEntry( "action", "" );
+    }
   } else {
     QStringList sets;
     if ( bApplyOnInbound )