From fa4e91066468ef52b0374bf11f8ff3bf73e4918f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 22 Jul 2019 09:24:07 +0200 Subject: Fix: location-mode=EXCLUSIVE doesn't work Seems this option was broken now for quite a while. The way it was handled was already messy, now this intrudoces more cruft... Fixes bwlp#1000678 --- src/dialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dialog.cpp b/src/dialog.cpp index 388290d..9716da8 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -216,6 +216,8 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index) } void Dialog::on_treeView_expanded(const QModelIndex& index) { + if (activeTab_ != TAB_ALL_VMS) + return; SessionTreeItem* item = static_cast(index.internalPointer()); if (item->session() == nullptr && item->sectionType() != SECTION_FOR_LOCATION) { @@ -618,6 +620,9 @@ void Dialog::onTabButtonChanged(int tab) { // no valid button return; } + // Block this so it won't trigger the expand signal while refilling, which would + // interfere with LOCATION_EXCLUSIVE mode + ui->treeView->blockSignals(true); // give focus to treeView if (!ui->treeView->hasFocus()) { @@ -638,6 +643,7 @@ void Dialog::onTabButtonChanged(int tab) { setListModel(model_[tab]); this->activeTab_ = tab; + ui->treeView->blockSignals(false); /* get the first element ad select it */ selectFirstElement(); -- cgit v1.2.3-55-g7522