File indexing completed on 2024-12-08 08:16:16

0001 /*
0002     main.cpp
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 */
0007 
0008 #include <QApplication>
0009 #include <QCommandLineOption>
0010 #include <QCommandLineParser>
0011 #include <QDir>
0012 #include <QUrl>
0013 
0014 #include <KAboutData>
0015 #include <KLocalizedString>
0016 
0017 #include "kfinddlg.h"
0018 #include "kfind_version.h"
0019 
0020 int main(int argc, char **argv)
0021 {
0022     QApplication app(argc, argv);
0023 
0024     KLocalizedString::setApplicationDomain(QByteArrayLiteral("kfind"));
0025 
0026     KAboutData aboutData(QStringLiteral("kfind"), i18n("KFind"),
0027                          QStringLiteral(KFIND_VERSION_STRING), i18n("KDE file find utility"), KAboutLicense::GPL,
0028                          i18n("(c) 1998-2021, The KDE Developers"));
0029 
0030     aboutData.addAuthor(i18n("Kai Uwe Broulik"), i18n("Current Maintainer"), QStringLiteral("kde@privat.broulik.de"));
0031     aboutData.addAuthor(i18n("Eric Coquelle"), i18n("Former Maintainer"), QStringLiteral("coquelle@caramail.com"));
0032     aboutData.addAuthor(i18n("Mark W. Webb"), i18n("Developer"), QStringLiteral("markwebb@adelphia.net"));
0033     aboutData.addAuthor(i18n("Beppe Grimaldi"), i18n("UI Design & more search options"), QStringLiteral("grimalkin@ciaoweb.it"));
0034     aboutData.addAuthor(i18n("Martin Hartig"));
0035     aboutData.addAuthor(i18n("Stephan Kulow"), QString(), QStringLiteral("coolo@kde.org"));
0036     aboutData.addAuthor(i18n("Mario Weilguni"), QString(), QStringLiteral("mweilguni@sime.com"));
0037     aboutData.addAuthor(i18n("Alex Zepeda"), QString(), QStringLiteral("zipzippy@sonic.net"));
0038     aboutData.addAuthor(i18n("Miroslav FlĂ­dr"), QString(), QStringLiteral("flidr@kky.zcu.cz"));
0039     aboutData.addAuthor(i18n("Harri Porten"), QString(), QStringLiteral("porten@kde.org"));
0040     aboutData.addAuthor(i18n("Dima Rogozin"), QString(), QStringLiteral("dima@mercury.co.il"));
0041     aboutData.addAuthor(i18n("Carsten Pfeiffer"), QString(), QStringLiteral("pfeiffer@kde.org"));
0042     aboutData.addAuthor(i18n("Hans Petter Bieker"), QString(), QStringLiteral("bieker@kde.org"));
0043     aboutData.addAuthor(i18n("Waldo Bastian"), i18n("UI Design"), QStringLiteral("bastian@kde.org"));
0044     aboutData.addAuthor(i18n("Alexander Neundorf"), QString(), QStringLiteral("neundorf@kde.org"));
0045     aboutData.addAuthor(i18n("Clarence Dang"), QString(), QStringLiteral("dang@kde.org"));
0046     aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails"));
0047     QCommandLineParser parser;
0048     KAboutData::setApplicationData(aboutData);
0049     parser.addOption(QCommandLineOption(QStringList() <<  QStringLiteral("+[searchpath]"), i18n("Path(s) to search")));
0050 
0051     aboutData.setupCommandLine(&parser);
0052     parser.process(app);
0053     aboutData.processCommandLine(&parser);
0054 
0055     QUrl url;
0056     if (!parser.positionalArguments().isEmpty())
0057     {
0058         url = QUrl::fromUserInput(parser.positionalArguments().at(0), QDir::currentPath(), QUrl::AssumeLocalFile);
0059     }
0060     if (url.isEmpty()) {
0061         url = QUrl::fromLocalFile(QDir::currentPath());
0062     }
0063     if (url.isEmpty()) {
0064         url = QUrl::fromLocalFile(QDir::homePath());
0065     }
0066 
0067     KfindDlg kfinddlg(url);
0068     return kfinddlg.exec();
0069 }