File indexing completed on 2025-01-19 03:57:50

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2011-12-28
0007  * Description : test for implementation of thread manager api
0008  *
0009  * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText:      2014 by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 // Qt includes
0017 
0018 #include <QString>
0019 #include <QStringList>
0020 #include <QApplication>
0021 #include <QStandardPaths>
0022 #include <QUrl>
0023 
0024 // Local includes
0025 
0026 #include "digikam_debug.h"
0027 #include "drawfiles.h"
0028 #include "processordlg.h"
0029 #include "dfiledialog.h"
0030 
0031 using namespace Digikam;
0032 
0033 int main(int argc, char* argv[])
0034 {
0035     QApplication app(argc, argv);
0036     QList<QUrl> list;
0037 
0038     if (argc <= 1)
0039     {
0040         QString filter = QString::fromLatin1("Raw Files") + QString::fromLatin1(" (%1)").arg(Digikam::s_rawFileExtensions());
0041         qCDebug(DIGIKAM_TESTS_LOG) << filter;
0042 
0043         QStringList files = DFileDialog::getOpenFileNames(nullptr, QString::fromLatin1("Select RAW files to process"),
0044                                                          QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).first(),
0045                                                          filter);
0046 
0047         Q_FOREACH (const QString& f, files)
0048         {
0049             list.append(QUrl::fromLocalFile(f));
0050         }
0051     }
0052     else
0053     {
0054         for (int i = 1 ; i < argc ; ++i)
0055         {
0056             list.append(QUrl::fromLocalFile(QString::fromLocal8Bit(argv[i])));
0057         }
0058     }
0059 
0060     if (!list.isEmpty())
0061     {
0062 
0063         ProcessorDlg* const dlg = new ProcessorDlg(list);
0064         dlg->show();
0065         app.exec();
0066     }
0067 
0068     return 0;
0069 }