From 80a655516c9f12ade6b6a440b4b587f9309fb8bc Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 1 Aug 2000 22:52:06 +0000 Subject: [PATCH] WABA: * Fixed the "//FIXME: check if we have already have kwrited running." by turning it into a KUniqueApplication. * Added command line support. svn path=/trunk/kdebase/konsole/; revision=59511 --- src/kwrited.C | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/kwrited.C b/src/kwrited.C index c16a3887..aae76da0 100644 --- a/src/kwrited.C +++ b/src/kwrited.C @@ -1,6 +1,8 @@ // [kwrited.C] A write(1) receiver for kde. -#include +#include +#include +#include #include #include #include @@ -68,11 +70,23 @@ void KWrited::block_in(const char* txt, int len) int main(int argc, char* argv[]) { + KCmdLineArgs::init(argc, argv, "kwrited", + I18N_NOOP("KDE Daemon for receiving 'write' messages."), + "2.0.0"); + + KUniqueApplication::addCmdLineOptions(); + + if (!KUniqueApplication::start()) + { + fprintf(stderr, i18n("kwrited is already running.").local8Bit()); + exit(1); + } + // WABA: Make sure not to enable session management. putenv("SESSION_MANAGER="); - KApplication app(argc, argv, "kwrited"); - //FIXME: check if we have already have kwrited running. + KUniqueApplication app; + KWrited pro; app.exec(); return 0;