[Bug 259080] [regression] "Jump to" feature no longer works

Tobias Koenig tokoe at kde.org
Fri Dec 31 14:32:06 GMT 2010


https://bugs.kde.org/show_bug.cgi?id=259080


Tobias Koenig <tokoe at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #4 from Tobias Koenig <tokoe kde org>  2010-12-31 15:32:05 ---
commit 1a9ac7a1589f2aca8b49b7afabbac41185f4286c
branch master
Author: Tobias Koenig <tokoe at 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
)

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kdepim-bugs mailing list