KIO
main.cpp
Go to the documentation of this file.00001
00020 #include <kuniqueapplication.h>
00021 #include <kaboutdata.h>
00022 #include <kcmdlineargs.h>
00023 #include <kdebug.h>
00024 #include <kconfig.h>
00025 #include <kconfiggroup.h>
00026
00027 #include "kwalletd.h"
00028
00029 static bool isWalletEnabled()
00030 {
00031 KConfig cfg("kwalletrc");
00032 KConfigGroup walletGroup(&cfg, "Wallet");
00033 return walletGroup.readEntry("Enabled", true);
00034 }
00035
00036 extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
00037 {
00038 KAboutData aboutdata("kwalletd", "kdelibs4", ki18n("KDE Wallet Service"),
00039 "0.1", ki18n("KDE Wallet Service"),
00040 KAboutData::License_LGPL, ki18n("(C) 2002-2008 George Staikos, Michael Leupold, Thiago Maceira"));
00041
00042
00043
00044
00045
00046 KCmdLineArgs::init( argc, argv, &aboutdata );
00047 KUniqueApplication::addCmdLineOptions();
00048 KUniqueApplication app;
00049
00050
00051 app.disableSessionManagement();
00052 app.setQuitOnLastWindowClosed( false );
00053
00054
00055 if (!isWalletEnabled()) {
00056 kDebug(7024) << "kwalletd is disabled!";
00057 return (0);
00058 }
00059
00060 if (!KUniqueApplication::start())
00061 {
00062 kDebug(7024) << "kwalletd is already running!";
00063 return (0);
00064 }
00065
00066 KWalletD walletd;
00067 int res = app.exec();
00068
00069 return res;
00070 }