mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kded: parent the Kded object to the application instance
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d9281db1f8
commit
f0451272ec
2 changed files with 7 additions and 10 deletions
|
@ -100,8 +100,9 @@ static void runDontChangeHostname(const QByteArray &oldName, const QByteArray &n
|
||||||
QProcess::execute("kdontchangethehostname", args);
|
QProcess::execute("kdontchangethehostname", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
Kded::Kded()
|
Kded::Kded(QObject *parent)
|
||||||
: m_pDirWatch(nullptr),
|
: QObject(parent),
|
||||||
|
m_pDirWatch(nullptr),
|
||||||
m_pTimer(nullptr),
|
m_pTimer(nullptr),
|
||||||
m_recreateBusy(false),
|
m_recreateBusy(false),
|
||||||
m_serviceWatcher(nullptr),
|
m_serviceWatcher(nullptr),
|
||||||
|
@ -686,8 +687,8 @@ int main(int argc, char *argv[])
|
||||||
checkStamps = cg.readEntry("CheckFileStamps", true);
|
checkStamps = cg.readEntry("CheckFileStamps", true);
|
||||||
delayedCheck = cg.readEntry("DelayedCheck", false);
|
delayedCheck = cg.readEntry("DelayedCheck", false);
|
||||||
|
|
||||||
Kded *kded = new Kded();
|
Kded kded(&app);
|
||||||
kded->recreate(true); // Build initial database
|
kded.recreate(true); // Build initial database
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
XEvent e;
|
XEvent e;
|
||||||
|
@ -704,11 +705,7 @@ int main(int argc, char *argv[])
|
||||||
(void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes
|
(void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = app.exec(); // keep running
|
return app.exec(); // keep running
|
||||||
|
|
||||||
delete kded;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_kded.cpp"
|
#include "moc_kded.cpp"
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Kded : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Kded();
|
Kded(QObject *parent);
|
||||||
virtual ~Kded();
|
virtual ~Kded();
|
||||||
|
|
||||||
static Kded *self() { return _self;}
|
static Kded *self() { return _self;}
|
||||||
|
|
Loading…
Add table
Reference in a new issue