|
Lines 41-46
static TDECmdLineOptions options[] =
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-62
static TDECmdLineOptions options[] =
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 |
TDEConfig * 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 |
|
|
Lines 98-103
extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
Link Here
|
| 98 |
|
102 |
|
| 99 |
aboutData.setTranslator(I18N_NOOP2("NAME OF TRANSLATORS","Your names"), I18N_NOOP2("EMAIL OF TRANSLATORS","Your emails")); |
103 |
aboutData.setTranslator(I18N_NOOP2("NAME OF TRANSLATORS","Your names"), I18N_NOOP2("EMAIL OF TRANSLATORS","Your emails")); |
| 100 |
|
104 |
|
|
|
105 |
TDEInstance instance( &aboutData ); |
| 106 |
|
| 101 |
// command line args init and co |
107 |
// command line args init and co |
| 102 |
TDECmdLineArgs::init (argc, argv, &aboutData); |
108 |
TDECmdLineArgs::init (argc, argv, &aboutData); |
| 103 |
TDECmdLineArgs::addCmdLineOptions (options); |
109 |
TDECmdLineArgs::addCmdLineOptions (options); |
|
Lines 107-114
extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
Link Here
|
| 107 |
// get our command line args ;) |
113 |
// get our command line args ;) |
| 108 |
TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); |
114 |
TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); |
| 109 |
|
115 |
|
| 110 |
// now, first try to contact running kate instance if needed |
116 |
config = TDEGlobal::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 (); |