~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/tray/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Alessandro Ghersi, Harald Sitter
  • Date: 2009-06-27 04:40:05 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627044005-4y2vm9xz7rvmzi4p
Tags: 4:4.2.95svn20090701-0ubuntu1
[ Alessandro Ghersi ]
* New upstream release
  - Bump build-deps
* Remove akonadi-kde and libmaildir4 packages
  - remove akonadi-kde.install and libmaildir4.install
  - remove libmaildir4 from debian/rules
  - remove akonadi-kde and libmaildir4 from depends
  - remove akonadi-kde and libmaildir4 from installgen
* Update kdepim-dev.install
* Update kpilot.install
* Add akonadi-kde and libmaildir4 transitional packages

[ Harald Sitter ]
* KAddressbook replaces Kontact << 4.2.85 (LP: #378373)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2008 Omat Holding B.V. <info@omat.nl>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
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 GNU
 
12
   General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License
 
15
   along with this program; if not, write to the Free Software
 
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
*/
 
18
 
 
19
#include <QDBusInterface>
 
20
#include <kuniqueapplication.h>
 
21
#include <kstartupinfo.h>
 
22
#include <kcmdlineargs.h>
 
23
#include <kaboutdata.h>
 
24
#include <stdio.h>
 
25
#include <stdlib.h>
 
26
 
 
27
#include "dock.h"
 
28
 
 
29
/**
 
30
 * @class AkonadiTrayApplication
 
31
 * @author Tom Albers <tomalbers@kde.nl>
 
32
 * This class is a simple inheritance from KUniqueApplication
 
33
 * the reason that it is reimplemented is that when AkonadiTray
 
34
 * is launched a second time it would in the orinal implementation
 
35
 * make the show(). which we do not want. This
 
36
 * class misses that call.
 
37
 */
 
38
class AkonadiTrayApplication : public KUniqueApplication
 
39
{
 
40
public:
 
41
    /**
 
42
     * Similar to KUniqueApplication::newInstance, only without
 
43
     * the call to raise the widget when a second instance is started.
 
44
     */
 
45
    int newInstance() {
 
46
        return 0;
 
47
    }
 
48
};
 
49
 
 
50
int main( int argc, char *argv[] )
 
51
{
 
52
    KAboutData aboutData( "akonaditray", 0,
 
53
                          ki18n( "AkonadiTray" ),
 
54
                          "0.1",
 
55
                          ki18n( "System tray application to control basic Akonadi functions" ),
 
56
                          KAboutData::License_GPL,
 
57
                          ki18n( "(c) 2008 Omat Holding B.V." ),
 
58
                          KLocalizedString() );
 
59
    aboutData.addAuthor( ki18n( "Tom Albers" ), ki18n( "Maintainer and Author" ),
 
60
                         "tomalbers@kde.nl", "http://www.omat.nl" );
 
61
    aboutData.setProgramIconName( "akonadi" );
 
62
 
 
63
    KCmdLineArgs::init( argc, argv, &aboutData );
 
64
 
 
65
    if ( !KUniqueApplication::start() ) {
 
66
        fprintf( stderr, "akonaditray is already running!\n" );
 
67
        exit( 0 );
 
68
    }
 
69
 
 
70
    AkonadiTrayApplication a;
 
71
    a.setQuitOnLastWindowClosed( false );
 
72
 
 
73
    Tray tray;
 
74
 
 
75
    return a.exec();
 
76
}