File indexing completed on 2024-04-21 05:54:08

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 #include <KLocalizedString>
0016 
0017 #include <config-sweeper.h>
0018 
0019 int main(int argc, char *argv[])
0020 {
0021    QApplication a(argc, argv);
0022    KLocalizedString::setApplicationDomain(QByteArrayLiteral("sweeper"));
0023 
0024    KAboutData aboutData(QStringLiteral("sweeper"), i18n("Sweeper"),
0025                         QStringLiteral(SWEEPER_VERSION),
0026                         i18n("Helps clean unwanted traces the user leaves on the system."),
0027                         KAboutLicense::LGPL,
0028                         i18n("© 2003-2005, Ralf Hoelzer"),
0029                         QString(),
0030                         QStringLiteral("https://apps.kde.org/sweeper"));
0031 
0032    aboutData.addAuthor(i18n("Ralf Hoelzer"), i18n("Original author"), QStringLiteral("ralf@well.com"));
0033    aboutData.addAuthor(i18n("Brian S. Stephan"), i18n("Maintainer"), QStringLiteral("bssteph@irtonline.org"));
0034    aboutData.addAuthor(i18n("Benjamin Meyer"), i18n("Thumbnail Cache"), QStringLiteral("ben+kdeprivacy@meyerhome.net"));
0035 
0036    // command line
0037    QCommandLineParser parser;
0038    KAboutData::setApplicationData(aboutData);
0039    a.setWindowIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
0040 
0041    const QCommandLineOption automaticOption(QStringLiteral("automatic"), i18n("Sweeps without user interaction"));
0042    parser.addOption(automaticOption);
0043    aboutData.setupCommandLine(&parser);
0044    parser.process(a);
0045    aboutData.processCommandLine(&parser);
0046 
0047    KCrash::initialize();
0048 
0049    // Application
0050    Sweeper *app;
0051    if (parser.isSet(automaticOption)) {
0052        app = new Sweeper(true);
0053    } else {
0054        app = new Sweeper(false);
0055        app->show();
0056    }
0057    return a.exec();
0058 }
0059 
0060 // kate: tab-width 3; indent-mode cstyle; replace-tabs true;