diff --git a/foldertreeview.cpp b/foldertreeview.cpp index 6732b4e1d..e5252ad01 100644 --- a/foldertreeview.cpp +++ b/foldertreeview.cpp @@ -20,7 +20,7 @@ #include #include #include - +#include FolderTreeView::FolderTreeView(QWidget *parent ) : Akonadi::EntityTreeView( parent ) { @@ -107,4 +107,14 @@ void FolderTreeView::selectPrevUnreadFolder() } } +Akonadi::Collection FolderTreeView::currentFolder() +{ + QModelIndex current = currentIndex(); + if ( current.isValid() ) { + Akonadi::Collection collection = current.model()->data( current, Akonadi::EntityTreeModel::CollectionRole ).value(); + return collection; + } + return Akonadi::Collection(); +} + #include "foldertreeview.moc" diff --git a/foldertreeview.h b/foldertreeview.h index ed65a74dc..5d47561be 100644 --- a/foldertreeview.h +++ b/foldertreeview.h @@ -20,7 +20,7 @@ #define FOLDERTREEVIEW_H #include - +#include class FolderTreeView : public Akonadi::EntityTreeView { Q_OBJECT @@ -33,6 +33,9 @@ public: void selectNextUnreadFolder(); void selectPrevUnreadFolder(); + + + Akonadi::Collection currentFolder(); protected: void init(); void selectModelIndex( const QModelIndex & ); diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 6947edfda..3316ba7e6 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -739,15 +739,6 @@ void KMMainWidget::createWidgets() connect( mMessagePane, SIGNAL(statusMessage(QString)), BroadcastStatus::instance(), SLOT(setStatusMsg(QString)) ); -#ifdef OLD_MESSAGELIST - mMessageListView = new KMail::MessageListView::Pane( this, this, actionCollection() ); - mMessageListView->setObjectName( "messagelistview" ); - - connect( mMessageListView, SIGNAL( currentFolderChanged( KMFolder * ) ), - SLOT( slotMessageListViewCurrentFolderChanged( KMFolder * ) ) ); - connect( mMessageListView, SIGNAL( messageStatusChangeRequest( KMMsgBase *, const KPIM::MessageStatus &, const KPIM::MessageStatus & ) ), - SLOT( slotMessageStatusChangeRequest( KMMsgBase *, const KPIM::MessageStatus &, const KPIM::MessageStatus & ) ) ); -#endif { KAction *action = new KAction( i18n("Set Focus to Quick Search"), this ); action->setShortcut( QKeySequence( Qt::ALT + Qt::Key_Q ) ); @@ -3345,7 +3336,6 @@ void KMMainWidget::slotMessageActivated( const Akonadi::Item &msg ) if ( !msg.isValid() ) return; #if 0//Laurent port it - if ( !msg ) return; if (msg->parent() && !msg->isComplete()) { FolderJob *job = msg->parent()->createJob(msg); @@ -4446,10 +4436,6 @@ void KMMainWidget::updateFolderMenu() bool cachedImap = mFolder && mFolder->folderType() == KMFolderTypeCachedImap; // For dimap, check that the imap path is known before allowing "check mail in this folder". bool knownImapPath = cachedImap && !static_cast( mFolder->storage() )->imapPath().isEmpty(); -#if 0 //We use akonadi - mRefreshFolderAction->setEnabled( folderWithContent && ( imap - || ( cachedImap && knownImapPath ) ) && !multiFolder ); -#endif if ( mTroubleshootFolderAction ) mTroubleshootFolderAction->setEnabled( folderWithContent && ( cachedImap && knownImapPath ) && !multiFolder ); mTroubleshootMaildirAction->setVisible( mFolder && mFolder->folderType() == KMFolderTypeMaildir ); @@ -4470,9 +4456,6 @@ void KMMainWidget::updateFolderMenu() #endif mPreferHtmlAction->setChecked( mHtmlPref ? !mFolderHtmlPref : mFolderHtmlPref ); mPreferHtmlLoadExtAction->setChecked( mHtmlLoadExtPref ? !mFolderHtmlLoadExtPref : mFolderHtmlLoadExtPref ); -#ifdef OLD_FOLDERVIEW - mNewFolderAction->setEnabled( !multiFolder && ( mFolder && mFolder->folderType() != KMFolderTypeSearch )); -#endif mRemoveDuplicatesAction->setEnabled( !multiFolder && mFolder && mFolder->canDeleteMessages() ); mFolderShortCutCommandAction->setEnabled( !multiFolder ); }