Port foldershortcutcommand to entity::id

svn path=/branches/work/akonadi-ports/kdepim/; revision=1037517
wilder-work
Laurent Montel 17 years ago
parent 6a0939c85d
commit 03b3ddef55
  1. 2
      TODO-before-release
  2. 24
      kmmainwidget.cpp
  3. 7
      kmmainwidget.h

@ -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

@ -543,7 +543,6 @@ void KMMainWidget::writeFolderConfig()
KSharedConfig::Ptr config = KMKernel::config();
KConfigGroup group( config, "Folder-" + QString::number( mCurrentFolder.id() ) );
kDebug()<<" mCurrentFolder.id() :"<<mCurrentFolder.id();
group.writeEntry( "htmlMailOverride", mFolderHtmlPref );
group.writeEntry( "htmlLoadExternalOverride", mFolderHtmlLoadExtPref );
}
@ -4618,6 +4617,7 @@ void KMMainWidget::clearFilterActions()
//-----------------------------------------------------------------------------
void KMMainWidget::initializeFolderShortcutActions()
{
#if 0
QList< QPointer< KMFolder > > 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<QAction*> 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() );

@ -41,6 +41,7 @@
#include <akonadi/favoritecollectionsview.h>
#include <akonadi/entitytreemodel.h>
#include <akonadi/standardactionmanager.h>
#include <akonadi/entity.h>
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<QAction*> mFilterMenuActions;
QList<QAction*> mFilterTBarActions;
QList<KMMetaFilterActionCommand*> mFilterCommands;
QHash<QString,FolderShortcutCommand*> mFolderShortcutCommands;
QHash<Akonadi::Entity::Id,FolderShortcutCommand*> mFolderShortcutCommands;
QPointer<KMail::FolderJob> mJob;
QList<MessageTagPtrPair> mMessageTagMenuActions;

Loading…
Cancel
Save