~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to krunner/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2006 Aaron Seigo <aseigo@kde.org>
 
3
 *   Copyright (C) 2006 Zack Rusin <zack@kde.org>
 
4
 *
 
5
 *   This program is free software; you can redistribute it and/or modify
 
6
 *   it under the terms of the GNU Library General Public License version 2 as
 
7
 *   published by the Free Software Foundation
 
8
 *
 
9
 *   This program is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU Library General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#include <KAboutData>
 
21
#include <KCmdLineArgs>
 
22
#include <kdebug.h>
 
23
#include <KLocale>
 
24
#include <KGlobal>
 
25
 
 
26
#include "krunnerapp.h"
 
27
#ifdef Q_WS_X11
 
28
#include "saverengine.h"
 
29
#include "startupid.h"
 
30
#endif
 
31
#include "kscreensaversettings.h" // contains screen saver config
 
32
#include "klaunchsettings.h" // contains startup config
 
33
 
 
34
#ifdef Q_WS_X11
 
35
#include <X11/extensions/Xrender.h>
 
36
#endif
 
37
 
 
38
static const char description[] = I18N_NOOP( "KDE run command interface" );
 
39
static const char version[] = "0.1";
 
40
 
 
41
extern "C"
 
42
KDE_EXPORT int kdemain(int argc, char* argv[])
 
43
{
 
44
#ifdef Q_WS_X11
 
45
    // krunner only works properly with Qt's native X11 backend; override any compile-time
 
46
    // or command line settings to raster or OpenGL.
 
47
    QApplication::setGraphicsSystem(QLatin1String( "native" ));
 
48
#endif
 
49
 
 
50
    KAboutData aboutData( "krunner", 0, ki18n( "Run Command Interface" ),
 
51
                          version, ki18n(description), KAboutData::License_GPL,
 
52
                          ki18n("(c) 2006, Aaron Seigo") );
 
53
    aboutData.addAuthor( ki18n("Aaron J. Seigo"),
 
54
                         ki18n( "Author and maintainer" ),
 
55
                         "aseigo@kde.org" );
 
56
 
 
57
    KCmdLineArgs::init(argc, argv, &aboutData);
 
58
    if (!KUniqueApplication::start()) {
 
59
        return 0;
 
60
    }
 
61
 
 
62
    KRunnerApp *app = KRunnerApp::self();
 
63
    KGlobal::locale()->insertCatalog(QLatin1String( "processui" ));
 
64
    KGlobal::locale()->insertCatalog(QLatin1String( "libplasma" ));
 
65
    app->disableSessionManagement(); // autostarted
 
66
    int rc = app->exec();
 
67
    delete app;
 
68
    return rc;
 
69
}
 
70