pathbar: fix an issue with a slot recursive call
authorAlexander Golubev <fatzer2@gmail.com>
Sat, 26 Jan 2019 14:48:39 +0000 (17:48 +0300)
committerAlf Gaida <agaida@siduction.org>
Tue, 5 Feb 2019 19:11:09 +0000 (19:11 +0000)
Closes #225

Gbp-Pq: Name pathbar-recursive-call-slot.patch

src/pathbar.cpp

index c498c31c053226357e731dc74a2ece6000cc9caf..c9230f76b87be06871f5fd2f749404157d20024a 100644 (file)
@@ -314,6 +314,9 @@ void PathBar::closeEditor() {
     }
     // If a menu has popped up synchronously (with QMenu::exec), the path buttons may be drawn
     // but the path-edit may not disappear until the menu is closed. So, we hide it here.
+    // However, since hiding the path-edit makes it lose focus and emit editingFinished(),
+    // we should first disconnect from it to avoid recursive calling of the current function.
+    tempPathEdit_->disconnect();
     tempPathEdit_->setVisible(false);
     delete layout()->replaceWidget(tempPathEdit_, scrollArea_, Qt::FindDirectChildrenOnly);
     scrollArea_->show();