KWallet

kwalletd/main.cpp
1/*
2 SPDX-FileCopyrightText: 2024 Marco Martin <notmart@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5*/
6
7#include "kwalletd.h"
8
9#include <KAboutData>
10#include <KConfig>
11#include <KConfigGroup>
12#include <KDBusService>
13#include <KLocalizedString>
14
15#include <QApplication>
16#include <QCommandLineParser>
17
18static bool isWalletEnabled()
19{
20 KConfig cfg(QStringLiteral("kwalletrc"));
21 KConfigGroup walletGroup(&cfg, QStringLiteral("Wallet"));
22 return walletGroup.readEntry(QStringLiteral("Enabled"), true);
23}
24
25int main(int argc, char **argv)
26{
27 QApplication application(argc, argv);
28
30
31 KAboutData aboutData(QStringLiteral("kwalletd"),
32 i18n("kwalletd"),
33 QStringLiteral("0.1"),
34 i18n("A KWallet compatibility service, wrapping upon Secret Service"),
36 i18n("(C) 2025, The KDE Developers"));
37
38 aboutData.addAuthor(i18n("Marco Martin"), i18n("Author"), QStringLiteral("notmart@gmail.com"));
39 aboutData.setOrganizationDomain("kde.org");
40 aboutData.setDesktopFileName(QStringLiteral("org.kde.kwalletd"));
41
43
44 QCommandLineParser parser;
45 aboutData.setupCommandLine(&parser);
46
47 parser.process(application);
48 aboutData.processCommandLine(&parser);
49
50 // check if kwallet is disabled
51 if (!isWalletEnabled()) {
52 qCDebug(KWALLETD_LOG) << "kwallet is disabled!";
53
54 return (0);
55 }
56
57 KDBusService dbusUniqueInstance(KDBusService::Unique);
58
59 KWalletD wallet;
60
61 return application.exec();
62}
static void setApplicationData(const KAboutData &aboutData)
static void setApplicationDomain(const QByteArray &domain)
QString i18n(const char *text, const TYPE &arg...)
void process(const QCoreApplication &app)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:53:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.