From f05253b5e0474417234fa808f729f201c4600934 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 8 Aug 2013 14:52:20 -0500 Subject: [PATCH] Allow session manager to be disable on creation when argc and argv are not passed to TDEApplication This relates to Bug 760 (cherry picked from commit 7cc3a975d2b1ac2d9efa6abef037533fc8bfec7c) --- kdecore/kapplication.cpp | 27 +++++++++++++++++++++++++++ kdecore/kapplication.h | 7 +++++++ 2 files changed, 34 insertions(+) diff --git a/kdecore/kapplication.cpp b/kdecore/kapplication.cpp index b5aa8bc80..1ca402e4a 100644 --- a/kdecore/kapplication.cpp +++ b/kdecore/kapplication.cpp @@ -679,6 +679,33 @@ KApplication::KApplication( int& argc, char** argv, const TQCString& rAppName, d->m_KAppDCOPInterface = new KAppDCOPInterface(this); } +KApplication::KApplication( bool allowStyles, bool GUIenabled, bool SMenabled ) : +// TQApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(), TRUE ), // Qt4 requires that there always be a GUI + TQApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(), GUIenabled, SMenabled ), // We need to be able to run command line apps + KInstance( KCmdLineArgs::about), +#ifdef Q_WS_X11 + display(0L), + argb_visual(false), +#endif + d (new KApplicationPrivate) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + if (!GUIenabled) + allowStyles = false; + useStyles = allowStyles; + setName( instanceName() ); + + installSigpipeHandler(); + parseCommandLine( ); + init(GUIenabled); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +// FIXME +// FOR BINARY COMPATIBILITY ONLY +// REMOVE WHEN PRACTICAL! KApplication::KApplication( bool allowStyles, bool GUIenabled ) : // TQApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(), TRUE ), // Qt4 requires that there always be a GUI TQApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(), GUIenabled ), // We need to be able to run command line apps diff --git a/kdecore/kapplication.h b/kdecore/kapplication.h index 25c527abc..f2e121879 100644 --- a/kdecore/kapplication.h +++ b/kdecore/kapplication.h @@ -128,7 +128,14 @@ public: * @param GUIenabled Set to false to disable all GUI stuff. This implies * no styles either. */ + KApplication( bool allowStyles=true, bool GUIenabled=true, bool SMenabled=true); + +#ifdef TDEAPPLICATION_BINARY_COMPAT_HACK + // FIXME + // FOR BINARY COMPATIBILITY ONLY + // REMOVE WHEN PRACTICAL! KApplication( bool allowStyles=true, bool GUIenabled=true); +#endif // TDEAPPLICATION_BINARY_COMPAT_HACK #ifdef Q_WS_X11 /**