Version: 2.0.89 (using Devel) OS: Linux Trying to jump to a different folder using the keyboard shortcuts no longer works. Reproducible: Always Steps to Reproduce: 1. Select a folder 2. Press J 3. Select another folder Actual Results: Nothing happens Expected Results: Should be in another folder. OS: Linux (i686) release 2.6.35.2-server-1mnb Compiler: gcc
More information: *something* happens after I tell kmail to jump. If I was viewing an HTML message and jump to a folder with HTML turned off, the message will redisplay in text only. And the Folder menu options change (for example, I could not select "Prefer HTML to plain text", it was greyed out)
This includes per-folder shortcuts too. Pressing the combination assigned to a folder has a full flicker and redraw of the message list and message view, but it shows the message it was already showing.
More info: I can jump to folders in the first account (in alphabetical order). I cannot jump to folders in any other account.
commit 1a9ac7a1589f2aca8b49b7afabbac41185f4286c branch master Author: Tobias Koenig <tokoe@kde.org> Date: Fri Dec 31 15:34:36 2010 +0100 Replace ETM::match() with ETM::modelIndexForCollection() This fixes the bug that folders of another resource can not be used as target for 'Jump to folder' functionality. BUG: 259080 diff --git a/mailcommon/foldertreewidget.cpp b/mailcommon/foldertreewidget.cpp index a168a4b..94d7532 100644 --- a/mailcommon/foldertreewidget.cpp +++ b/mailcommon/foldertreewidget.cpp @@ -160,22 +160,13 @@ void FolderTreeWidget::disableContextMenuAndExtraColumn() d->folderTreeView->disableContextMenuAndExtraColumn(); } -void FolderTreeWidget::selectCollectionFolder( const Akonadi::Collection & col ) +void FolderTreeWidget::selectCollectionFolder( const Akonadi::Collection &collection ) { + const QModelIndex index = Akonadi::EntityTreeModel::modelIndexForCollection( d->folderTreeView->model(), collection ); - //TODO fix it when we select an col in imap folder. Doesn't work for the moment Don't know why - const QModelIndex idx = d->folderTreeView->model()->index( 0, 0, QModelIndex() ); - const QModelIndexList rows = d->folderTreeView->model()->match( idx, - Akonadi::EntityTreeModel::CollectionIdRole, col.id(), -1, - Qt::MatchRecursive | Qt::MatchExactly ); - if ( rows.size() < 1 ) - return; - const QModelIndex colIndex = rows.first(); - d->folderTreeView->selectionModel()->select(colIndex, - QItemSelectionModel::SelectCurrent - | QItemSelectionModel::Rows); - d->folderTreeView->setExpanded( colIndex, true ); - d->folderTreeView->scrollTo( colIndex ); + d->folderTreeView->selectionModel()->select( index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows ); + d->folderTreeView->setExpanded( index, true ); + d->folderTreeView->scrollTo( index ); } void FolderTreeWidget::setSelectionMode( QAbstractItemView::SelectionMode mode )