summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/webtab/searchenginebar.cpp37
-rw-r--r--src/webtab/searchenginebar.h10
2 files changed, 33 insertions, 14 deletions
diff --git a/src/webtab/searchenginebar.cpp b/src/webtab/searchenginebar.cpp
index e463ba27..9b823782 100644
--- a/src/webtab/searchenginebar.cpp
+++ b/src/webtab/searchenginebar.cpp
@@ -31,20 +31,20 @@
// Auto Includes
#include "rekonq.h"
+// Local Includes
+#include "searchengine.h"
+
// KDE Includes
#include <KIcon>
#include <KIconLoader>
#include <KAction>
#include <KLocalizedString>
-// Qt Includes
-#include <QProcess>
-
SearchEngineBar::SearchEngineBar(QWidget *parent)
: KMessageWidget(parent)
+ , _proc(0)
{
- connect(this, SIGNAL(accepted()), this, SLOT(hideAndDelete()));
connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted()));
connect(this, SIGNAL(rejected()), this, SLOT(hideAndDelete()));
@@ -70,19 +70,15 @@ SearchEngineBar::SearchEngineBar(QWidget *parent)
}
-void SearchEngineBar::hideAndDelete()
-{
- animatedHide();
- deleteLater();
-}
-
-
void SearchEngineBar::slotAccepted()
{
- QProcess *proc = new QProcess(parent());
+ _proc = new QProcess(parent());
QStringList args;
args << QL1S("ebrowsing");
- proc->start(QL1S("kcmshell4"), args);
+ _proc->start(QL1S("kcmshell4"), args);
+ connect(_proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(reloadSearchEngineSettingsAndDelete()));
+
+ animatedHide();
}
@@ -91,3 +87,18 @@ void SearchEngineBar::slotRejected()
// Remember users choice
ReKonfig::setCheckDefaultSearchEngine(false);
}
+
+
+void SearchEngineBar::reloadSearchEngineSettingsAndDelete()
+{
+ SearchEngine::reload();
+
+ deleteLater();
+}
+
+
+void SearchEngineBar::hideAndDelete()
+{
+ animatedHide();
+ deleteLater();
+}
diff --git a/src/webtab/searchenginebar.h b/src/webtab/searchenginebar.h
index 7ee1f90c..034d64f3 100644
--- a/src/webtab/searchenginebar.h
+++ b/src/webtab/searchenginebar.h
@@ -33,6 +33,9 @@
// KDE Includes
#include <KMessageWidget>
+// Qt Includes
+#include <QProcess>
+
class REKONQ_TESTS_EXPORT SearchEngineBar : public KMessageWidget
{
@@ -42,13 +45,18 @@ public:
explicit SearchEngineBar(QWidget *parent);
private Q_SLOTS:
- void hideAndDelete();
void slotAccepted();
void slotRejected();
+ void reloadSearchEngineSettingsAndDelete();
+ void hideAndDelete();
+
Q_SIGNALS:
void accepted();
void rejected();
+
+private:
+ QProcess *_proc;
};