summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Tennis <caleb@gentoo.org>2006-05-12 12:20:53 +0000
committerCaleb Tennis <caleb@gentoo.org>2006-05-12 12:20:53 +0000
commitafd87281719f35d7ec4ac502d437eb74c77ba8d2 (patch)
treed7409872d955a99c04aa5b11396bc8e532c48f8f /kde-base/kdepim
parentSome more upstream patches from Carlo (diff)
downloadgentoo-2-afd87281719f35d7ec4ac502d437eb74c77ba8d2.tar.gz
gentoo-2-afd87281719f35d7ec4ac502d437eb74c77ba8d2.tar.bz2
gentoo-2-afd87281719f35d7ec4ac502d437eb74c77ba8d2.zip
revbump to incorporate some upstream patches, from Carlo
(Portage version: 2.1_pre10-r5)
Diffstat (limited to 'kde-base/kdepim')
-rw-r--r--kde-base/kdepim/ChangeLog11
-rw-r--r--kde-base/kdepim/files/digest-kdepim-3.5.2-r23
-rw-r--r--kde-base/kdepim/files/kmail-3.5.2-imap-fixes-2.diff434
-rw-r--r--kde-base/kdepim/files/kmail-3.5.2-misc-fixes-2.diff329
-rw-r--r--kde-base/kdepim/files/libkcal-3.5.2-fixes.diff39
-rw-r--r--kde-base/kdepim/files/libkdepim-3.5.2-call_qt3_designer.diff20
-rw-r--r--kde-base/kdepim/files/libkdepim-3.5.2-fixes.diff57
-rw-r--r--kde-base/kdepim/kdepim-3.5.2-r2.ebuild29
8 files changed, 921 insertions, 1 deletions
diff --git a/kde-base/kdepim/ChangeLog b/kde-base/kdepim/ChangeLog
index 94dbca6a5731..15d256a5dd79 100644
--- a/kde-base/kdepim/ChangeLog
+++ b/kde-base/kdepim/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for kde-base/kdepim
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/ChangeLog,v 1.199 2006/05/05 12:54:59 caleb Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/ChangeLog,v 1.200 2006/05/12 12:20:53 caleb Exp $
+
+*kdepim-3.5.2-r2 (12 May 2006)
+
+ 12 May 2006; Caleb Tennis <caleb@gentoo.org>
+ +files/libkdepim-3.5.2-call_qt3_designer.diff,
+ +files/libkcal-3.5.2-fixes.diff, +files/libkdepim-3.5.2-fixes.diff,
+ +files/kmail-3.5.2-imap-fixes-2.diff,
+ +files/kmail-3.5.2-misc-fixes-2.diff, +kdepim-3.5.2-r2.ebuild:
+ revbump to incorporate some upstream patches, from Carlo
*kdepim-3.5.2-r1 (05 May 2006)
diff --git a/kde-base/kdepim/files/digest-kdepim-3.5.2-r2 b/kde-base/kdepim/files/digest-kdepim-3.5.2-r2
new file mode 100644
index 000000000000..614bd87074cf
--- /dev/null
+++ b/kde-base/kdepim/files/digest-kdepim-3.5.2-r2
@@ -0,0 +1,3 @@
+MD5 ac6b3b503e27a65a7b883c1e0a57262e kdepim-3.5.2.tar.bz2 12887336
+RMD160 8e6571d14bbf6b3370c4fdb108a1a79625e87365 kdepim-3.5.2.tar.bz2 12887336
+SHA256 9c038a80912894b3ec132b2c7219ec5549ca80dcdeec88555928d2e038966539 kdepim-3.5.2.tar.bz2 12887336
diff --git a/kde-base/kdepim/files/kmail-3.5.2-imap-fixes-2.diff b/kde-base/kdepim/files/kmail-3.5.2-imap-fixes-2.diff
new file mode 100644
index 000000000000..f8d7326327f9
--- /dev/null
+++ b/kde-base/kdepim/files/kmail-3.5.2-imap-fixes-2.diff
@@ -0,0 +1,434 @@
+--- 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/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/kmfoldercachedimap.cpp 2006/02/11 22:39:04 508499
++++ kdepim/kmail/kmfoldercachedimap.cpp 2006/05/01 18:24:21 536266
+@@ -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
+@@ -1115,12 +1118,12 @@
+ job->start();
+ return;
+ } else {
+- const QString msg ( i18n( "<p>There are new messages in this folder, which "
++ const QString msg ( i18n( "<p>There are new messages in this folder (%1), which "
+ "have not been uploaded to the server yet, but you do not seem to "
+ "have sufficient access rights on the folder now to upload them. "
+ "Please contact your administrator to allow upload of new messages "
+ "to you, or move them out of this folder.</p> "
+- "<p>Do you want to move these messages to another folder now?</p>") );
++ "<p>Do you want to move these messages to another folder now?</p>").arg( folder()->prettyURL() ) );
+ if ( KMessageBox::warningYesNo( 0, msg, QString::null, i18n("Move"), i18n("Do Not Move") ) == KMessageBox::Yes ) {
+ KMail::KMFolderSelDlg dlg( kmkernel->getKMMainWidget(),
+ i18n("Move Messages to Folder"), true );
+@@ -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/kmfoldertree.cpp 2006/02/13 20:29:00 509156
++++ kdepim/kmail/kmfoldertree.cpp 2006/04/28 09:54:26 534978
+@@ -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();
+ }
+@@ -1472,7 +1472,7 @@
+
+ KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>(item);
+
+- if (fti && fti->folder() && col != 0 && !currentFolder()->child())
++ if ((!fti) || (fti && fti->folder() && col != 0 && !currentFolder()->child()))
+ return;
+
+ QString fldName, oldFldName;
+@@ -1546,10 +1546,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;
+@@ -1848,6 +1850,9 @@
+ void KMFolderTree::moveFolder( KMFolder* destination )
+ {
+ KMFolder* folder = currentFolder();
++ if (!folder)
++ return;
++
+ KMFolderDir* parent = &(kmkernel->folderMgr()->dir());
+ if ( destination )
+ parent = destination->createChildFolder();
+@@ -1857,7 +1862,7 @@
+
+ KMFolderDir* folderDir = parent;
+ // check that the folder can be moved
+- if ( folder && folder->child() )
++ if ( folder->child() )
+ {
+ while ( folderDir && ( folderDir != &kmkernel->folderMgr()->dir() ) &&
+ ( folderDir != folder->parent() ) )
+@@ -1871,13 +1876,13 @@
+ }
+ }
+
+- if( folder && folder->child() && parent &&
++ if( folder->child() && parent &&
+ ( parent->path().find( folder->child()->path() + "/" ) == 0 ) ) {
+ KMessageBox::error( this, message );
+ return;
+ }
+
+- if( folder && folder->child()
++ if( folder->child()
+ && ( parent == folder->child() ) ) {
+ KMessageBox::error( this, message );
+ return;
+--- kdepim/kmail/imapjob.cpp 2005/08/12 17:17:32 446148
++++ kdepim/kmail/imapjob.cpp 2006/05/04 21:30:58 537478
+@@ -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 ) {
+@@ -127,7 +128,7 @@
+ url.setPath( folder->imapPath() + ";SECTION=" + flags );
+ ImapAccountBase::jobData jd;
+ jd.parent = 0; jd.offset = 0; jd.done = 0;
+- jd.total = ( curMsg->msgSizeServer() > 0 ) ?
++ jd.total = ( curMsg->msgSizeServer() > 0 ) ?
+ curMsg->msgSizeServer() : curMsg->msgSize();
+ jd.msgList.append( curMsg );
+ QCString cstr( curMsg->asString() );
+@@ -192,7 +193,7 @@
+ "ImapJobCopyMove"+ProgressManager::getUniqueID(),
+ i18n("Server operation"),
+ i18n("Source folder: %1 - Destination folder: %2")
+- .arg( msg_parent->prettyURL(),
++ .arg( msg_parent->prettyURL(),
+ mDestFolder->prettyURL() ),
+ true,
+ account->useSSL() || account->useTLS() );
+@@ -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();
+ }
+@@ -270,15 +275,15 @@
+ void ImapJob::slotGetNextMessage()
+ {
+ KMMessage *msg = mMsgList.first();
+- KMFolderImap *msgParent = static_cast<KMFolderImap*>(msg->storage());
+- KMAcctImap *account = msgParent->account();
+- if ( msg->UID() == 0 )
++ KMFolderImap *msgParent = msg ? static_cast<KMFolderImap*>(msg->storage()) : 0;
++ if ( !msgParent || msg->UID() == 0 )
+ {
+ // broken message
+ emit messageRetrieved( 0 );
+ deleteLater();
+ return;
+ }
++ KMAcctImap *account = msgParent->account();
+ KURL url = account->getUrl();
+ QString path = msgParent->imapPath() + ";UID=" + QString::number(msg->UID());
+ ImapAccountBase::jobData jd;
+@@ -391,7 +396,7 @@
+ dataSize = Util::crlf2lf( (*it).data.data(), dataSize ); // always <=
+ (*it).data.resize( dataSize );
+
+- // During the construction of the message from the byteArray it does
++ // During the construction of the message from the byteArray it does
+ // not have a uid. Therefore we have to make sure that no connected
+ // slots are called, since they would operate on uid == 0.
+ msg->parent()->storage()->blockSignals( true );
+@@ -445,7 +450,7 @@
+ parent->ignoreJobsForMessage( msg );
+ int idx = parent->find( msg );
+ if (idx != -1) parent->removeMsg( idx, true );
+- // the removeMsg will unGet the message, which will delete all
++ // the removeMsg will unGet the message, which will delete all
+ // jobs, including this one
+ return;
+ }
+--- kdepim/kmail/kmacctcachedimap.cpp 2005/07/26 18:54:59 438982
++++ kdepim/kmail/kmacctcachedimap.cpp 2006/05/06 09:14:35 537923
+@@ -381,14 +381,14 @@
+ //-----------------------------------------------------------------------------
+ void KMAcctCachedImap::addDeletedFolder( KMFolder* folder )
+ {
+- if ( folder->folderType() != KMFolderTypeCachedImap )
++ if ( !folder || folder->folderType() != KMFolderTypeCachedImap )
+ return;
+ KMFolderCachedImap* storage = static_cast<KMFolderCachedImap*>(folder->storage());
+ addDeletedFolder( storage->imapPath() );
+ kdDebug(5006) << k_funcinfo << storage->imapPath() << endl;
+
+ // Add all child folders too
+- if( folder && folder->child() ) {
++ if( folder->child() ) {
+ KMFolderNode *node = folder->child()->first();
+ while( node ) {
+ if( !node->isDir() ) {
+--- kdepim/kmail/kmcommands.cpp 2006/03/14 20:17:40 518656
++++ kdepim/kmail/kmcommands.cpp 2006/05/06 09:14:35 537923
+@@ -1724,7 +1724,7 @@
+ msg = srcFolder->getMsg(idx);
+ }
+
+- if (srcFolder &&
++ if (srcFolder && mDestFolder &&
+ (srcFolder->folderType()== KMFolderTypeImap) &&
+ (mDestFolder->folderType() == KMFolderTypeImap) &&
+ (static_cast<KMFolderImap*>(srcFolder->storage())->account() ==
+@@ -1761,7 +1761,7 @@
+ }
+ }
+
+- if (!isMessage && list.isEmpty())
++ if (srcFolder && !isMessage && list.isEmpty())
+ {
+ assert(idx != -1);
+ srcFolder->unGetMsg( idx );
diff --git a/kde-base/kdepim/files/kmail-3.5.2-misc-fixes-2.diff b/kde-base/kdepim/files/kmail-3.5.2-misc-fixes-2.diff
new file mode 100644
index 000000000000..f05626b998f5
--- /dev/null
+++ b/kde-base/kdepim/files/kmail-3.5.2-misc-fixes-2.diff
@@ -0,0 +1,329 @@
+--- 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/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/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();
+ }
+--- kdepim/kmail/configuredialog.cpp 2006/01/21 12:34:03 500799
++++ kdepim/kmail/configuredialog.cpp 2006/05/03 08:46:45 536841
+@@ -2276,7 +2276,7 @@
+ const QString encoding = KGlobal::charsets()->encodingForName(*it);
+ if ( encoding == "iso-8859-15" )
+ indexOfLatin9 = i;
+- if( false && encoding == currentEncoding )
++ if( encoding == currentEncoding )
+ {
+ mCharsetCombo->setCurrentItem( i );
+ found = true;
+@@ -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/antispamwizard.cpp 2005/12/30 00:15:02 492457
++++ kdepim/kmail/antispamwizard.cpp 2006/05/06 09:14:35 537923
+@@ -502,7 +502,7 @@
+ while ( account ) {
+ if ( account->type() == "pop" || account->type().contains( "imap" ) ) {
+ const NetworkAccount * n = dynamic_cast<const NetworkAccount*>( account );
+- if ( n->host().lower().contains( pattern.lower() ) ) {
++ if ( n && n->host().lower().contains( pattern.lower() ) ) {
+ mInfoPage->addAvailableTool( (*it).getVisibleName() );
+ found = true;
+ }
+--- kdepim/kmail/kmmessage.cpp 2006/03/16 12:47:35 519171
++++ kdepim/kmail/kmmessage.cpp 2006/05/06 09:14:35 537923
+@@ -2667,7 +2667,7 @@
+ parts.removeLast();
+ }
+
+- if (part->Body().Message() &&
++ if (part && part->Body().Message() &&
+ part->Body().Message()->Body().FirstBodyPart())
+ {
+ part = part->Body().Message()->Body().FirstBodyPart();
+--- kdepim/kmail/kmreaderwin.cpp 2006/02/20 20:15:05 511744
++++ kdepim/kmail/kmreaderwin.cpp 2006/05/06 09:14:35 537923
+@@ -371,7 +371,7 @@
+ if( dataNode->parentNode() && !weAreReplacingTheRootNode ) {
+ kdDebug(5006) << "dataNode is NOT replacing the root node: Store the headers." << endl;
+ resultingData += headers->AsString().c_str();
+- } else if( weAreReplacingTheRootNode && part->hasHeaders() ){
++ } else if( weAreReplacingTheRootNode && part && part->hasHeaders() ){
+ kdDebug(5006) << "dataNode replace the root node: Do NOT store the headers but change" << endl;
+ kdDebug(5006) << " the Message's headers accordingly." << endl;
+ kdDebug(5006) << " old Content-Type = " << rootHeaders.ContentType().AsString().c_str() << endl;
+--- kdepim/kmail/kmsender.cpp 2006/03/20 17:51:08 520754
++++ kdepim/kmail/kmsender.cpp 2006/05/06 09:14:35 537923
+@@ -373,12 +373,14 @@
+ 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:
+- if (sentFolder->moveMsg(mCurrentMsg) != 0)
++ if ( sentFolder && sentFolder->moveMsg(mCurrentMsg) != 0 )
+ {
+ KMessageBox::error(0, i18n("Moving the sent message \"%1\" from the "
+ "\"outbox\" to the \"sent-mail\" folder failed.\n"
+--- kdepim/kmail/objecttreeparser.cpp 2005/12/16 16:18:58 488973
++++ kdepim/kmail/objecttreeparser.cpp 2006/05/06 09:14:35 537923
+@@ -92,6 +92,7 @@
+ #include <qbuffer.h>
+ #include <qpixmap.h>
+ #include <qpainter.h>
++#include <qregexp.h>
+
+ // other headers
+ #include <memory>
+@@ -277,7 +278,7 @@
+ << node->typeString() << '/' << node->subTypeString()
+ << ')' << endl;
+
+- if ( !bpf->process( this, node, processResult ) )
++ if ( bpf && !bpf->process( this, node, processResult ) )
+ defaultHandling( node, processResult );
+ }
+ node->setProcessed( true, false );
+@@ -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;
+ }
diff --git a/kde-base/kdepim/files/libkcal-3.5.2-fixes.diff b/kde-base/kdepim/files/libkcal-3.5.2-fixes.diff
new file mode 100644
index 000000000000..a357e45c31c4
--- /dev/null
+++ b/kde-base/kdepim/files/libkcal-3.5.2-fixes.diff
@@ -0,0 +1,39 @@
+--- kdepim/libkcal/libical/src/libical/icalarray.c 2005/07/26 18:54:59 438982
++++ kdepim/libkcal/libical/src/libical/icalarray.c 2006/05/06 09:14:35 537923
+@@ -149,10 +149,10 @@
+ new_space_allocated * array->element_size);
+ */
+ new_data = malloc(new_space_allocated * array->element_size);
+- memcpy(new_data,array->data,array->element_size*array->space_allocated);
+- free(array->data);
+
+ if (new_data) {
++ memcpy(new_data,array->data,array->element_size*array->space_allocated);
++ free(array->data);
+ array->data = new_data;
+ array->space_allocated = new_space_allocated;
+ } else {
+--- kdepim/libkcal/libical/src/libical/icalcomponent.c 2005/09/18 12:37:01 461680
++++ kdepim/libkcal/libical/src/libical/icalcomponent.c 2006/05/06 09:14:35 537923
+@@ -848,8 +848,8 @@
+
+ /** Now test against the EXRULEs **/
+ for (exrule = icalcomponent_get_first_property(comp,ICAL_EXRULE_PROPERTY);
+- exdate != NULL;
+- exdate = icalcomponent_get_next_property(comp,ICAL_EXRULE_PROPERTY)) {
++ exrule != NULL;
++ exrule = icalcomponent_get_next_property(comp,ICAL_EXRULE_PROPERTY)) {
+
+ struct icalrecurrencetype recur = icalproperty_get_exrule(exrule);
+ icalrecur_iterator *exrule_itr = icalrecur_iterator_new(recur, *dtstart);
+--- kdepim/libkcal/libical/src/libical/icaltypes.c 2005/07/26 18:54:59 438982
++++ kdepim/libkcal/libical/src/libical/icaltypes.c 2006/05/06 09:14:35 537923
+@@ -77,7 +77,7 @@
+
+
+ struct icaltriggertype tr, null_tr;
+- icalerrorstate es;
++ icalerrorstate es = ICAL_ERROR_UNKNOWN;
+ icalerrorenum e;
+
+ tr.time= icaltime_null_time();
diff --git a/kde-base/kdepim/files/libkdepim-3.5.2-call_qt3_designer.diff b/kde-base/kdepim/files/libkdepim-3.5.2-call_qt3_designer.diff
new file mode 100644
index 000000000000..f32ebe9c124b
--- /dev/null
+++ b/kde-base/kdepim/files/libkdepim-3.5.2-call_qt3_designer.diff
@@ -0,0 +1,20 @@
+--- kdepim/libkdepim/kcmdesignerfields.cpp.orig 2006-05-07 04:05:20.000000000 +0200
++++ kdepim/libkdepim/kcmdesignerfields.cpp 2006-05-07 04:06:33.000000000 +0200
+@@ -264,7 +264,7 @@
+ QVBoxLayout *layout = new QVBoxLayout( this, KDialog::marginHint(),
+ KDialog::spacingHint() );
+
+- bool noDesigner = KStandardDirs::findExe("designer").isEmpty();
++ bool noDesigner = KStandardDirs::findExe("/usr/qt/3/bin/designer").isEmpty();
+
+ if ( noDesigner )
+ {
+@@ -407,7 +407,7 @@
+
+ void KCMDesignerFields::startDesigner()
+ {
+- QString cmdLine = "designer";
++ QString cmdLine = "/usr/qt/3/bin/designer";
+
+ // check if path exists and create one if not.
+ QString cepPath = localUiDir();
diff --git a/kde-base/kdepim/files/libkdepim-3.5.2-fixes.diff b/kde-base/kdepim/files/libkdepim-3.5.2-fixes.diff
new file mode 100644
index 000000000000..04fce865d08b
--- /dev/null
+++ b/kde-base/kdepim/files/libkdepim-3.5.2-fixes.diff
@@ -0,0 +1,57 @@
+--- kdepim/libkdepim/kcmdesignerfields.cpp 2005/09/08 15:37:56 458580
++++ kdepim/libkdepim/kcmdesignerfields.cpp 2006/04/15 12:39:26 530112
+@@ -99,8 +99,7 @@
+ }
+
+ delete list;
+- } else
+- delete wdg;
++ }
+ }
+
+ QString name() const { return mName; }
+--- kdepim/libkdepim/kfoldertree.cpp 2005/07/26 18:54:59 438982
++++ kdepim/libkdepim/kfoldertree.cpp 2006/04/15 12:39:26 530112
+@@ -225,9 +225,9 @@
+
+ KListViewItem::paintCell( p, cg, column, width, align );
+
+- int r = lv ? lv->itemMargin() : 1;
+ const QPixmap *icon = pixmap( column );
+ int marg = lv ? lv->itemMargin() : 1;
++ int r = marg;
+
+ QString t;
+ QRect br;
+@@ -238,7 +238,7 @@
+ p->setPen( ft->paintInfo().colFore );
+
+ if ( icon ) {
+- r += icon->width() + lv->itemMargin();
++ r += icon->width() + marg;
+ }
+ t = text( column );
+ if ( !t.isEmpty() )
+--- kdepim/libkdepim/kscoringeditor.cpp 2006/03/24 15:55:54 522155
++++ kdepim/libkdepim/kscoringeditor.cpp 2006/05/06 09:14:35 537923
+@@ -127,8 +127,8 @@
+
+ void SingleConditionWidget::toggleRegExpButton( int selected )
+ {
+- bool isRegExp = KScoringExpression::MATCH == selected &&
+- KScoringExpression::MATCHCS == selected &&
++ bool isRegExp = (KScoringExpression::MATCH == selected ||
++ KScoringExpression::MATCHCS == selected) &&
+ !KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty();
+ regExpButton->setEnabled( isRegExp );
+ }
+@@ -248,7 +248,8 @@
+ w = new QLabel( stack ); // empty dummy
+ break;
+ }
+- stack->addWidget(w,index++);
++ if ( w )
++ stack->addWidget(w,index++);
+ }
+ }
+
diff --git a/kde-base/kdepim/kdepim-3.5.2-r2.ebuild b/kde-base/kdepim/kdepim-3.5.2-r2.ebuild
new file mode 100644
index 000000000000..e74927ef75e7
--- /dev/null
+++ b/kde-base/kdepim/kdepim-3.5.2-r2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/kdepim-3.5.2-r2.ebuild,v 1.1 2006/05/12 12:20:53 caleb Exp $
+
+inherit kde-dist
+
+DESCRIPTION="KDE PIM (Personal Information Management) apps: korganizer, kmail, knode..."
+
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="crypt gnokii pda"
+
+DEPEND="~kde-base/kdebase-${PV}
+ >=dev-libs/cyrus-sasl-2
+ pda? ( app-pda/pilot-link dev-libs/libmal )
+ gnokii? ( app-mobilephone/gnokii )
+ crypt? ( >=app-crypt/gpgme-0.9.0-r1 )"
+
+PATCHES="${FILESDIR}/imap-dos.diff
+ ${FILESDIR}/libkcal-3.5.2-fixes.diff
+ ${FILESDIR}/kmail-3.5.2-imap-fixes-2.diff
+ ${FILESDIR}/kmail-3.5.2-misc-fixes-2.diff
+ ${FILESDIR}/libkdepim-3.5.2-call_qt3_designer.diff
+ ${FILESDIR}/libkdepim-3.5.2-fixes.diff"
+
+src_compile() {
+ local myconf="--with-sasl $(use_with gnokii)"
+
+ kde_src_compile
+}