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);
|
||||
}
|
||||
|
||||
Kded::Kded()
|
||||
: m_pDirWatch(nullptr),
|
||||
Kded::Kded(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_pDirWatch(nullptr),
|
||||
m_pTimer(nullptr),
|
||||
m_recreateBusy(false),
|
||||
m_serviceWatcher(nullptr),
|
||||
|
@ -686,8 +687,8 @@ int main(int argc, char *argv[])
|
|||
checkStamps = cg.readEntry("CheckFileStamps", true);
|
||||
delayedCheck = cg.readEntry("DelayedCheck", false);
|
||||
|
||||
Kded *kded = new Kded();
|
||||
kded->recreate(true); // Build initial database
|
||||
Kded kded(&app);
|
||||
kded.recreate(true); // Build initial database
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
XEvent e;
|
||||
|
@ -704,11 +705,7 @@ int main(int argc, char *argv[])
|
|||
(void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes
|
||||
}
|
||||
|
||||
int result = app.exec(); // keep running
|
||||
|
||||
delete kded;
|
||||
|
||||
return result;
|
||||
return app.exec(); // keep running
|
||||
}
|
||||
|
||||
#include "moc_kded.cpp"
|
||||
|
|
|
@ -42,7 +42,7 @@ class Kded : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Kded();
|
||||
Kded(QObject *parent);
|
||||
virtual ~Kded();
|
||||
|
||||
static Kded *self() { return _self;}
|
||||
|
|
Loading…
Add table
Reference in a new issue