summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/dcopservice/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp/app_templates/dcopservice/main.cpp')
-rw-r--r--languages/cpp/app_templates/dcopservice/main.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/dcopservice/main.cpp b/languages/cpp/app_templates/dcopservice/main.cpp
new file mode 100644
index 00000000..55509560
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/main.cpp
@@ -0,0 +1,47 @@
+%{CPP_TEMPLATE}
+
+#include <kuniqueapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <dcopclient.h>
+#include "%{APPNAMELC}.h"
+
+static const char description[] =
+ I18N_NOOP("A KDE KPart Application");
+
+static const char version[] = "0.1";
+
+static KCmdLineOptions options[] =
+{
+ KCmdLineLastOption
+};
+
+int main (int argc, char *argv[])
+{
+ KLocale::setMainCatalogue("kdelibs");
+ KAboutData aboutdata("%{APPNAMELC}", I18N_NOOP("KDE"),
+ version, description,
+ KAboutData::License_GPL, "(C) %{YEAR}, %{AUTHOR}");
+ aboutdata.addAuthor("%{AUTHOR}",I18N_NOOP("Developer"),"%{EMAIL}");
+
+ KCmdLineArgs::init( argc, argv, &aboutdata );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KUniqueApplication::addCmdLineOptions();
+
+ if (!KUniqueApplication::start())
+ {
+ kdDebug() << "%{APPNAMELC} is already running!" << endl;
+ return (0);
+ }
+
+ KUniqueApplication app;
+ kdDebug() << "starting %{APPNAMELC} " << endl;
+ // This app is started automatically, no need for session management
+ app.disableSessionManagement();
+ %{APPNAME} *service = new %{APPNAME};
+ kdDebug() << "starting %{APPNAMELC} " << endl;
+ return app.exec();
+
+}