summaryrefslogtreecommitdiffstats
path: root/kdict/application.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kdict/application.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdict/application.cpp')
-rw-r--r--kdict/application.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/kdict/application.cpp b/kdict/application.cpp
new file mode 100644
index 00000000..28e3a398
--- /dev/null
+++ b/kdict/application.cpp
@@ -0,0 +1,71 @@
+/* -------------------------------------------------------------
+
+ application.cpp (part of The KDE Dictionary Client)
+
+ Copyright (C) 2000-2001 Christian Gebauer <[email protected]>
+
+ This file is distributed under the Artistic License.
+ See LICENSE for details.
+
+ ------------------------------------------------------------- */
+
+#include <kwin.h>
+#include <kdebug.h>
+#include <kcmdlineargs.h>
+
+#include "application.h"
+#include "toplevel.h"
+
+
+Application::Application()
+ : KUniqueApplication()
+{
+ m_mainWindow = new TopLevel( 0, "mainWindow" );
+}
+
+
+Application::~Application()
+{
+ delete m_mainWindow;
+}
+
+
+int Application::newInstance()
+{
+ kdDebug(5004) << "Application::newInstance()" << endl;
+ KUniqueApplication::newInstance();
+
+ // process parameters...
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ m_mainWindow->show();
+
+ if (args->isSet("clipboard"))
+ {
+ m_mainWindow->defineClipboard();
+ }
+ else
+ {
+ if (args->count()>0)
+ {
+ QString phrase;
+ for (int i=0;i<args->count();i++)
+ {
+ phrase += QString::fromLocal8Bit(args->arg(i));
+ if (i+1 < args->count())
+ phrase += " ";
+ }
+ m_mainWindow->define(phrase);
+ }
+ else
+ {
+ m_mainWindow->normalStartup();
+ }
+ }
+
+ return 0;
+}
+
+//--------------------------------
+
+#include "application.moc"