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

« back to all changes in this revision

Viewing changes to klipper/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
// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*-
 
2
/* This file is part of the KDE project
 
3
   Copyright (C) Andrew Stanley-Jones
 
4
 
 
5
   This program is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2 of the License, or (at your option) any later version.
 
9
 
 
10
   This program is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
    General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU General Public License
 
16
   along with this program; see the file COPYING.  If not, write to
 
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
   Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#include <stdio.h>
 
22
#include <stdlib.h>
 
23
 
 
24
#include <klocale.h>
 
25
#include <kcmdlineargs.h>
 
26
#include <kaboutdata.h>
 
27
#include <kuniqueapplication.h>
 
28
#include <KConfigDialogManager>
 
29
 
 
30
#include "tray.h"
 
31
#include "version.h"
 
32
#include "klipper.h"
 
33
 
 
34
extern "C" int KDE_EXPORT kdemain(int argc, char *argv[])
 
35
{
 
36
  Klipper::createAboutData();
 
37
  KCmdLineArgs::init( argc, argv, Klipper::aboutData());
 
38
  KUniqueApplication::addCmdLineOptions();
 
39
 
 
40
  if (!KUniqueApplication::start()) {
 
41
       fprintf(stderr, "Klipper is already running!\n");
 
42
       exit(0);
 
43
  }
 
44
  KUniqueApplication app;
 
45
  app.disableSessionManagement();
 
46
  app.setQuitOnLastWindowClosed( false );
 
47
 
 
48
  // make KConfigDialog "know" when our actions page is changed
 
49
  KConfigDialogManager::changedMap()->insert("ActionsTreeWidget", SIGNAL(changed()));
 
50
 
 
51
  KlipperTray klipper;
 
52
  int ret = app.exec();
 
53
  Klipper::destroyAboutData();
 
54
  return ret;
 
55
}