]> git.sur5r.net Git - minitube/commitdiff
Fix refine-search action staying enabled
authorFlavio <flavio@odisseo.local>
Mon, 7 Jan 2013 16:25:41 +0000 (17:25 +0100)
committerFlavio <flavio@odisseo.local>
Mon, 7 Jan 2013 16:25:41 +0000 (17:25 +0100)
src/refinesearchwidget.cpp

index 9edad1ee9825203c77266adc8b07c55835ca08ca..77a46b392569ab82c0aa4ddc1eae9d912961f337 100644 (file)
@@ -5,6 +5,10 @@
 #include "extra.h"
 #endif
 
+namespace The {
+QMap<QString, QAction*>* globalActions();
+}
+
 RefineSearchWidget::RefineSearchWidget(QWidget *parent) :
     QWidget(parent) {
     dirty = false;
@@ -204,6 +208,11 @@ void RefineSearchWidget::actionTriggered(QAction *action) {
 void RefineSearchWidget::setSearchParams(SearchParams *params) {
     setup();
 
+    The::globalActions()->value("refine-search")->setEnabled(params);
+    setEnabled(params);
+
+    if (!params) return;
+
     QToolBar* bar;
     QAction* action;
 
@@ -223,6 +232,7 @@ void RefineSearchWidget::setSearchParams(SearchParams *params) {
     action = bar->actions().at(params->quality());
     if (action) action->setChecked(true);
 
+    disconnect(SIGNAL(paramChanged(QString,QVariant)));
     connect(this, SIGNAL(paramChanged(QString,QVariant)),
             params, SLOT(setParam(QString,QVariant)),
             Qt::UniqueConnection);