Commit a37cf79c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to not expand treewidget

parent 08b00d2a
Pipeline #88783 passed with stage
in 30 minutes and 10 seconds
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})
......
......@@ -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);
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment