From: Flavio Date: Mon, 7 Jan 2013 16:25:41 +0000 (+0100) Subject: Fix refine-search action staying enabled X-Git-Tag: 2.0~43 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=333f6552d99bfa81ccd3cf0edb892338f59a6a20;p=minitube Fix refine-search action staying enabled --- diff --git a/src/refinesearchwidget.cpp b/src/refinesearchwidget.cpp index 9edad1e..77a46b3 100644 --- a/src/refinesearchwidget.cpp +++ b/src/refinesearchwidget.cpp @@ -5,6 +5,10 @@ #include "extra.h" #endif +namespace The { +QMap* 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);