diff --git a/CMakeLists.txt b/CMakeLists.txt index fa1f904..2e41499 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) -set(PIM_VERSION "5.18.40") +set(PIM_VERSION "5.18.41") project(mailcommon VERSION ${PIM_VERSION}) diff --git a/src/folder/foldertreewidget.cpp b/src/folder/foldertreewidget.cpp index dc79921..c25dac3 100644 --- a/src/folder/foldertreewidget.cpp +++ b/src/folder/foldertreewidget.cpp @@ -162,12 +162,14 @@ void FolderTreeWidget::disableContextMenuAndExtraColumn() d->folderTreeView->disableContextMenuAndExtraColumn(); } -void FolderTreeWidget::selectCollectionFolder(const Akonadi::Collection &collection) +void FolderTreeWidget::selectCollectionFolder(const Akonadi::Collection &collection, bool expand) { const QModelIndex index = Akonadi::EntityTreeModel::modelIndexForCollection(d->folderTreeView->model(), collection); d->folderTreeView->setCurrentIndex(index); - d->folderTreeView->setExpanded(index, true); + if (expand) { + d->folderTreeView->setExpanded(index, true); + } d->folderTreeView->scrollTo(index); } diff --git a/src/folder/foldertreewidget.h b/src/folder/foldertreewidget.h index 8a79d12..bfc75d2 100644 --- a/src/folder/foldertreewidget.h +++ b/src/folder/foldertreewidget.h @@ -76,7 +76,7 @@ public: SortByDragAndDropKey ///< Columns are NOT clickable, sorting is done by drag and drop }; - void selectCollectionFolder(const Akonadi::Collection &col); + void selectCollectionFolder(const Akonadi::Collection &col, bool expand = true); void setSelectionMode(QAbstractItemView::SelectionMode mode);