setButtons(KCModule::Help | KCModule::Apply);
- pluginslist->setSelectionMode(QAbstractItemView::NoSelection);
- pluginslist->setSortingEnabled(true);
- connect(pluginslist, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(slotItemChanged(QListWidgetItem*)));
+ connect(pluginstable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(slotPluginItemChanged(QTableWidgetItem*)));
- metainfolist->setSelectionMode(QAbstractItemView::NoSelection);
- metainfolist->setSortingEnabled(true);
- connect(metainfolist, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(slotItemChanged(QListWidgetItem*)));
+ connect(metainfolist, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(slotMetaItemChanged(QListWidgetItem*)));
load();
}
{
{
KConfig config("kmetainformationrc", KConfig::NoGlobals);
- pluginslist->clear();
+ pluginstable->clearContents();
+ pluginstable->setRowCount(0);
+ int rowcount = 0;
KConfigGroup pluginsgroup = config.group("Plugins");
const KService::List kfmdplugins = KServiceTypeTrader::self()->query("KFileMetaData/Plugin");
foreach (const KService::Ptr &kfmdplugin, kfmdplugins) {
const QString key = kfmdplugin->desktopEntryName();
- const QString itemtext = kfmdplugin->genericName();
- QListWidgetItem* item = new QListWidgetItem(itemtext, pluginslist);
- item->setData(Qt::UserRole, key);
+
+ pluginstable->setRowCount(rowcount + 1);
+
+ QTableWidgetItem* nameitem = new QTableWidgetItem();
+ nameitem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
+ nameitem->setText(kfmdplugin->genericName());
+ nameitem->setData(Qt::UserRole, key);
const bool enable = pluginsgroup.readEntry(key, true);
- item->setCheckState(enable ? Qt::Checked : Qt::Unchecked);
+ nameitem->setCheckState(enable ? Qt::Checked : Qt::Unchecked);
+ pluginstable->setItem(rowcount, 0, nameitem);
+
+ QTableWidgetItem* descitem = new QTableWidgetItem();
+ descitem->setFlags(Qt::ItemIsEnabled);
+ descitem->setText(kfmdplugin->comment());
+ pluginstable->setItem(rowcount, 1, descitem);
+
+ rowcount++;
}
}
{
KConfig config("kmetainformationrc", KConfig::NoGlobals);
KConfigGroup pluginsgroup = config.group("Plugins");
- for (int i = 0; i < pluginslist->count(); ++i) {
- QListWidgetItem* item = pluginslist->item(i);
+ for (int i = 0; i < pluginstable->rowCount(); ++i) {
+ QTableWidgetItem* item = pluginstable->item(i, 0);
const bool enable = (item->checkState() == Qt::Checked);
const QString key = item->data(Qt::UserRole).toString();
pluginsgroup.writeEntry(key, enable);
loadMetaInfo();
}
-void KCMMetaInfo::slotItemChanged(QListWidgetItem *item)
+void KCMMetaInfo::slotPluginItemChanged(QTableWidgetItem *item)
+{
+ Q_UNUSED(item);
+ emit changed(true);
+}
+
+void KCMMetaInfo::slotMetaItemChanged(QListWidgetItem *item)
{
Q_UNUSED(item);
emit changed(true);
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
- <widget class="KListWidget" name="metainfolist"/>
+ <widget class="KListWidget" name="metainfolist">
+ <property name="toolTip">
+ <string><html><head/><body><p>Meta information shown in tooltips and properties dialogs.</p></body></html></string>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::NoSelection</enum>
+ </property>
+ <property name="sortingEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
</layout>
</widget>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
- <widget class="KListWidget" name="pluginslist"/>
+ <widget class="QTableWidget" name="pluginstable">
+ <property name="toolTip">
+ <string><html><head/><body><p>Disabling undesired plugins can reduce the disk I/O during directory listing</p></body></html></string>
+ </property>
+ <property name="selectionMode">
+ <enum>QAbstractItemView::NoSelection</enum>
+ </property>
+ <property name="sortingEnabled">
+ <bool>true</bool>
+ </property>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
+ <column>
+ <property name="text">
+ <string>Plugin</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ </column>
+ </widget>
</item>
</layout>
</widget>