File indexing completed on 2025-01-19 03:55:36
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2018-09-22 0007 * Description : configuration view for external DImg plugin 0008 * 0009 * SPDX-FileCopyrightText: 2020-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #include "dpluginconfviewdimg.h" 0016 0017 // Qt includes 0018 0019 #include <QHeaderView> 0020 0021 // KDE includes 0022 0023 #include <klocalizedstring.h> 0024 0025 // Local includes 0026 0027 #include "itempropertiestxtlabel.h" 0028 #include "dplugindimg.h" 0029 #include "dpluginloader.h" 0030 0031 namespace Digikam 0032 { 0033 0034 DPluginConfViewDImg::DPluginConfViewDImg(QWidget* const parent) 0035 : DPluginConfView(parent) 0036 { 0037 setColumnHidden(1, true); 0038 headerItem()->setText(2, i18n("Type-Mimes")); 0039 header()->setSectionResizeMode(2, QHeaderView::Stretch); 0040 this->loadPlugins(); 0041 } 0042 0043 DPluginConfViewDImg::~DPluginConfViewDImg() 0044 { 0045 } 0046 0047 void DPluginConfViewDImg::loadPlugins() 0048 { 0049 DPluginLoader* const loader = DPluginLoader::instance(); 0050 0051 if (loader) 0052 { 0053 Q_FOREACH (DPlugin* const tool, loader->allPlugins()) 0054 { 0055 DPluginDImg* const plug = dynamic_cast<DPluginDImg*>(tool); 0056 0057 if (plug) 0058 { 0059 QTreeWidgetItem* const item = appendPlugin(plug); 0060 DTextBrowser* const tview = new DTextBrowser(plug->typeMimes(), this); 0061 setItemWidget(item, 2, tview); 0062 } 0063 } 0064 } 0065 0066 // Sort items by plugin names. 0067 0068 sortItems(0, Qt::AscendingOrder); 0069 } 0070 0071 } // namespace Digikam 0072 0073 #include "moc_dpluginconfviewdimg.cpp"