From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- kdict/application.cpp | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 kdict/application.cpp (limited to 'kdict/application.cpp') 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 + + This file is distributed under the Artistic License. + See LICENSE for details. + + ------------------------------------------------------------- */ + +#include +#include +#include + +#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;icount();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" -- cgit v1.2.1