File indexing completed on 2022-12-06 15:40:01

0001 /*
0002     SPDX-FileCopyrightText: 2005 Benjamin C Meyer <ben@meyerhome.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #include "sweeper.h"
0008 
0009 #include <QApplication>
0010 #include <QCommandLineParser>
0011 #include <QIcon>
0012 
0013 #include <KAboutData>
0014 #include <KCrash>
0015 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0016 #include <Kdelibs4ConfigMigrator>
0017 #endif
0018 #include <KLocalizedString>
0019 
0020 #include <config-sweeper.h>
0021 
0022 int main(int argc, char *argv[])
0023 {
0024    QApplication a(argc, argv);
0025    KLocalizedString::setApplicationDomain("sweeper");
0026 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0027     Kdelibs4ConfigMigrator migrator(QStringLiteral("sweeper"));
0028     migrator.setConfigFiles(QStringList() << QStringLiteral("sweeperrc"));
0029     migrator.setConfigFiles(QStringList() << QStringLiteral("kprivacyrc"));
0030     migrator.setUiFiles(QStringList() << QStringLiteral("sweeperui.rc"));
0031     migrator.migrate();
0032 #endif
0033 
0034    KAboutData aboutData(QStringLiteral("sweeper"), i18n("Sweeper"),
0035                         QStringLiteral(SWEEPER_VERSION),
0036                         i18n("Helps clean unwanted traces the user leaves on the system."),
0037                         KAboutLicense::LGPL,
0038                         i18n("© 2003-2005, Ralf Hoelzer"),
0039                         QString(),
0040                         QStringLiteral("https://utils.kde.org/projects/sweeper"));
0041 
0042    aboutData.addAuthor(i18n("Ralf Hoelzer"), i18n("Original author"), QStringLiteral("ralf@well.com"));
0043    aboutData.addAuthor(i18n("Brian S. Stephan"), i18n("Maintainer"), QStringLiteral("bssteph@irtonline.org"));
0044    aboutData.addAuthor(i18n("Benjamin Meyer"), i18n("Thumbnail Cache"), QStringLiteral("ben+kdeprivacy@meyerhome.net"));
0045 
0046    // command line
0047    QCommandLineParser parser;
0048    KAboutData::setApplicationData(aboutData);
0049    a.setWindowIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
0050 
0051    const QCommandLineOption automaticOption(QStringLiteral("automatic"), i18n("Sweeps without user interaction"));
0052    parser.addOption(automaticOption);
0053    aboutData.setupCommandLine(&parser);
0054    parser.process(a);
0055    aboutData.processCommandLine(&parser);
0056 
0057    KCrash::initialize();
0058 
0059    // Application
0060    Sweeper *app;
0061    if (parser.isSet(automaticOption)) {
0062        app = new Sweeper(true);
0063    } else {
0064        app = new Sweeper(false);
0065        app->show();
0066    }
0067    return a.exec();
0068 }
0069 
0070 // kate: tab-width 3; indent-mode cstyle; replace-tabs true;