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