2 * This file is part of the KDE project
3 * Copyright (C) 2008 Michael Leupold <lemma@confuego.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License version 2 as published by the Free Software Foundation.
9 * This library 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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #include <kuniqueapplication.h>
21 #include <kaboutdata.h>
22 #include <kcmdlineargs.h>
25 #include <kconfiggroup.h>
29 static bool isWalletEnabled()
31 KConfig
cfg("kwalletrc");
32 KConfigGroup
walletGroup(&cfg
, "Wallet");
33 return walletGroup
.readEntry("Enabled", true);
36 extern "C" KDE_EXPORT
int kdemain(int argc
, char **argv
)
38 KAboutData
aboutdata("kwalletd", 0, ki18n("KDE Wallet Service"),
39 "0.2", ki18n("KDE Wallet Service"),
40 KAboutData::License_LGPL
, ki18n("(C) 2002-2008 George Staikos, Michael Leupold, Thiago Maceira"));
41 aboutdata
.addAuthor(ki18n("Michael Leupold"),ki18n("Maintainer"),"lemma@confuego.org");
42 aboutdata
.addAuthor(ki18n("George Staikos"),ki18n("Former maintainer"),"staikos@kde.org");
43 aboutdata
.addAuthor(ki18n("Thiago Maceira"),ki18n("D-Bus Interface"),"thiago@kde.org");
45 KCmdLineArgs::init( argc
, argv
, &aboutdata
);
46 KUniqueApplication::addCmdLineOptions();
47 KUniqueApplication app
;
49 // This app is started automatically, no need for session management
50 app
.disableSessionManagement();
51 app
.setQuitOnLastWindowClosed( false );
53 // check if kwallet is disabled
54 if (!isWalletEnabled()) {
55 kDebug(7024) << "kwalletd is disabled!";
59 if (!KUniqueApplication::start())
61 kDebug(7024) << "kwalletd is already running!";