File indexing completed on 2025-01-05 03:58:08

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2021-02-04
0007  * Description : a command line tool to list MacOS apllication bundle
0008  *               suitable to open a type mime..
0009  *
0010  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles 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 <QUrl>
0020 #include <QList>
0021 
0022 // Local includes
0023 
0024 #include "digikam_debug.h"
0025 #include "dservicemenu.h"
0026 
0027 using namespace Digikam;
0028 
0029 int main(int /*argc*/, char** /*argv*/)
0030 {
0031     QString suffix;
0032     QList<QUrl> list;
0033 
0034     suffix = QLatin1String("jpg");
0035     list   = DServiceMenu::MacApplicationForFileExtension(suffix);
0036 
0037     qCDebug(DIGIKAM_TESTS_LOG) << "MacOS Bundle urls for" << suffix;
0038     qCDebug(DIGIKAM_TESTS_LOG) << list;
0039 
0040     suffix = QLatin1String("jpeg");
0041     list   = DServiceMenu::MacApplicationForFileExtension(suffix);
0042 
0043     qCDebug(DIGIKAM_TESTS_LOG) << "MacOS Bundle urls for" << suffix;
0044     qCDebug(DIGIKAM_TESTS_LOG) << list;
0045 
0046     suffix = QLatin1String("png");
0047     list   = DServiceMenu::MacApplicationForFileExtension(suffix);
0048 
0049     qCDebug(DIGIKAM_TESTS_LOG) << "MacOS Bundle urls for" << suffix;
0050     qCDebug(DIGIKAM_TESTS_LOG) << list;
0051 
0052     suffix = QLatin1String("tiff");
0053     list   = DServiceMenu::MacApplicationForFileExtension(suffix);
0054 
0055     qCDebug(DIGIKAM_TESTS_LOG) << "MacOS Bundle urls for" << suffix;
0056     qCDebug(DIGIKAM_TESTS_LOG) << list;
0057 
0058     suffix = QLatin1String("tif");
0059     list   = DServiceMenu::MacApplicationForFileExtension(suffix);
0060 
0061     qCDebug(DIGIKAM_TESTS_LOG) << "MacOS Bundle urls for" << suffix;
0062     qCDebug(DIGIKAM_TESTS_LOG) << list;
0063 
0064     return 0;
0065 }