Tell everything using the storage location as an identifier for the folder

when it changes, so data structures can be updated. Fixes vanishing special
icons as a side effect.

svn path=/branches/proko2/kdepim/; revision=384949
wilder-work
Till Adam 21 years ago
parent 1949984301
commit a1b41733b4
  1. 1
      folderstorage.cpp
  2. 5
      folderstorage.h
  3. 18
      kmailicalifaceimpl.cpp
  4. 1
      kmailicalifaceimpl.h

@ -675,6 +675,7 @@ int FolderStorage::rename(const QString& newName, KMFolderDir *newParent)
// delete the old entry as we get two entries with the same ID otherwise
KMKernel::config()->deleteGroup( oldConfigString );
emit locationChanged( oldLoc, newLoc );
emit nameChanged();
return rc;
}

@ -427,6 +427,11 @@ signals:
/** Emitted when the name of the folder changes. */
void nameChanged();
/** Emitted when the location on disk of the folder changes. This
* is used by all code which uses the locatio on disk of the folder storage
* ( or the cache storage ) as an identifier for the folder. */
void locationChanged( const QString &, const QString & );
/** Emitted when the readonly status of the folder changes. */
void readOnlyChanged(KMFolder*);

@ -1455,6 +1455,19 @@ void KMailICalIfaceImpl::slotFolderRenamed()
slotFolderPropertiesChanged( const_cast<KMFolder*>( folder ) );
}
void KMailICalIfaceImpl::slotFolderLocationChanged( const QString &oldLocation,
const QString &newLocation )
{
ExtraFolder* ef = mExtraFolders.find( oldLocation );
if ( ef ) {
// reuse the ExtraFolder entry, but adjust the key
mExtraFolders.setAutoDelete( false );
mExtraFolders.remove( oldLocation );
mExtraFolders.setAutoDelete( true );
mExtraFolders.insert( newLocation, ef );
}
}
KMFolder* KMailICalIfaceImpl::findResourceFolder( const QString& resource )
{
// Try the standard folders
@ -1752,6 +1765,8 @@ void KMailICalIfaceImpl::connectFolder( KMFolder* folder )
this, SLOT( slotFolderPropertiesChanged( KMFolder* ) ) );
disconnect( folder, SIGNAL( nameChanged() ),
this, SLOT( slotFolderRenamed() ) );
disconnect( folder->storage(), SIGNAL( locationChanged( const QString&, const QString&) ),
this, SLOT( slotFolderLocationChanged( const QString&, const QString&) ) );
// Setup the signals to listen for changes
connect( folder, SIGNAL( msgAdded( KMFolder*, Q_UINT32 ) ),
@ -1764,6 +1779,9 @@ void KMailICalIfaceImpl::connectFolder( KMFolder* folder )
this, SLOT( slotFolderPropertiesChanged( KMFolder* ) ) );
connect( folder, SIGNAL( nameChanged() ),
this, SLOT( slotFolderRenamed() ) );
connect( folder->storage(), SIGNAL( locationChanged( const QString&, const QString&) ),
this, SLOT( slotFolderLocationChanged( const QString&, const QString&) ) );
}
static void cleanupFolder( KMFolder* folder, KMailICalIfaceImpl* _this )

@ -205,6 +205,7 @@ public slots:
private slots:
void slotRefreshFolder( KMFolder* );
void slotCheckDone();
void slotFolderLocationChanged( const QString&, const QString& );
void slotFolderRenamed();
private:

Loading…
Cancel
Save