From 8694d8aa01a158e0a7c9852ccd307bf4b47c628b Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Mon, 18 Aug 2008 17:32:48 +0000 Subject: [PATCH] Merged revisions 807761-809626,809628-809708,809710-810236,810238-810302,810304,810306-811064,811066-811205,811207-813546,813549-814372,814374,814376-816024,816026-816313,816315-816322,816324-817070,817072-817087,817089-817101,817103-817567,817569-817603,817605-817709,817711-818287,818289-818311,818313-819076,819078-820073,820075-821035,821037-821124,821126-821345,821347-821370,821372-821378,821380-821648,821650,821652-821835,821837-822268,822270-823852,823854-823882,823884-824217,824219-824277,824279-824285,824287-825075,825077-825083,825085-825805,825807-826354,826356-827490,827492-827612,827614-827891,827893-827903,827905-827944,827946-827949,827951-828972,828974-829033,829035-830099,830101-830132,830134-830442,830444-830477,830479-830875,830877-830932,830934-834241 via svnmerge from https://vkrause@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim ........ r807761 | vkrause | 2008-05-14 19:00:30 +0200 (Wed, 14 May 2008) | 5 lines Don't delete folder configs for folders that might not be in the list here but nevertheless still exist. Kolab issue 2667 ........ r821814 | vkrause | 2008-06-18 17:21:15 +0200 (Wed, 18 Jun 2008) | 5 lines Make sure favorite folder items get the same label independent of how say are created. Kolab issue 2785. ........ r823865 | tilladam | 2008-06-24 14:03:18 +0200 (Tue, 24 Jun 2008) | 7 lines Make it possible again to accept an invitation that was sent to a distribution list the current user is part of, by offering all the identities in addition to the recipients of the invite as choices for the attendee. kolab/issue1998 ........ r824289 | vkrause | 2008-06-25 17:20:44 +0200 (Wed, 25 Jun 2008) | 3 lines Honor local subscription, fixes non-subscribed folders showing up in the folder tree for a short time after changing local subscriptions. ........ r824806 | vkrause | 2008-06-26 18:42:06 +0200 (Thu, 26 Jun 2008) | 6 lines The else block is supposed to belong to the outer if, so we need braces here. This ensures that a failed annotation job is removed correctly from the job map and therefore avoids a crash on exit when KMail tries to cancel the apparently still running job. ........ r830550 | vkrause | 2008-07-10 20:51:09 +0200 (Thu, 10 Jul 2008) | 23 lines Backport SVN commit 829126 by vkrause from enterprise4 branch: Close the folder before we unregister from the message dict. This fixes the .index.db file being newer than the corresponding .index.ids file, causing the latter being detected as outdated on the next startup. In this case message wouldn't have a serial number, which the sqlite backend poorly recovers from, causing apparent mail loss (fixable by rebuilding the folder index). And to make it even more confusing, this only happends for new DIMAP folders that have been synced but not entered yet before shutting down KMail. Kolab issue 2816 Incidentally this also fixes the mysterious non-persistence of certain folder infos worked around in revision 830478. This happend because groupware folders were kept open until destructions. However, writeConfig() was called from the KMFolderMaildir dtor at which point the virtual writeConfig() in KMFolderCachedImap wasn't available anymore. Kolab issue 2666 ........ r834241 | vkrause | 2008-07-18 15:25:03 +0200 (Fri, 18 Jul 2008) | 7 lines Update the highest uid even if we don't find the corresponding message anymore or the folder is empty. This happens for example when the message with this uid was moved away by a filter just before we got here, which then caused mail duplication during the next sync. Kolab issue 2801 ........ svn path=/branches/KDE/3.5/kdepim/; revision=848898 --- callback.cpp | 1 + favoritefolderview.cpp | 7 +++++++ favoritefolderview.h | 1 + kmfolder.cpp | 3 ++- kmfoldercachedimap.cpp | 15 ++++++++------- kmfolderimap.cpp | 4 +++- kmfoldertree.cpp | 15 ++++++++++----- listjob.h | 10 ++-------- 8 files changed, 34 insertions(+), 22 deletions(-) diff --git a/callback.cpp b/callback.cpp index fa055393c..e124e0cc0 100644 --- a/callback.cpp +++ b/callback.cpp @@ -171,6 +171,7 @@ QString Callback::receiver() const "receiver of this message,
please " "choose which of the following addresses " "is yours, if any:"); + addrs += kmkernel->identityManager()->allEmails(); } else { selectMessage = i18n("Several of your identities match the " "receiver of this message,
please " diff --git a/favoritefolderview.cpp b/favoritefolderview.cpp index e06c2f9c9..abe223d8d 100644 --- a/favoritefolderview.cpp +++ b/favoritefolderview.cpp @@ -450,6 +450,13 @@ void FavoriteFolderView::addFolder() addFolder( folder, fti ? prettyName( fti ) : folder->label() ); } +void KMail::FavoriteFolderView::addFolder(KMFolderTreeItem * fti) +{ + if ( !fti || !fti->folder() ) + return; + addFolder( fti->folder(), prettyName( fti ) ); +} + KMFolderTreeItem * FavoriteFolderView::findFolderTreeItem(KMFolder * folder) const { assert( folder ); diff --git a/favoritefolderview.h b/favoritefolderview.h index 7f3c286c6..6958a732a 100644 --- a/favoritefolderview.h +++ b/favoritefolderview.h @@ -55,6 +55,7 @@ class FavoriteFolderView : public FolderTreeBase KMFolderTreeItem* addFolder( KMFolder *folder, const QString &name = QString::null, QListViewItem *after = 0 ); + void addFolder( KMFolderTreeItem *fti ); public slots: void folderTreeSelectionChanged( KMFolder *folder ); diff --git a/kmfolder.cpp b/kmfolder.cpp index 1d4bf2536..71b9cfc89 100644 --- a/kmfolder.cpp +++ b/kmfolder.cpp @@ -127,7 +127,7 @@ KMFolder::KMFolder( KMFolderDir* aParent, const QString& aFolderName, connect( mStorage, SIGNAL( contentsTypeChanged( KMail::FolderContentsType ) ), this, SLOT( slotContentsTypeChanged( KMail::FolderContentsType ) ) ); - + connect( mStorage, SIGNAL( folderSizeChanged() ), this, SLOT( slotFolderSizeChanged() ) ); @@ -148,6 +148,7 @@ KMFolder::KMFolder( KMFolderDir* aParent, const QString& aFolderName, KMFolder::~KMFolder() { + mStorage->close( "~KMFolder", true ); delete mAcctList; if ( mHasIndex ) mStorage->deregisterFromMessageDict(); delete mStorage; diff --git a/kmfoldercachedimap.cpp b/kmfoldercachedimap.cpp index ee89c4f5b..6d1c45758 100644 --- a/kmfoldercachedimap.cpp +++ b/kmfoldercachedimap.cpp @@ -2718,10 +2718,11 @@ KMFolderCachedImap::slotSetAnnotationResult(KIO::Job *job) bool cont = true; if ( job->error() ) { // Don't show error if the server doesn't support ANNOTATEMORE and this folder only contains mail - if ( job->error() == KIO::ERR_UNSUPPORTED_ACTION && contentsType() == ContentsTypeMail ) + if ( job->error() == KIO::ERR_UNSUPPORTED_ACTION && contentsType() == ContentsTypeMail ) { if (mAccount->slave()) mAccount->removeJob(job); - else + } else { cont = mAccount->handleJobError( job, i18n( "Error while setting annotation: " ) + '\n' ); + } } else { if (mAccount->slave()) mAccount->removeJob(job); } @@ -2740,7 +2741,10 @@ void KMFolderCachedImap::slotUpdateLastUid() // highest one as well. If not, our notion of the highest // uid we've seen thus far is wrong, which is dangerous, so // don't update the mLastUid, then. - bool sane = false; + // Not entirely true though, mails might have been moved out + // of the folder already by filters, thus giving us a higher tentative + // uid than we actually observe here. + bool sane = count() == 0; for (int i=0;iUID(); @@ -2750,11 +2754,8 @@ void KMFolderCachedImap::slotUpdateLastUid() kdWarning(5006) << "uid: " << uid << " mTentativeHighestUid: " << mTentativeHighestUid << endl; assert( false ); break; - } else if ( uid == mTentativeHighestUid || lastUid() ) { - // we've found our highest uid, all is well - sane = true; } else { - // must be smaller, that's ok, let's wait for bigger fish + sane = true; } } if (sane) { diff --git a/kmfolderimap.cpp b/kmfolderimap.cpp index ae9f9a6f4..f30e11b67 100644 --- a/kmfolderimap.cpp +++ b/kmfolderimap.cpp @@ -639,8 +639,9 @@ void KMFolderImap::slotListNamespaces() for ( QStringList::Iterator it = personal.begin(); it != personal.end(); ++it ) { KMail::ListJob* job = new KMail::ListJob( account(), type, this, - account()->addPathToNamespace( *it ) ); + account()->addPathToNamespace( *it ) ); job->setNamespace( *it ); + job->setHonorLocalSubscription( true ); connect( job, SIGNAL(receivedFolders(const QStringList&, const QStringList&, const QStringList&, const QStringList&, const ImapAccountBase::jobData&)), this, SLOT(slotListResult(const QStringList&, const QStringList&, @@ -654,6 +655,7 @@ void KMFolderImap::slotListNamespaces() for ( QStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) { KMail::ListJob* job = new KMail::ListJob( account(), type, this, account()->addPathToNamespace( *it ) ); + job->setHonorLocalSubscription( true ); connect( job, SIGNAL(receivedFolders(const QStringList&, const QStringList&, const QStringList&, const QStringList&, const ImapAccountBase::jobData&)), this, SLOT(slotCheckNamespace(const QStringList&, const QStringList&, diff --git a/kmfoldertree.cpp b/kmfoldertree.cpp index 2c1f21bf9..afcd8d433 100644 --- a/kmfoldertree.cpp +++ b/kmfoldertree.cpp @@ -1358,9 +1358,13 @@ void KMFolderTree::cleanupConfigFile() { KMFolder* folder = kmkernel->findFolderById( name ); if ( folder ) { - if ( kmkernel->iCalIface().hideResourceFolder( folder ) + if ( kmkernel->iCalIface().hideResourceFolder( folder ) || kmkernel->iCalIface().hideResourceAccountRoot( folder ) ) - continue; // hidden IMAP resource folder, don't delete info + continue; // hidden IMAP resource folder, don't delete info + if ( folder->noContent() ) + continue; // we hide nocontent folders if they have no child folders + if ( folder == kmkernel->inboxFolder() ) + continue; // local inbox can be hidden as well } //KMessageBox::error( 0, "cleanupConfigFile: Deleting group " + *grpIt ); @@ -2101,11 +2105,12 @@ void KMFolderTree::updateCopyActions() void KMFolderTree::slotAddToFavorites() { - QValueList > folders = selectedFolders(); KMail::FavoriteFolderView *favView = mMainWidget->favoriteFolderView(); assert( favView ); - for ( QValueList >::ConstIterator it = folders.constBegin(); it != folders.constEnd(); ++it ) - favView->addFolder( *it ); + for ( QListViewItemIterator it( this ); it.current(); ++it ) { + if ( it.current()->isSelected() ) + favView->addFolder( static_cast( it.current() ) ); + } } void KMFolderTree::slotUnhideLocalInbox() diff --git a/listjob.h b/listjob.h index 4fb910b7d..75213f5ce 100644 --- a/listjob.h +++ b/listjob.h @@ -77,7 +77,7 @@ public: * side subscription managed by the ctor parameter. */ void setHonorLocalSubscription( bool value ); - + /** * Return whether the listing includes only folders that the * account is subscribed to locally. This is different from the server @@ -97,18 +97,12 @@ public: void setComplete( bool complete ) { mComplete = complete; } /** Set parent progress item */ - void setParentProgressItem( KPIM::ProgressItem* it ) { + void setParentProgressItem( KPIM::ProgressItem* it ) { mParentProgressItem = it; } /** Set the namespace for this listing */ void setNamespace( const QString& ns ) { mNamespace = ns; } -protected: - /** - * Does the actual KIO::listDir - */ - void doListing( const KURL& url, const ImapAccountBase::jobData& jd ); - protected slots: /** * Is called when the listing is done