| 1 | /* ============================================================ |
| 2 | * |
| 3 | * This file is a part of digiKam project |
| 4 | * https://www.digikam.org |
| 5 | * |
| 6 | * Date : 2009-12-01 |
| 7 | * Description : demo-program for geolocation interface |
| 8 | * |
| 9 | * SPDX-FileCopyrightText: 2009-2010 by Michael G. Hansen <mike at mghansen dot de> |
| 10 | * SPDX-FileCopyrightText: 2014 by Justus Schwartz <justus at gmx dot li> |
| 11 | * |
| 12 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 13 | * |
| 14 | * ============================================================ */ |
| 15 | |
| 16 | // Qt includes |
| 17 | |
| 18 | #include <QApplication> |
| 19 | #include <QCommandLineParser> |
| 20 | #include <QCommandLineOption> |
| 21 | |
| 22 | // Local includes |
| 23 | |
| 24 | #include "digikam_debug.h" |
| 25 | #include "mainwindow.h" |
| 26 | #include "digikam_version.h" |
| 27 | |
| 28 | int main(int argc, char* argv[]) |
| 29 | { |
| 30 | QApplication app(argc, argv); |
| 31 | QCommandLineParser parser; |
| 32 | parser.addVersionOption(); |
| 33 | parser.addHelpOption(); |
| 34 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("demopoints_single"), QLatin1String("Add built-in demo points as single markers"))); |
| 35 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("demopoints_group"), QLatin1String("Add built-in demo points as groupable markers"))); |
| 36 | parser.addOption(QCommandLineOption(QStringList() << QLatin1String("single"), QLatin1String("Do not group the displayed images"))); |
| 37 | parser.addPositionalArgument(QString::fromLatin1("images"), QLatin1String("List of images"), QString::fromLatin1("[images...]")); |
| 38 | parser.process(app); |
| 39 | |
| 40 | // get the list of images to load on startup: |
| 41 | |
| 42 | QList<QUrl> imagesList; |
| 43 | const auto files = parser.positionalArguments(); |
| 44 | |
| 45 | for (const QString& file : files) |
| 46 | { |
| 47 | const QUrl argUrl = QUrl::fromLocalFile(file); |
| 48 | qCDebug(DIGIKAM_TESTS_LOG) << argUrl; |
| 49 | imagesList << argUrl; |
| 50 | } |
| 51 | |
| 52 | MainWindow* const myMainWindow = new MainWindow(&parser); |
| 53 | myMainWindow->show(); |
| 54 | myMainWindow->slotScheduleImagesForLoading(imagesList); |
| 55 | |
| 56 | return app.exec(); |
| 57 | } |