diff options
Diffstat (limited to 'src/ui/widgets/FileTreeView.cpp')
-rw-r--r-- | src/ui/widgets/FileTreeView.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/widgets/FileTreeView.cpp b/src/ui/widgets/FileTreeView.cpp index d50f8726..616cffb4 100644 --- a/src/ui/widgets/FileTreeView.cpp +++ b/src/ui/widgets/FileTreeView.cpp @@ -49,7 +49,7 @@ FileTreeView::FileTreeView(QWidget* parent, const QString& target_path) slot_create_popup_menu(); this->setContextMenuPolicy(Qt::CustomContextMenu); - this->setSelectionMode(QAbstractItemView::MultiSelection); + this->setSelectionMode(QAbstractItemView::SingleSelection); connect(this, &QWidget::customContextMenuRequested, this, &FileTreeView::slot_show_custom_context_menu); @@ -439,4 +439,10 @@ void FileTreeView::slot_adjust_column_widths() { } } +void FileTreeView::SlotSwitchBatchMode(bool batch) { + this->setSelectionMode(batch ? QAbstractItemView::MultiSelection + : QAbstractItemView::SingleSelection); + selectionModel()->clearSelection(); +} + } // namespace GpgFrontend::UI |