summaryrefslogtreecommitdiffstats
path: root/kate/app/katemain.cpp
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2013-08-17 14:45:11 -0500
committerDarrell Anderson <[email protected]>2013-08-17 14:45:11 -0500
commitf3db9433f8b18683e192c97835d15c26f19b96a0 (patch)
tree6e20c9772d410294f5e68d6a844bebc9c57c0b71 /kate/app/katemain.cpp
parent82958c52cc4e119f0f7dbbd6740a4491d383c9aa (diff)
downloadtdebase-f3db9433f8b18683e192c97835d15c26f19b96a0.tar.gz
tdebase-f3db9433f8b18683e192c97835d15c26f19b96a0.zip
Add the ability to force Kate into MDI mode all the time.
This resolves bug report 1127.
Diffstat (limited to 'kate/app/katemain.cpp')
-rw-r--r--kate/app/katemain.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/kate/app/katemain.cpp b/kate/app/katemain.cpp
index bc46d5402..7b9903d5e 100644
--- a/kate/app/katemain.cpp
+++ b/kate/app/katemain.cpp
@@ -41,6 +41,8 @@ static TDECmdLineOptions options[] =
{ "start <name>", I18N_NOOP("Start Kate with a given session"), 0 },
{ "u", 0, 0 },
{ "use", I18N_NOOP("Use a already running kate instance (if possible)"), 0 },
+ { "f", 0, 0 },
+ { "force-sdi", I18N_NOOP("Force single document mode if the MDI setting is enabled."), 0 },
{ "p", 0, 0 },
{ "pid <pid>", I18N_NOOP("Only try to reuse kate instance with this pid"), 0 },
{ "e", 0, 0 },
@@ -57,6 +59,8 @@ static TDECmdLineOptions options[] =
extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
{
+ TDEConfig * config = NULL;
+ bool alwaysUseInstance;
// here we go, construct the Kate version
TQString kateVersion = KateApp::kateVersion();
@@ -98,6 +102,8 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
aboutData.setTranslator(I18N_NOOP2("NAME OF TRANSLATORS","Your names"), I18N_NOOP2("EMAIL OF TRANSLATORS","Your emails"));
+ TDEInstance instance( &aboutData );
+
// command line args init and co
TDECmdLineArgs::init (argc, argv, &aboutData);
TDECmdLineArgs::addCmdLineOptions (options);
@@ -107,8 +113,13 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
// get our command line args ;)
TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs();
- // now, first try to contact running kate instance if needed
- if ( args->isSet("use") || (::getenv("KATE_PID")!=0) )
+ config = TDEGlobal::config();
+ config->setGroup("General");
+ alwaysUseInstance = config->readBoolEntry("UseInstance");
+
+// now, first try to contact running kate instance if needed
+ if ( ((args->isSet("use") || alwaysUseInstance) &&
+ !(args->isSet("force-sdi"))) || (::getenv("KATE_PID")!=0) )
{
DCOPClient client;
client.attach ();