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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
Index: kmail/cachedimapjob.cpp
===================================================================
--- kmail/cachedimapjob.cpp (revision 1022962)
+++ kmail/cachedimapjob.cpp (revision 1022963)
@@ -510,7 +510,7 @@
bool b = kmkernel->iCalIface().isResourceQuiet();
kmkernel->iCalIface().setResourceQuiet( true );
- mFolder->take( i );
+ mFolder->takeTemporarily( i );
mFolder->addMsgKeepUID( mMsg );
mMsg->setTransferInProgress( false );
Index: kmail/kmfoldercachedimap.cpp
===================================================================
--- kmail/kmfoldercachedimap.cpp (revision 1022962)
+++ kmail/kmfoldercachedimap.cpp (revision 1022963)
@@ -527,6 +527,11 @@
return KMFolderMaildir::take( idx );
}
+void KMFolderCachedImap::takeTemporarily( int idx )
+{
+ KMFolderMaildir::take( idx );
+}
+
int KMFolderCachedImap::addMsgInternal( KMMessage *msg, bool newMail, int *index_return )
{
// Possible optimization: Only dirty if not filtered below
Index: kmail/kmfoldercachedimap.h
===================================================================
--- kmail/kmfoldercachedimap.h (revision 1022962)
+++ kmail/kmfoldercachedimap.h (revision 1022963)
@@ -228,10 +228,23 @@
/** Reimplemented from KMFolder. Moving is not supported, so aParent must be 0. */
virtual int rename( const QString &aName, KMFolderDir *aParent = 0 );
- /** Reimplemented from KMFolderMaildir */
- virtual KMMessage *take( int idx );
bool canDeleteMessages() const;
+ /**
+ * Reimplemented from KMFolderMaildir
+ * This deletes the message permanently, also from the server. For this,
+ * rememberDeletion() is called, so that the message can be deleted from
+ * the server on the next sync.
+ */
+ virtual KMMessage* take( int idx );
+
+ /**
+ * Like take(), only that the deletion is not remembered, i.e. the
+ * message will not be deleted from the server. Calling this can cause
+ * inconsistencies, so make sure you re-add the message later!
+ */
+ void takeTemporarily( int idx );
+
/** Reimplemented from KMFolderMaildir */
virtual int addMsg( KMMessage *msg, int *index_return = 0 );
Index: kmail/kmfoldercachedimap.cpp
===================================================================
--- kmail/kmfoldercachedimap.cpp (revision 1022963)
+++ kmail/kmfoldercachedimap.cpp (revision 1022964)
@@ -1678,6 +1678,11 @@
job->start();
return true;
} else {
+
+ // Nothing to delete on the server, make sure the map is clear again.
+ // Normally this wouldn't be necessary, but there can be stale maps because of
+ // https://issues.kolab.org/issue3833.
+ mDeletedUIDsSinceLastSync.clear();
return false;
}
}
|