mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdeui: implement KCrash::NoRestart flag
for programs that cannot be restarted by simply exec-ing them such as the KIO slaves which require application socket as argument note that restarting is maybe works thing - programs started by kdesudo cannot be restarted (properly) as they are exec-ed by other program that does the setup for them to function the way they should Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
936cc87544
commit
6c98720e24
3 changed files with 8 additions and 2 deletions
|
@ -138,6 +138,10 @@ void KCrash::defaultCrashHandler(int sig)
|
|||
systemargs.append(QByteArray::number(QCoreApplication::applicationPid()));
|
||||
systemargs.append("\"");
|
||||
|
||||
if (s_flags & KCrash::NoRestart) {
|
||||
systemargs.append(" --restarted");
|
||||
}
|
||||
|
||||
const KComponentData kcomponentdata = KGlobal::mainComponent();
|
||||
const KAboutData *kaboutdata = kcomponentdata.isValid() ? kcomponentdata.aboutData() : nullptr;
|
||||
if (kaboutdata) {
|
||||
|
|
|
@ -84,10 +84,12 @@ namespace KCrash
|
|||
|
||||
/**
|
||||
* Options to determine how the default crash handler should behave.
|
||||
* @note AutoRestart takes priority over the other options even if they are set
|
||||
*/
|
||||
enum CrashFlag {
|
||||
AutoRestart = 1, ///< autorestart this application. Only sensible for KUniqueApplications. @since 4.1.
|
||||
DrKonqi = 2 ///< launchers DrKonqi. @since 4.23.
|
||||
DrKonqi = 2, ///< launchers DrKonqi. @since 4.23.
|
||||
NoRestart = 4 ///< tell DrKonqi not to restart the program. @since 4.23.
|
||||
};
|
||||
Q_DECLARE_FLAGS(CrashFlags, CrashFlag)
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ SlaveBase::SlaveBase( const QByteArray &protocol,
|
|||
{
|
||||
if (qgetenv("KDE_DEBUG").isEmpty())
|
||||
{
|
||||
KCrash::setFlags(KCrash::flags() | KCrash::DrKonqi);
|
||||
KCrash::setFlags(KCrash::flags() | KCrash::DrKonqi | KCrash::NoRestart);
|
||||
}
|
||||
|
||||
struct sigaction act;
|
||||
|
|
Loading…
Add table
Reference in a new issue