summaryrefslogtreecommitdiff
path: root/misc/kdepim3/patches
diff options
context:
space:
mode:
authormarkd <markd>2004-02-06 10:48:58 +0000
committermarkd <markd>2004-02-06 10:48:58 +0000
commitef18643d43b7132cbf0d320f22c6790f7c2c7248 (patch)
treedf3b34dc42586e4580857202244fa805a122e785 /misc/kdepim3/patches
parent5cdedba61e409282535d10b48a774c19aae7077c (diff)
downloadpkgsrc-ef18643d43b7132cbf0d320f22c6790f7c2c7248.tar.gz
Add official KDE patches to fix two kmail problems that can lead to mail
loss. Bump PKGREVISION.
Diffstat (limited to 'misc/kdepim3/patches')
-rw-r--r--misc/kdepim3/patches/patch-aa46
-rw-r--r--misc/kdepim3/patches/patch-ab35
2 files changed, 81 insertions, 0 deletions
diff --git a/misc/kdepim3/patches/patch-aa b/misc/kdepim3/patches/patch-aa
new file mode 100644
index 00000000000..0be2651bc61
--- /dev/null
+++ b/misc/kdepim3/patches/patch-aa
@@ -0,0 +1,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 )
diff --git a/misc/kdepim3/patches/patch-ab b/misc/kdepim3/patches/patch-ab
new file mode 100644
index 00000000000..87a58414b72
--- /dev/null
+++ b/misc/kdepim3/patches/patch-ab
@@ -0,0 +1,35 @@
+$NetBSD: patch-ab,v 1.3 2004/02/06 10:48:58 markd Exp $
+
+--- kmail/kmfolderimap.cpp.orig 2004-01-18 01:55:08.000000000 +1300
++++ kmail/kmfolderimap.cpp
+@@ -1207,7 +1207,16 @@ void KMFolderImap::deleteMessage(KMMessa
+ {
+ KURL url = mAccount->getUrl();
+ KMFolderImap *msg_parent = static_cast<KMFolderImap*>(msg->parent());
+- url.setPath(msg_parent->imapPath() + ";UID=" + msg->headerField("X-UID"));
++ QString uid = msg->headerField("X-UID");
++ /* If the uid is empty the delete job below will nuke all mail in the
++ folder, so we better safeguard against that. See ::expungeFolder, as
++ to why. :( */
++ if ( uid.isEmpty() ) {
++ kdDebug( 5006 ) << "KMFolderImap::deleteMessage: Attempt to delete "
++ "an empty UID. Aborting." << endl;
++ return;
++ }
++ url.setPath(msg_parent->imapPath() + ";UID=" + uid );
+ if ( mAccount->makeConnection() != ImapAccountBase::Connected )
+ return;
+ KIO::SimpleJob *job = KIO::file_delete(url, FALSE);
+@@ -1228,7 +1237,11 @@ void KMFolderImap::deleteMessage(QPtrLis
+ KMFolderImap *msg_parent = static_cast<KMFolderImap*>(msgList.first()->parent());
+ for ( QStringList::Iterator it = sets.begin(); it != sets.end(); ++it )
+ {
+- url.setPath(msg_parent->imapPath() + ";UID=" + *it);
++ QString uid = *it;
++ // Don't delete with no uid, that nukes the folder. Should not happen, but
++ // better safe than sorry.
++ if ( uid.isEmpty() ) continue;
++ url.setPath(msg_parent->imapPath() + ";UID=" + uid);
+ if ( mAccount->makeConnection() != ImapAccountBase::Connected )
+ return;
+ KIO::SimpleJob *job = KIO::file_delete(url, FALSE);