Allow to not expand treewidget

wilder-portage
Laurent Montel 4 years ago
parent 08b00d2a6e
commit a37cf79cc0
  1. 2
      CMakeLists.txt
  2. 6
      src/folder/foldertreewidget.cpp
  3. 2
      src/folder/foldertreewidget.h

@ -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})

@ -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);

Loading…
Cancel
Save