~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to klipper/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

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
 
 
29
#include "tray.h"
 
30
#include "version.h"
 
31
 
 
32
extern "C" int KDE_EXPORT kdemain(int argc, char *argv[])
 
33
{
 
34
  Klipper::createAboutData();
 
35
  KCmdLineArgs::init( argc, argv, Klipper::aboutData());
 
36
  KUniqueApplication::addCmdLineOptions();
 
37
 
 
38
  if (!KUniqueApplication::start()) {
 
39
       fprintf(stderr, "Klipper is already running!\n");
 
40
       exit(0);
 
41
  }
 
42
  KUniqueApplication app;
 
43
  app.disableSessionManagement();
 
44
 
 
45
  KlipperTray *toplevel = new KlipperTray();
 
46
 
 
47
#ifdef __GNUC__
 
48
#warning Port to KSystemTrayIcon
 
49
#endif
 
50
  toplevel->setGeometry(-100, -100, 42, 42 );
 
51
  toplevel->show();
 
52
 
 
53
  int ret = app.exec();
 
54
  delete toplevel;
 
55
  Klipper::destroyAboutData();
 
56
  return ret;
 
57
}