|
Lines 41-46
Link Here
|
| 41 |
{ "start <name>", I18N_NOOP("Start Kate with a given session"), 0 }, |
41 |
{ "start <name>", I18N_NOOP("Start Kate with a given session"), 0 }, |
| 42 |
{ "u", 0, 0 }, |
42 |
{ "u", 0, 0 }, |
| 43 |
{ "use", I18N_NOOP("Use a already running kate instance (if possible)"), 0 }, |
43 |
{ "use", I18N_NOOP("Use a already running kate instance (if possible)"), 0 }, |
|
|
44 |
{ "f", 0, 0 }, |
| 45 |
{ "force-sdi", I18N_NOOP("Force single document mode if the MDI setting is enabled."), 0 }, |
| 44 |
{ "p", 0, 0 }, |
46 |
{ "p", 0, 0 }, |
| 45 |
{ "pid <pid>", I18N_NOOP("Only try to reuse kate instance with this pid"), 0 }, |
47 |
{ "pid <pid>", I18N_NOOP("Only try to reuse kate instance with this pid"), 0 }, |
| 46 |
{ "e", 0, 0 }, |
48 |
{ "e", 0, 0 }, |
|
Lines 57-65
Link Here
|
| 57 |
|
59 |
|
| 58 |
extern "C" KDE_EXPORT int kdemain( int argc, char **argv ) |
60 |
extern "C" KDE_EXPORT int kdemain( int argc, char **argv ) |
| 59 |
{ |
61 |
{ |
|
|
62 |
KConfig * config = NULL; |
| 63 |
bool alwaysUseInstance; |
| 60 |
// here we go, construct the Kate version |
64 |
// here we go, construct the Kate version |
| 61 |
TQString kateVersion = KateApp::kateVersion(); |
65 |
TQString kateVersion = KateApp::kateVersion(); |
| 62 |
|
66 |
|
|
|
67 |
KInstance instance( "kate" ); |
| 68 |
|
| 63 |
KAboutData aboutData ("kate", I18N_NOOP("Kate"), kateVersion.latin1(), |
69 |
KAboutData aboutData ("kate", I18N_NOOP("Kate"), kateVersion.latin1(), |
| 64 |
I18N_NOOP( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2, |
70 |
I18N_NOOP( "Kate - Advanced Text Editor" ), KAboutData::License_LGPL_V2, |
| 65 |
I18N_NOOP( "(c) 2000-2005 The Kate Authors" ), 0, "http://kate.kde.org"); |
71 |
I18N_NOOP( "(c) 2000-2005 The Kate Authors" ), 0, "http://kate.kde.org"); |
|
Lines 107-114
Link Here
|
| 107 |
// get our command line args ;) |
113 |
// get our command line args ;) |
| 108 |
KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); |
114 |
KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); |
| 109 |
|
115 |
|
| 110 |
// now, first try to contact running kate instance if needed |
116 |
config = KGlobal::config(); |
| 111 |
if ( args->isSet("use") || (::getenv("KATE_PID")!=0) ) |
117 |
config->setGroup("General"); |
|
|
118 |
alwaysUseInstance = config->readBoolEntry("UseInstance"); |
| 119 |
|
| 120 |
// now, first try to contact running kate instance if needed |
| 121 |
if ( ((args->isSet("use") || alwaysUseInstance) && |
| 122 |
!(args->isSet("force-sdi"))) || (::getenv("KATE_PID")!=0) ) |
| 112 |
{ |
123 |
{ |
| 113 |
DCOPClient client; |
124 |
DCOPClient client; |
| 114 |
client.attach (); |
125 |
client.attach (); |