1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2019-09-19
7  * Description : digiKam plugin definition for DImg image loader.
8  *
9  * Copyright (C) 2020 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #include "dplugindimg.h"
25 
26 // Qt includes
27 
28 #include <QMimeDatabase>
29 
30 // KDE includes
31 
32 #include <klocalizedstring.h>
33 
34 // Local includes
35 
36 #include "digikam_version.h"
37 #include "digikam_debug.h"
38 
39 namespace Digikam
40 {
41 
DPluginDImg(QObject * const parent)42 DPluginDImg::DPluginDImg(QObject* const parent)
43     : DPlugin(parent)
44 {
45 }
46 
~DPluginDImg()47 DPluginDImg::~DPluginDImg()
48 {
49 }
50 
extraAboutData() const51 QMap<QString, QString> DPluginDImg::extraAboutData() const
52 {
53     QMap<QString, QString> map;
54     QMimeDatabase mimeDb;
55 
56     foreach (const QString& ext, typeMimes().split(QLatin1Char(' ')))
57     {
58         if (!ext.isEmpty())
59         {
60             map.insert(ext, mimeDb.mimeTypeForFile(QString::fromLatin1("foo.%1").arg(ext)).comment());
61         }
62     }
63 
64     return map;
65 };
66 
extraAboutDataTitle() const67 QString DPluginDImg::extraAboutDataTitle() const
68 {
69     return i18n("Type-Mimes");
70 };
71 
72 } // namespace Digikam
73