summaryrefslogtreecommitdiff
path: root/src/webtab/searchenginebar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-11-29 17:53:30 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-11-29 17:53:30 +0100
commit3189ee42cde114d54cdccd802d8a3be9006c5e99 (patch)
tree28443332ed010d9fcb15f9073e340069799b9b3c /src/webtab/searchenginebar.cpp
parentChanging tab width management behaviour (diff)
downloadrekonq-3189ee42cde114d54cdccd802d8a3be9006c5e99.tar.xz
Fix search engine settings loading on first startup
Diffstat (limited to 'src/webtab/searchenginebar.cpp')
-rw-r--r--src/webtab/searchenginebar.cpp37
1 files changed, 24 insertions, 13 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();
+}