From 333f6552d99bfa81ccd3cf0edb892338f59a6a20 Mon Sep 17 00:00:00 2001 From: Flavio Date: Mon, 7 Jan 2013 17:25:41 +0100 Subject: [PATCH] Fix refine-search action staying enabled --- src/refinesearchwidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.39.5