From 6f4fd5e5632b2288a483430c625081a51342fdab Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 6 Aug 2013 09:35:49 -0500 Subject: Allow TDEApplication objects to be constructed without a session manager This relates to Bug 760 --- tdecore/tdeapplication.cpp | 35 +++++++++++++++++++++++++++++++++++ tdecore/tdeapplication.h | 12 ++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/tdecore/tdeapplication.cpp b/tdecore/tdeapplication.cpp index 58b010e4e..857c157e8 100644 --- a/tdecore/tdeapplication.cpp +++ b/tdecore/tdeapplication.cpp @@ -35,7 +35,14 @@ #undef QT_NO_TRANSLATION #undef TQT_NO_TRANSLATION #include + +// FIXME +// FOR BINARY COMPATIBILITY ONLY +// REMOVE WHEN PRACTICAL! +#define TDEAPPLICATION_BINARY_COMPAT_HACK 1 #include "tdeapplication.h" +#undef TDEAPPLICATION_BINARY_COMPAT_HACK + #define QT_NO_TRANSLATION #define TQT_NO_TRANSLATION #include @@ -621,6 +628,34 @@ static SmcConn tmpSmcConnection = 0; #endif static TQTime* smModificationTime = 0; +TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName, + bool allowStyles, bool GUIenabled, bool SMenabled ) : + TQApplication( argc, argv, GUIenabled, SMenabled ), TDEInstance(rAppName), +#ifdef Q_WS_X11 + display(0L), + argb_visual(false), +#endif + d (new TDEApplicationPrivate()) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + if (!GUIenabled) + allowStyles = false; + useStyles = allowStyles; + Q_ASSERT (!rAppName.isEmpty()); + setName(rAppName); + + installSigpipeHandler(); + TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); + parseCommandLine( ); + init(GUIenabled); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +// FIXME +// FOR BINARY COMPATIBILITY ONLY +// REMOVE WHEN PRACTICAL! TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName, bool allowStyles, bool GUIenabled ) : TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName), diff --git a/tdecore/tdeapplication.h b/tdecore/tdeapplication.h index 5ab8d7ee7..f58bfe0c7 100644 --- a/tdecore/tdeapplication.h +++ b/tdecore/tdeapplication.h @@ -257,8 +257,16 @@ public: */ // REMOVE FOR KDE 4.0 - using it only gives crashing applications because // TDECmdLineArgs::init isn't called - TDEApplication(int& argc, char** argv, - const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true) KDE_DEPRECATED; + TDEApplication(int& argc, char** argv, + const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true, bool SMenabled=true) KDE_DEPRECATED; + +#ifdef TDEAPPLICATION_BINARY_COMPAT_HACK + // FIXME + // FOR BINARY COMPATIBILITY ONLY + // REMOVE WHEN PRACTICAL! + TDEApplication(int& argc, char** argv, + const TQCString& rAppName, bool allowStyles, bool GUIenabled) KDE_DEPRECATED; +#endif // TDEAPPLICATION_BINARY_COMPAT_HACK /** * Add Qt and KDE command line options to TDECmdLineArgs. -- cgit v1.2.1