mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdeui: disable auto-restart when the application is about to quit
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
717fd59dc8
commit
32dbecf2c6
2 changed files with 14 additions and 5 deletions
|
@ -150,7 +150,8 @@ public:
|
|||
|
||||
void _k_x11FilterDestroyed();
|
||||
void _k_checkAppStartedSlot();
|
||||
void _k_slot_KToolInvocation_hook(QStringList&, QByteArray&);
|
||||
void _k_KToolInvocation_hook(QStringList&, QByteArray&);
|
||||
void _k_disableAutorestartSlot();
|
||||
|
||||
QString sessionConfigName() const;
|
||||
void init();
|
||||
|
@ -455,9 +456,11 @@ void KApplicationPrivate::init()
|
|||
KCheckAccelerators::initiateIfNeeded(q);
|
||||
|
||||
q->connect(KToolInvocation::self(), SIGNAL(kapplication_hook(QStringList&,QByteArray&)),
|
||||
q, SLOT(_k_slot_KToolInvocation_hook(QStringList&,QByteArray&)));
|
||||
q, SLOT(_k_KToolInvocation_hook(QStringList&,QByteArray&)));
|
||||
}
|
||||
|
||||
// too late to restart if the application is about to quit (e.g. if QApplication::quit() was
|
||||
// called or SIGTERM was received)
|
||||
q->connect(q, SIGNAL(aboutToQuit()), SLOT(_k_disableAutorestartSlot()));
|
||||
|
||||
qRegisterMetaType<KUrl>();
|
||||
qRegisterMetaType<KUrl::List>();
|
||||
|
@ -880,7 +883,7 @@ void KApplicationPrivate::read_app_startup_id()
|
|||
}
|
||||
|
||||
// Hook called by KToolInvocation
|
||||
void KApplicationPrivate::_k_slot_KToolInvocation_hook(QStringList& envs,QByteArray& startup_id)
|
||||
void KApplicationPrivate::_k_KToolInvocation_hook(QStringList& envs,QByteArray& startup_id)
|
||||
{
|
||||
#ifdef Q_WS_X11
|
||||
if (QX11Info::display()) {
|
||||
|
@ -900,6 +903,11 @@ void KApplicationPrivate::_k_slot_KToolInvocation_hook(QStringList& envs,QByteAr
|
|||
#endif
|
||||
}
|
||||
|
||||
void KApplicationPrivate::_k_disableAutorestartSlot()
|
||||
{
|
||||
KCrash::setFlags(KCrash::flags() & ~KCrash::AutoRestart);
|
||||
}
|
||||
|
||||
void KApplication::setSynchronizeClipboard(bool synchronize)
|
||||
{
|
||||
KClipboardSynchronizer::self()->setSynchronizing(synchronize);
|
||||
|
|
|
@ -336,7 +336,8 @@ private:
|
|||
|
||||
Q_PRIVATE_SLOT(d, void _k_x11FilterDestroyed())
|
||||
Q_PRIVATE_SLOT(d, void _k_checkAppStartedSlot())
|
||||
Q_PRIVATE_SLOT(d, void _k_slot_KToolInvocation_hook(QStringList&, QByteArray&))
|
||||
Q_PRIVATE_SLOT(d, void _k_KToolInvocation_hook(QStringList&, QByteArray&))
|
||||
Q_PRIVATE_SLOT(d, void _k_disableAutorestartSlot())
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue