diff --git a/TODO-before-release b/TODO-before-release index d410ea304..31844ffb2 100644 --- a/TODO-before-release +++ b/TODO-before-release @@ -7,3 +7,5 @@ Migrate some config to akonadi: mNormalIconPath = configGroup.readEntry( "NormalIconPath" ); mUnreadIconPath = configGroup.readEntry( "UnreadIconPath" ); mHideInSelectionDialog = configGroup.readEntry( "HideInSelectionDialog", false ); +We use now Collection::Id(); and not idString(); +Port shortcut diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 7d78ff51a..7919af97d 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -543,7 +543,6 @@ void KMMainWidget::writeFolderConfig() KSharedConfig::Ptr config = KMKernel::config(); KConfigGroup group( config, "Folder-" + QString::number( mCurrentFolder.id() ) ); - kDebug()<<" mCurrentFolder.id() :"< > folders = kmkernel->allFolders(); QList< QPointer< KMFolder > >::Iterator it = folders.begin(); while ( it != folders.end() ) { @@ -4625,6 +4625,9 @@ void KMMainWidget::initializeFolderShortcutActions() ++it; slotShortcutChanged( folder ); // load the initial accel } +#else + kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO; +#endif } //----------------------------------------------------------------------------- @@ -4685,16 +4688,14 @@ void KMMainWidget::initializeFilterActions() updateMessageActions(); } -void KMMainWidget::slotCollectionRemoved( const Akonadi::Collection& ) +void KMMainWidget::slotCollectionRemoved( const Akonadi::Collection& col) { - //TODO - //delete mFolderShortcutCommands.take( folder->idString() ); + delete mFolderShortcutCommands.take( col.id() ); } -void KMMainWidget::slotFolderRemoved( KMFolder *folder ) +void KMMainWidget::slotFolderRemoved( const Akonadi::Collection &col ) { - //TODO remove it - delete mFolderShortcutCommands.take( folder->idString() ); + delete mFolderShortcutCommands.take( col.id() ); } //----------------------------------------------------------------------------- @@ -4741,17 +4742,16 @@ QList KMMainWidget::actionList() return actionCollection()->actions(); } -void KMMainWidget::slotShortcutChanged( KMFolder *folder ) +void KMMainWidget::slotShortcutChanged( const Akonadi::Collection & col ) { // remove the old one, no autodelete in Qt4 - slotFolderRemoved( folder ); - + slotFolderRemoved( col ); +#ifdef OLD_FOLDERVIEW if ( folder->shortcut().isEmpty() ) return; FolderShortcutCommand *c = new FolderShortcutCommand( this, mCurrentFolder ); -#ifdef OLD_COMMAND - mFolderShortcutCommands.insert( folder->idString(), c ); + mFolderShortcutCommands.insert( mCurrentFolder.id(), c ); QString actionlabel = i18n( "Folder Shortcut %1", folder->prettyUrl() ); QString actionname = i18n( "Folder Shortcut %1", folder->idString() ); diff --git a/kmmainwidget.h b/kmmainwidget.h index 43dc0a879..3a1d9fc24 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -41,6 +41,7 @@ #include #include #include +#include namespace MessageList { class Pane; } @@ -253,7 +254,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget void initializeFolderShortcutActions(); /** Add, remove or adjust the folder's shortcut. */ - void slotShortcutChanged( KMFolder *folder ); + void slotShortcutChanged( const Akonadi::Collection & ); /** Clear and create actions for message tag toggling */ void clearMessageTagActions(); @@ -458,7 +459,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget /** Remove the shortcut actions associated with a folder. */ - void slotFolderRemoved( KMFolder *folder ); + void slotFolderRemoved( const Akonadi::Collection& ); void slotCollectionRemoved( const Akonadi::Collection& ); /** @@ -636,7 +637,7 @@ private: QList mFilterMenuActions; QList mFilterTBarActions; QList mFilterCommands; - QHash mFolderShortcutCommands; + QHash mFolderShortcutCommands; QPointer mJob; QList mMessageTagMenuActions;