summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Lohrke <carlo@gentoo.org>2006-04-22 11:19:15 +0000
committerCarsten Lohrke <carlo@gentoo.org>2006-04-22 11:19:15 +0000
commit98a7907168736808059cd7c0c3e46d22351ffdb9 (patch)
tree77a351b913026c82481c9fc43c2328657714c8ec /kde-base
parentMissing dependency, bug #120258. (diff)
downloadhistorical-98a7907168736808059cd7c0c3e46d22351ffdb9.tar.gz
historical-98a7907168736808059cd7c0c3e46d22351ffdb9.tar.bz2
historical-98a7907168736808059cd7c0c3e46d22351ffdb9.zip
Imap, config, attachment handling and other fixes.
Package-Manager: portage-2.0.54
Diffstat (limited to 'kde-base')
-rw-r--r--kde-base/kmail/ChangeLog9
-rw-r--r--kde-base/kmail/files/digest-kmail-3.5.2-r11
-rw-r--r--kde-base/kmail/files/kmail-3.5-ham_spam_icons.diff66
-rw-r--r--kde-base/kmail/files/kmail-3.5.2-imap-fixes.diff291
-rw-r--r--kde-base/kmail/files/kmail-3.5.2-misc-fixes.diff273
-rw-r--r--kde-base/kmail/kmail-3.5.2-r1.ebuild59
6 files changed, 698 insertions, 1 deletions
diff --git a/kde-base/kmail/ChangeLog b/kde-base/kmail/ChangeLog
index c9234e905380..14b4a7f063fa 100644
--- a/kde-base/kmail/ChangeLog
+++ b/kde-base/kmail/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for kde-base/kmail
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kmail/ChangeLog,v 1.54 2006/04/06 02:05:45 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kmail/ChangeLog,v 1.55 2006/04/22 11:19:15 carlo Exp $
+
+*kmail-3.5.2-r1 (22 Apr 2006)
+
+ 22 Apr 2006; Carsten Lohrke <carlo@gentoo.org>
+ +files/kmail-3.5.2-imap-fixes.diff, +files/kmail-3.5.2-misc-fixes.diff,
+ +files/kmail-3.5-ham_spam_icons.diff, +kmail-3.5.2-r1.ebuild:
+ Imap, config, attachment handling and other fixes.
05 Apr 2006; Diego Pettenò <flameeyes@gentoo.org>
-files/kmail-qt-3.3.5.patch, -files/kdepim-3.5.0-kmail-branch.patch,
diff --git a/kde-base/kmail/files/digest-kmail-3.5.2-r1 b/kde-base/kmail/files/digest-kmail-3.5.2-r1
new file mode 100644
index 000000000000..9ee81dd048d6
--- /dev/null
+++ b/kde-base/kmail/files/digest-kmail-3.5.2-r1
@@ -0,0 +1 @@
+MD5 ac6b3b503e27a65a7b883c1e0a57262e kdepim-3.5.2.tar.bz2 12887336
diff --git a/kde-base/kmail/files/kmail-3.5-ham_spam_icons.diff b/kde-base/kmail/files/kmail-3.5-ham_spam_icons.diff
new file mode 100644
index 000000000000..c85eb013a795
--- /dev/null
+++ b/kde-base/kmail/files/kmail-3.5-ham_spam_icons.diff
@@ -0,0 +1,66 @@
+diff -urN kdepim-3.5.0.old/kmail/kmail-3.5-filter-icons.pl kdepim-3.5.0/kmail/kmail-3.5-filter-icons.pl
+--- kdepim-3.5.0.old/kmail/kmail-3.5-filter-icons.pl 1970-01-01 01:00:00.000000000 +0100
++++ kdepim-3.5.0/kmail/kmail-3.5-filter-icons.pl 2005-12-19 21:47:43.000000000 +0100
+@@ -0,0 +1,22 @@
++#!/usr/bin/perl -w
++
++use strict;
++
++# This script updates some configuration keys
++
++# read the whole config file
++my $currentGroup = "";
++my %configFile;
++while ( <> ) {
++ chomp; # eat the trailing '\n'
++ next if ( /^$/ ); # skip empty lines
++ next if ( /^\#/ ); # skip comments
++ if ( /^\[/ ) { # group begin
++ $currentGroup = $_;
++ next;
++ } elsif ( $currentGroup =~ /^\[Filter #[0-9]+\]$/ && /^Icon=/ ) {
++ my ($key,$value) = split /=/;
++ print "# DELETE $currentGroup$key\n${currentGroup}\nIcon=mail_spam\n" if $value eq "mark_as_spam";
++ print "# DELETE $currentGroup$key\n${currentGroup}\nIcon=mail_ham\n" if $value eq "mark_as_ham";
++ }
++}
+diff -urN kdepim-3.5.0.old/kmail/kmail.upd kdepim-3.5.0/kmail/kmail.upd
+--- kdepim-3.5.0.old/kmail/kmail.upd 2005-09-10 10:24:01.000000000 +0200
++++ kdepim-3.5.0/kmail/kmail.upd 2005-12-19 21:31:18.000000000 +0100
+@@ -158,6 +158,10 @@
+ Id=3.4.1
+ File=kmailrc
+ Script=kmail-3.4.1-update-status-filters.pl,perl
++# Update icon names for spam/ham filters
++Id=3.5-filter-icons
++File=kmailrc
++Script=kmail-3.5-filter-icons.pl,perl
+ #
+ # Important notice:
+ # If you add updates here, keep this text below them.
+diff -urN kdepim-3.5.0.old/kmail/kmstartup.cpp kdepim-3.5.0/kmail/kmstartup.cpp
+--- kdepim-3.5.0.old/kmail/kmstartup.cpp 2005-11-08 23:33:29.000000000 +0100
++++ kdepim-3.5.0/kmail/kmstartup.cpp 2005-12-19 21:21:00.000000000 +0100
+@@ -113,7 +113,8 @@
+ "3.4-misc",
+ "3.4a",
+ "3.4b",
+- "3.4.1"
++ "3.4.1",
++ "3.5-filter-icons"
+ };
+ static const int numUpdates = sizeof updates / sizeof *updates;
+ // Warning: do not remove entries in the above array, or the update-level check below will break
+diff -urN kdepim-3.5.0.old/kmail/Makefile.am kdepim-3.5.0/kmail/Makefile.am
+--- kdepim-3.5.0.old/kmail/Makefile.am 2005-12-19 21:04:14.000000000 +0100
++++ kdepim-3.5.0/kmail/Makefile.am 2005-12-19 21:54:08.000000000 +0100
+@@ -175,7 +175,8 @@
+ kmail-3.3-misc.pl \
+ kmail-3.3b1-misc.pl \
+ kmail-3.4-misc.pl \
+- kmail-3.4.1-update-status-filters.pl
++ kmail-3.4.1-update-status-filters.pl \
++ kmail-3.5-filter-icons.pl
+
+ confdir = $(kde_confdir)
+ conf_DATA = kmail.antispamrc kmail.antivirusrc
diff --git a/kde-base/kmail/files/kmail-3.5.2-imap-fixes.diff b/kde-base/kmail/files/kmail-3.5.2-imap-fixes.diff
new file mode 100644
index 000000000000..0987d2692626
--- /dev/null
+++ b/kde-base/kmail/files/kmail-3.5.2-imap-fixes.diff
@@ -0,0 +1,291 @@
+--- kdepim/kmail/kmheaders.cpp 2006/03/02 12:26:51 515022
++++ kdepim/kmail/kmheaders.cpp 2006/04/22 08:13:05 532593
+@@ -1841,7 +1841,7 @@
+ bool foundUnreadMessage = false;
+
+ if (!mFolder) return -1;
+- if (!(mFolder->count()) > 0) return -1;
++ if (mFolder->count() <= 0) return -1;
+
+ if ((aStartAt >= 0) && (aStartAt < (int)mItems.size()))
+ item = mItems[aStartAt];
+@@ -2041,7 +2041,7 @@
+
+ int idx = item->msgId();
+ KMMessage *msg = mFolder->getMsg(idx);
+- if (!msg->transferInProgress())
++ if (msg && !msg->transferInProgress())
+ {
+ emit activated(mFolder->getMsg(idx));
+ }
+@@ -3280,7 +3280,8 @@
+ unlink(QFile::encodeName(sortFile));
+ kdWarning(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl;
+ kdWarning(5006) << __FILE__ << ":" << __LINE__ << endl;
+- //kmkernel->emergencyExit( i18n("Failure modifying %1\n(No space left on device?)").arg( sortFile ));
++
++ return true;
+ }
+ if(sortStream)
+ fclose(sortStream);
+--- kdepim/kmail/imapaccountbase.cpp 2006/02/23 14:32:38 512746
++++ kdepim/kmail/imapaccountbase.cpp 2006/04/15 13:05:11 530119
+@@ -1098,10 +1098,10 @@
+ {
+ DwBodyPart* newparent = dwpart;
+ const DwMessage* newmsg = dwmsg;
+- if ( part->originalContentTypeStr() == "MESSAGE/RFC822" &&
++ if ( part->originalContentTypeStr() == "MESSAGE/RFC822" && dwpart &&
+ dwpart->Body().Message() )
+ {
+- // set the encapsulated message as new parent message
++ // set the encapsulated message as the new message
+ newparent = 0;
+ newmsg = dwpart->Body().Message();
+ }
+@@ -1281,7 +1281,8 @@
+ if ( delim.isEmpty() ) {
+ delim = "/";
+ }
+- if ( !newName.endsWith( delim ) && !folderName.startsWith( delim ) ) {
++ if ( !newName.isEmpty() &&
++ !newName.endsWith( delim ) && !folderName.startsWith( delim ) ) {
+ newName = newName + delim;
+ }
+ newName = newName + folderName;
+--- kdepim/kmail/imapjob.cpp 2005/08/12 17:17:32 446148
++++ kdepim/kmail/imapjob.cpp 2006/04/15 09:06:10 530060
+@@ -97,11 +97,12 @@
+ // imap folder, use its account for keeping track of the job. Otherwise,
+ // this is a get job and the src folder is an imap one. Use its account
+ // then.
+- KMAcctImap *account;
++ KMAcctImap *account = 0;
+ if (folder) {
+ account = folder->account();
+ } else {
+- account = static_cast<KMFolderImap*>(msg_parent->storage())->account();
++ if ( msg_parent && msg_parent->storage() )
++ account = static_cast<KMFolderImap*>(msg_parent->storage())->account();
+ }
+ if ( !account ||
+ account->makeConnection() == ImapAccountBase::Error ) {
+@@ -223,21 +224,23 @@
+ if ( mDestFolder )
+ {
+ KMAcctImap *account = static_cast<KMFolderImap*>(mDestFolder->storage())->account();
+- if ( account && mJob ) {
+- ImapAccountBase::JobIterator it = account->findJob( mJob );
+- if ( it != account->jobsEnd() ) {
+- if( (*it).progressItem ) {
+- (*it).progressItem->setComplete();
+- (*it).progressItem = 0;
+- }
+- if ( !(*it).msgList.isEmpty() ) {
+- for ( QPtrListIterator<KMMessage> mit( (*it).msgList ); mit.current(); ++mit )
+- mit.current()->setTransferInProgress( false );
++ if ( account ) {
++ if ( mJob ) {
++ ImapAccountBase::JobIterator it = account->findJob( mJob );
++ if ( it != account->jobsEnd() ) {
++ if( (*it).progressItem ) {
++ (*it).progressItem->setComplete();
++ (*it).progressItem = 0;
++ }
++ if ( !(*it).msgList.isEmpty() ) {
++ for ( QPtrListIterator<KMMessage> mit( (*it).msgList ); mit.current(); ++mit )
++ mit.current()->setTransferInProgress( false );
++ }
+ }
++ account->removeJob( mJob );
+ }
+- account->removeJob( mJob );
++ account->mJobList.remove( this );
+ }
+- account->mJobList.remove( this );
+ mDestFolder->close();
+ }
+
+@@ -245,21 +248,23 @@
+ if (!mDestFolder || mDestFolder != mSrcFolder) {
+ if (! (mSrcFolder->folderType() == KMFolderTypeImap) ) return;
+ KMAcctImap *account = static_cast<KMFolderImap*>(mSrcFolder->storage())->account();
+- if ( account && mJob ) {
+- ImapAccountBase::JobIterator it = account->findJob( mJob );
+- if ( it != account->jobsEnd() ) {
+- if( (*it).progressItem ) {
+- (*it).progressItem->setComplete();
+- (*it).progressItem = 0;
+- }
+- if ( !(*it).msgList.isEmpty() ) {
+- for ( QPtrListIterator<KMMessage> mit( (*it).msgList ); mit.current(); ++mit )
+- mit.current()->setTransferInProgress( false );
++ if ( account ) {
++ if ( mJob ) {
++ ImapAccountBase::JobIterator it = account->findJob( mJob );
++ if ( it != account->jobsEnd() ) {
++ if( (*it).progressItem ) {
++ (*it).progressItem->setComplete();
++ (*it).progressItem = 0;
++ }
++ if ( !(*it).msgList.isEmpty() ) {
++ for ( QPtrListIterator<KMMessage> mit( (*it).msgList ); mit.current(); ++mit )
++ mit.current()->setTransferInProgress( false );
++ }
+ }
++ account->removeJob( mJob ); // remove the associated kio job
+ }
+- account->removeJob( mJob ); // remove the associated kio job
++ account->mJobList.remove( this ); // remove the folderjob
+ }
+- account->mJobList.remove( this ); // remove the folderjob
+ }
+ mSrcFolder->close();
+ }
+--- kdepim/kmail/kmfoldercachedimap.cpp 2006/02/11 22:39:04 508499
++++ kdepim/kmail/kmfoldercachedimap.cpp 2006/04/15 10:05:41 530074
+@@ -539,8 +539,11 @@
+ mRecurse = recurse;
+ assert( account() );
+
+- mAccount->mailCheckProgressItem()->reset();
+- mAccount->mailCheckProgressItem()->setTotalItems( 100 );
++ ProgressItem *progressItem = mAccount->mailCheckProgressItem();
++ if ( progressItem ) {
++ progressItem->reset();
++ progressItem->setTotalItems( 100 );
++ }
+ mProgress = 0;
+
+ #if 0
+@@ -1746,11 +1749,14 @@
+ f = static_cast<KMFolderCachedImap*>(newFolder->storage());
+ }
+ }
+- f->setAccount( mAccount );
+- f->setImapPath( "/INBOX/" );
+- f->folder()->setLabel( i18n("inbox") );
++ if ( f ) {
++ f->setAccount( mAccount );
++ f->setImapPath( "/INBOX/" );
++ f->folder()->setLabel( i18n("inbox") );
++ }
+ if (!node) {
+- f->close();
++ if ( f )
++ f->close();
+ kmkernel->dimapFolderMgr()->contentsChanged();
+ }
+ // so we have an INBOX
+--- kdepim/kmail/kmfolderimap.cpp 2006/03/15 14:19:26 518857
++++ kdepim/kmail/kmfolderimap.cpp 2006/04/15 13:05:11 530119
+@@ -110,6 +110,11 @@
+ if (mOpenCount <= 0 ) return;
+ if (mOpenCount > 0) mOpenCount--;
+ if (mOpenCount > 0 && !aForced) return;
++ if (isSelected() && !aForced) {
++ kdWarning(5006) << "Trying to close the selected folder " << label() <<
++ " - ignoring!" << endl;
++ return;
++ }
+ // FIXME is this still needed?
+ if (mAccount)
+ mAccount->ignoreJobsForFolder( folder() );
+@@ -873,8 +878,10 @@
+ }
+ kmkernel->imapFolderMgr()->contentsChanged();
+ }
+- f->initializeFrom( this, "/INBOX/", "message/directory" );
+- f->setChildrenState( QString::null );
++ if ( f ) {
++ f->initializeFrom( this, "/INBOX/", "message/directory" );
++ f->setChildrenState( QString::null );
++ }
+ // so we have an INBOX
+ mAccount->setHasInbox( true );
+ }
+@@ -1086,17 +1093,20 @@
+ int a = cstr.find("X-uidValidity: ");
+ int b = cstr.find("\r\n", a);
+ QString uidv;
+- if ( (b - a - 15) >= 0 ) uidv = cstr.mid(a + 15, b - a - 15);
++ if ( (b - a - 15) >= 0 )
++ uidv = cstr.mid(a + 15, b - a - 15);
+ a = cstr.find("X-Access: ");
+ b = cstr.find("\r\n", a);
+ QString access;
+- if ( (b - a - 10) >= 0 ) access = cstr.mid(a + 10, b - a - 10);
++ if ( (b - a - 10) >= 0 )
++ access = cstr.mid(a + 10, b - a - 10);
+ mReadOnly = access == "Read only";
+ a = cstr.find("X-Count: ");
+ b = cstr.find("\r\n", a);
+ int exists = -1;
+- bool ok;
+- if ( (b - a - 9) >= 0 ) exists = cstr.mid(a + 9, b - a - 9).toInt(&ok);
++ bool ok = false;
++ if ( (b - a - 9) >= 0 )
++ exists = cstr.mid(a + 9, b - a - 9).toInt(&ok);
+ if ( !ok ) exists = -1;
+ QString startUid;
+ if (uidValidity() != uidv)
+--- kdepim/kmail/kmfoldertree.cpp 2006/02/13 20:29:00 509156
++++ kdepim/kmail/kmfoldertree.cpp 2006/04/15 10:05:41 530074
+@@ -139,7 +139,7 @@
+ KIconLoader * il = KGlobal::instance()->iconLoader();
+ QPixmap pm = il->loadIcon( icon, KIcon::Small, size,
+ KIcon::DefaultState, 0, true );
+- if ( pm.isNull() ) {
++ if ( mFolder && pm.isNull() ) {
+ pm = il->loadIcon( mFolder->normalIconPath(), KIcon::Small, size,
+ KIcon::DefaultState, 0, true );
+ }
+@@ -157,7 +157,7 @@
+ pm = normalIcon( size );
+
+ KIconLoader * il = KGlobal::instance()->iconLoader();
+- if ( mFolder->useCustomIcons() ) {
++ if ( mFolder && mFolder->useCustomIcons() ) {
+ pm = il->loadIcon( mFolder->unreadIconPath(), KIcon::Small, size,
+ KIcon::DefaultState, 0, true );
+ if ( pm.isNull() )
+@@ -1020,10 +1020,10 @@
+ mMainWidget->action("compact")->plug(folderMenu);
+
+ folderMenu->insertSeparator();
+- if ( !fti->folder()->isSystemFolder() )
++ if ( !fti->folder()->isSystemFolder() ) {
+ mMainWidget->action("delete_folder")->plug(folderMenu);
+-
+- folderMenu->insertSeparator();
++ folderMenu->insertSeparator();
++ }
+ mMainWidget->action("empty")->plug(folderMenu);
+ folderMenu->insertSeparator();
+ }
+@@ -1477,7 +1477,8 @@
+
+ QString fldName, oldFldName;
+
+- oldFldName = fti->name(0);
++ if ( fti )
++ oldFldName = fti->name(0);
+
+ if (!text.isEmpty())
+ fldName = text;
+@@ -1546,10 +1547,12 @@
+
+ // get the unread count
+ int count = 0;
+- if (folder->noContent()) // always empty
++ if (folder && folder->noContent()) // always empty
+ count = -1;
+- else
+- count = fti->folder()->countUnread();
++ else {
++ if ( fti->folder() )
++ count = fti->folder()->countUnread();
++ }
+
+ // set it
+ bool repaint = false; \ No newline at end of file
diff --git a/kde-base/kmail/files/kmail-3.5.2-misc-fixes.diff b/kde-base/kmail/files/kmail-3.5.2-misc-fixes.diff
new file mode 100644
index 000000000000..001a0487d338
--- /dev/null
+++ b/kde-base/kmail/files/kmail-3.5.2-misc-fixes.diff
@@ -0,0 +1,273 @@
+--- kdepim/kmail/attachmentlistview.cpp 2005/07/26 18:54:59 438982
++++ kdepim/kmail/attachmentlistview.cpp 2006/04/15 06:51:13 530022
+@@ -92,7 +92,7 @@
+ QBuffer serNumBuffer( serNums );
+ serNumBuffer.open( IO_ReadOnly );
+ QDataStream serNumStream( &serNumBuffer );
+- unsigned long serNum;
++ Q_UINT32 serNum;
+ KMFolder *folder = 0;
+ int idx;
+ QPtrList<KMMsgBase> messageList;
+--- kdepim/kmail/configuredialog.cpp 2006/01/21 12:34:03 500799
++++ kdepim/kmail/configuredialog.cpp 2006/04/01 23:19:36 525407
+@@ -3348,15 +3348,12 @@
+ mAttachWordsListEditor, SLOT(setEnabled(bool)) );
+ }
+
+-void ComposerPage::AttachmentsTab::doLoadOther() {
+- KConfigGroup composer( KMKernel::config(), "Composer" );
+-
++void ComposerPage::AttachmentsTab::doLoadFromGlobalSettings() {
+ mOutlookCompatibleCheck->setChecked(
+- composer.readBoolEntry( "outlook-compatible-attachments", false ) );
++ GlobalSettings::self()->outlookCompatibleAttachments() );
+ mMissingAttachmentDetectionCheck->setChecked(
+- composer.readBoolEntry( "showForgottenAttachmentWarning", true ) );
+- QStringList attachWordsList =
+- composer.readListEntry( "attachment-keywords" );
++ GlobalSettings::self()->showForgottenAttachmentWarning() );
++ QStringList attachWordsList = GlobalSettings::self()->attachmentKeywords();
+ if ( attachWordsList.isEmpty() ) {
+ // default value
+ attachWordsList << QString::fromLatin1("attachment")
+@@ -3371,13 +3368,12 @@
+ }
+
+ void ComposerPage::AttachmentsTab::save() {
+- KConfigGroup composer( KMKernel::config(), "Composer" );
+- composer.writeEntry( "outlook-compatible-attachments",
+- mOutlookCompatibleCheck->isChecked() );
+- composer.writeEntry( "showForgottenAttachmentWarning",
+- mMissingAttachmentDetectionCheck->isChecked() );
+- composer.writeEntry( "attachment-keywords",
+- mAttachWordsListEditor->stringList() );
++ GlobalSettings::self()->setOutlookCompatibleAttachments(
++ mOutlookCompatibleCheck->isChecked() );
++ GlobalSettings::self()->setShowForgottenAttachmentWarning(
++ mMissingAttachmentDetectionCheck->isChecked() );
++ GlobalSettings::self()->setAttachmentKeywords(
++ mAttachWordsListEditor->stringList() );
+ }
+
+ void ComposerPageAttachmentsTab::slotOutlookCompatibleClicked()
+--- kdepim/kmail/kmedit.cpp 2006/02/20 11:40:20 511574
++++ kdepim/kmail/kmedit.cpp 2006/04/15 06:51:13 530022
+@@ -144,7 +144,7 @@
+ QBuffer serNumBuffer(serNums);
+ serNumBuffer.open(IO_ReadOnly);
+ QDataStream serNumStream(&serNumBuffer);
+- unsigned long serNum;
++ Q_UINT32 serNum;
+ KMFolder *folder = 0;
+ int idx;
+ QPtrList<KMMsgBase> messageList;
+--- kdepim/kmail/kmkernel.cpp 2006/04/09 09:53:18 527760
++++ kdepim/kmail/kmkernel.cpp 2006/04/09 09:53:52 527761
+@@ -1463,6 +1463,9 @@
+
+ void KMKernel::readConfig()
+ {
++ //Needed here, since this function is also called when the configuration
++ //changes, and the static variables should be updated then - IOF
++ KMMessage::readConfig();
+ }
+
+ void KMKernel::cleanupImapFolders()
+--- kdepim/kmail/kmmsgbase.cpp 2006/01/11 14:34:42 496941
++++ kdepim/kmail/kmmsgbase.cpp 2006/04/15 13:05:11 530119
+@@ -870,7 +870,7 @@
+
+ char *l;
+ for ( l = latin.data(); *l; ++l ) {
+- if ( ( *l & 0xE0 == 0 ) || ( *l & 0x80 ) )
++ if ( ( ( *l & 0xE0 ) == 0 ) || ( *l & 0x80 ) )
+ // *l is control character or 8-bit char
+ break;
+ }
+--- kdepim/kmail/kmmsgdict.cpp 2005/07/26 18:54:59 438982
++++ kdepim/kmail/kmmsgdict.cpp 2006/04/15 13:05:11 530119
+@@ -205,7 +205,16 @@
+ }
+
+ KMFolderIndex* folder = static_cast<KMFolderIndex*>( msg->storage() );
+- if (folder && index == -1)
++ if ( !folder ) {
++ kdDebug(5006) << "KMMsgDict::insert: Cannot insert the message, "
++ << "null pointer to storage. Requested serial: " << msgSerNum
++ << endl;
++ kdDebug(5006) << " Message info: Subject: " << msg->subject() << ", To: "
++ << msg->toStrip() << ", Date: " << msg->dateStr() << endl;
++ return 0;
++ }
++
++ if (index == -1)
+ index = folder->find(msg);
+
+ // Should not happen, indicates id file corruption
+@@ -241,7 +250,16 @@
+ const KMMsgBase *msg, int index)
+ {
+ KMFolderIndex* folder = static_cast<KMFolderIndex*>( msg->storage() );
+- if ( folder && index == -1 )
++ if ( !folder ) {
++ kdDebug(5006) << "KMMsgDict::replace: Cannot replace the message serial "
++ << "number, null pointer to storage. Requested serial: " << msgSerNum
++ << endl;
++ kdDebug(5006) << " Message info: Subject: " << msg->subject() << ", To: "
++ << msg->toStrip() << ", Date: " << msg->dateStr() << endl;
++ return;
++ }
++
++ if ( index == -1 )
+ index = folder->find( msg );
+
+ remove( msgSerNum );
+--- kdepim/kmail/kmsender.cpp 2006/03/20 17:51:08 520754
++++ kdepim/kmail/kmsender.cpp 2006/04/15 13:05:11 530119
+@@ -373,8 +373,10 @@
+ KMessageBox::information(0, i18n("Critical error: "
+ "Unable to process sent mail (out of space?)"
+ "Moving failing message to \"sent-mail\" folder."));
+- sentFolder->moveMsg(mCurrentMsg);
+- sentFolder->close();
++ if ( sentFolder ) {
++ sentFolder->moveMsg(mCurrentMsg);
++ sentFolder->close();
++ }
+ cleanup();
+ return;
+ case 1:
+--- kdepim/kmail/objecttreeparser.cpp 2005/12/16 16:18:58 488973
++++ kdepim/kmail/objecttreeparser.cpp 2006/04/02 13:18:14 525563
+@@ -92,6 +92,7 @@
+ #include <qbuffer.h>
+ #include <qpixmap.h>
+ #include <qpainter.h>
++#include <qregexp.h>
+
+ // other headers
+ #include <memory>
+@@ -765,30 +766,21 @@
+ //static
+ bool ObjectTreeParser::containsExternalReferences( const QCString & str )
+ {
+- int httpPos = str.find( "\"http:", 0, true );
+- int httpsPos = str.find( "\"https:", 0, true );
++ QRegExp httpRegExp("(\\\"|\\\'|url\\s*\\(\\s*)http[s]?:");
++ int httpPos = str.find( httpRegExp, 0 );
+
+- while ( httpPos >= 0 || httpsPos >= 0 ) {
+- // pos = index of next occurrence of "http: or "https: whichever comes first
+- int pos = ( httpPos < httpsPos )
+- ? ( ( httpPos >= 0 ) ? httpPos : httpsPos )
+- : ( ( httpsPos >= 0 ) ? httpsPos : httpPos );
++ while ( httpPos >= 0 ) {
+ // look backwards for "href"
+- if ( pos > 5 ) {
+- int hrefPos = str.findRev( "href", pos - 5, true );
++ if ( httpPos > 5 ) {
++ int hrefPos = str.findRev( "href", httpPos - 5, true );
+ // if no 'href' is found or the distance between 'href' and '"http[s]:'
+ // is larger than 7 (7 is the distance in 'href = "http[s]:') then
+ // we assume that we have found an external reference
+- if ( ( hrefPos == -1 ) || ( pos - hrefPos > 7 ) )
++ if ( ( hrefPos == -1 ) || ( httpPos - hrefPos > 7 ) )
+ return true;
+ }
+ // find next occurrence of "http: or "https:
+- if ( pos == httpPos ) {
+- httpPos = str.find( "\"http:", httpPos + 6, true );
+- }
+- else {
+- httpsPos = str.find( "\"https:", httpsPos + 7, true );
+- }
++ httpPos = str.find( httpRegExp, httpPos + 6 );
+ }
+ return false;
+ }
+--- kdepim/kmail/renamejob.cpp 2005/12/10 04:41:02 487311
++++ kdepim/kmail/renamejob.cpp 2006/04/15 13:05:11 530119
+@@ -59,11 +59,13 @@
+ mNewName( newName ), mNewFolder( 0 )
+ {
+ mStorageTempOpened = 0;
+- mOldName = storage->name();
+- if ( storage->folderType() == KMFolderTypeImap ) {
+- mOldImapPath = static_cast<KMFolderImap*>(storage)->imapPath();
+- } else if ( storage->folderType() == KMFolderTypeCachedImap ) {
+- mOldImapPath = static_cast<KMFolderCachedImap*>(storage)->imapPath();
++ if ( storage ) {
++ mOldName = storage->name();
++ if ( storage->folderType() == KMFolderTypeImap ) {
++ mOldImapPath = static_cast<KMFolderImap*>(storage)->imapPath();
++ } else if ( storage->folderType() == KMFolderTypeCachedImap ) {
++ mOldImapPath = static_cast<KMFolderCachedImap*>(storage)->imapPath();
++ }
+ }
+ }
+
+--- kdepim/kmail/configuredialog_p.h 2005/08/19 15:04:44 450950
++++ kdepim/kmail/configuredialog_p.h 2006/04/01 23:19:36 525407
+@@ -715,8 +715,7 @@
+ void slotOutlookCompatibleClicked();
+
+ private:
+- //virtual void doLoadFromGlobalSettings();
+- virtual void doLoadOther();
++ virtual void doLoadFromGlobalSettings();
+ //FIXME virtual void doResetToDefaultsOther();
+
+ private:
+--- kdepim/kmail/replyphrases.kcfg 2006/04/09 09:53:18 527760
++++ kdepim/kmail/replyphrases.kcfg 2006/04/09 09:53:52 527761
+@@ -20,17 +20,14 @@
+ <entry name="PhraseForward" type="String" key="phrase-forward">
+ <label></label>
+ <whatsthis></whatsthis>
+- <default>Forwarded Message</default>
+ </entry>
+ <entry name="PhraseReplySender" type="String" key="phrase-reply">
+ <label></label>
+ <whatsthis></whatsthis>
+- <default>On %D, you wrote:</default>
+ </entry>
+ <entry name="PhraseReplyAll" type="String" key="phrase-reply-all">
+ <label></label>
+ <whatsthis></whatsthis>
+- <default>On %D, %F wrote:</default>
+ </entry>
+
+ </group>
+--- kdepim/kmail/kmfolder.cpp 2005/12/06 21:29:44 486141
++++ kdepim/kmail/kmfolder.cpp 2006/04/18 20:41:15 531267
+@@ -84,12 +84,6 @@
+ }
+ }
+
+- // trigger from here, since it needs a fully constructed FolderStorage
+- if ( mExportsSernums )
+- mStorage->registerWithMessageDict();
+- if ( !mHasIndex )
+- mStorage->setAutoCreateIndex( false );
+-
+ if ( aParent ) {
+ connect( mStorage, SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ),
+ aParent->manager(), SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ) );
+@@ -133,8 +127,16 @@
+ this, SLOT( slotContentsTypeChanged( KMail::FolderContentsType ) ) );
+
+ //FIXME: Centralize all the readConfig calls somehow - Zack
++ // Meanwhile, readConfig must be done before registerWithMessageDict, since
++ // that one can call writeConfig in some circumstances - David
+ mStorage->readConfig();
+
++ // trigger from here, since it needs a fully constructed FolderStorage
++ if ( mExportsSernums )
++ mStorage->registerWithMessageDict();
++ if ( !mHasIndex )
++ mStorage->setAutoCreateIndex( false );
++
+ if ( mId == 0 && aParent )
+ mId = aParent->manager()->createId();
+ }
diff --git a/kde-base/kmail/kmail-3.5.2-r1.ebuild b/kde-base/kmail/kmail-3.5.2-r1.ebuild
new file mode 100644
index 000000000000..2d71f6a975be
--- /dev/null
+++ b/kde-base/kmail/kmail-3.5.2-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kmail/kmail-3.5.2-r1.ebuild,v 1.1 2006/04/22 11:19:15 carlo Exp $
+
+KMNAME=kdepim
+MAXKDEVER=$PV
+KM_DEPRANGE="$PV $MAXKDEVER"
+inherit kde-meta eutils
+
+DESCRIPTION="KDE mail client"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+DEPEND="$(deprange 3.5.0-r3 $MAXKDEVER kde-base/libkdenetwork)
+ $(deprange $PV $MAXKDEVER kde-base/libkdepim)
+ $(deprange $PV $MAXKDEVER kde-base/libkpimidentities)
+ $(deprange 3.5.1 $MAXKDEVER kde-base/mimelib)
+ $(deprange 3.5.0-r3 $MAXKDEVER kde-base/libksieve)
+ $(deprange $PV $MAXKDEVER kde-base/certmanager)
+ $(deprange $PV $MAXKDEVER kde-base/libkcal)
+ $(deprange $PV $MAXKDEVER kde-base/kontact)"
+RDEPEND="${DEPEND}
+ crypt? ( !ppc64? ( app-crypt/pinentry ) )
+ $(deprange $PV $MAXKDEVER kde-base/kdepim-kioslaves)
+ $(deprange 3.5.1 $MAXKDEVER kde-base/kmailcvt)
+ $(deprange-dual $PV $MAXKDEVER kde-base/kdebase-kioslaves)
+ $(deprange-dual $PV $MAXKDEVER kde-base/kcontrol)" # for the "looknfeel" icon, and probably others.
+
+KMCOPYLIB="
+ libkdepim libkdepim/
+ libkpimidentities libkpimidentities/
+ libmimelib mimelib/
+ libksieve libksieve/
+ libkleopatra certmanager/lib/
+ libkcal libkcal
+ libkpinterfaces kontact/interfaces/
+ libkmime libkmime
+ libkpgp libkpgp"
+KMEXTRACTONLY="
+ libkdenetwork/
+ libkdepim/
+ libkpimidentities/
+ libksieve/
+ libkcal/
+ mimelib/
+ certmanager/
+ korganizer/korganizeriface.h
+ kontact/interfaces/
+ libkmime/
+ libkpgp
+ dcopidlng"
+KMCOMPILEONLY="libemailfunctions"
+# the kmail plugins are installed with kmail
+KMEXTRA="
+ plugins/kmail/
+ kontact/plugins/kmail/" # We add here the kontact's plugin instead of compiling it with kontact because it needs a lot of this programs deps.
+
+PATCHES="${FILESDIR}/kmail-3.5.2-imap-fixes.diff
+ ${FILESDIR}/kmail-3.5.2-misc-fixes.diff
+ ${FILESDIR}/kmail-3.5-ham_spam_icons.diff" \ No newline at end of file