[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeaddons/konq-plugins/searchbar
From: Laurent Montel <montel () kde ! org>
Date: 2007-07-14 19:08:24
Message-ID: 1184440104.225544.1679.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 687917 by mlaurent:
K3Process-- (fix compile under windows)
M +15 -10 searchbar.cpp
M +3 -2 searchbar.h
--- trunk/KDE/kdeaddons/konq-plugins/searchbar/searchbar.cpp #687916:687917
@@ -31,7 +31,6 @@
#include <kiconloader.h>
#include <klocale.h>
#include <kmimetype.h>
-#include <k3process.h>
#include <kprotocolmanager.h>
#include <kstandarddirs.h>
#include <kurifilter.h>
@@ -60,7 +59,8 @@
KParts::Plugin(parent),
m_searchCombo(0),
m_searchMode(UseSearchProvider),
- m_urlEnterLock(false)
+ m_urlEnterLock(false),
+ m_process(0)
{
m_searchCombo = new SearchBarCombo(0L, "search combo");
m_searchCombo->setDuplicatesEnabled(false);
@@ -111,6 +111,8 @@
delete m_searchCombo;
m_searchCombo = 0L;
+ delete m_process;
+ m_process=0L;
}
QChar delimiter()
@@ -381,29 +383,32 @@
void SearchBarPlugin::selectSearchEngines()
{
- K3Process *process = new K3Process;
+ m_process = new KProcess;
- *process << "kcmshell" << "ebrowsing";
+ *m_process << "kcmshell" << "ebrowsing";
- connect(process, SIGNAL(processExited(K3Process *)), \
SLOT(searchEnginesSelected(K3Process *))); + connect(m_process, SIGNAL(finished ( \
int, QProcess::ExitStatus)), SLOT(searchEnginesSelected(int, QProcess::ExitStatus))); \
- if(!process->start())
+ m_process->start();
+ if(!m_process->waitForStarted())
{
kDebug(1202) << "Couldn't invoke kcmshell." << endl;
- delete process;
+ delete m_process;
+ m_process = 0L;
}
}
-void SearchBarPlugin::searchEnginesSelected(K3Process *process)
+void SearchBarPlugin::searchEnginesSelected(int exitCode, QProcess::ExitStatus \
exitStatus) {
- if(!process || process->exitStatus() == 0)
+ if(exitStatus == QProcess::NormalExit)
{
KConfigGroup config(KGlobal::config(), "SearchBar");
config.writeEntry("CurrentEngine", m_currentEngine);
config.sync();
configurationChanged();
}
- delete process;
+ delete m_process;
+ m_process=0L;
}
void SearchBarPlugin::configurationChanged()
--- trunk/KDE/kdeaddons/konq-plugins/searchbar/searchbar.h #687916:687917
@@ -28,12 +28,12 @@
#include <qpointer.h>
#include <qpixmap.h>
#include <qstring.h>
+#include <KProcess>
//Added by qt3to4:
#include <QMouseEvent>
#include <Q3PopupMenu>
class KHTMLPart;
-class K3Process;
class Q3PopupMenu;
/**
* Combo box which catches mouse clicks on the pixmap.
@@ -137,7 +137,7 @@
void useFindInThisPage();
void useSearchProvider(int);
void selectSearchEngines();
- void searchEnginesSelected(K3Process *process);
+ void searchEnginesSelected(int, QProcess::ExitStatus);
void configurationChanged();
/**
@@ -165,6 +165,7 @@
bool m_urlEnterLock;
QString m_currentEngine;
QStringList m_searchEngines;
+ KProcess *m_process;
};
#endif // SEARCHBAR_PLUGIN
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic