fix some layouts everwhere in kopete
[kdenetwork.git] / kdict / application.cpp
blobc5c93abe047efe7ba8e2b6cf950f7781d2b8ea9b
1 /* -------------------------------------------------------------
3 application.cpp (part of The KDE Dictionary Client)
5 Copyright (C) 2000-2001 Christian Gebauer <gebauer@kde.org>
7 This file is distributed under the Artistic License.
8 See LICENSE for details.
10 ------------------------------------------------------------- */
12 #include <kdebug.h>
13 #include <kcmdlineargs.h>
15 #include "application.h"
16 #include "toplevel.h"
19 Application::Application()
20 : KUniqueApplication()
22 m_mainWindow = new TopLevel();
26 Application::~Application()
28 delete m_mainWindow;
32 int Application::newInstance()
34 kDebug(5004) << "Application::newInstance()" << endl;
35 KUniqueApplication::newInstance();
37 // process parameters...
38 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
40 m_mainWindow->show();
42 if (args->isSet("clipboard"))
44 m_mainWindow->defineClipboard();
46 else
48 if (args->count()>0)
50 QString phrase;
51 for (int i=0;i<args->count();i++)
53 phrase += QString::fromLocal8Bit(args->arg(i));
54 if (i+1 < args->count())
55 phrase += ' ';
57 m_mainWindow->define(phrase);
59 else
61 m_mainWindow->normalStartup();
65 return 0;
68 //--------------------------------
70 #include "application.moc"