mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kdm: do not add entries for unavailable styles in KCM
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3dad5a3eab
commit
683c904f53
1 changed files with 7 additions and 2 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QFormLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QStyleFactory>
|
||||
|
||||
extern KConfig *config;
|
||||
|
||||
|
@ -145,17 +146,21 @@ void KDMGeneralWidget::loadGuiStyles(KBackedComboBox *combo)
|
|||
// XXX: Global + local schemes
|
||||
const QStringList list = KGlobal::dirs()->
|
||||
findAllResources("data", "kstyle/themes/*.themerc", KStandardDirs::NoDuplicates);
|
||||
const QStringList list2 = QStyleFactory::keys();
|
||||
for (QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it) {
|
||||
KConfig config(*it, KConfig::SimpleConfig);
|
||||
|
||||
if (!(config.hasGroup("KDE") && config.hasGroup("Misc")))
|
||||
continue;
|
||||
|
||||
QString str2 = config.group("KDE").readEntry("WidgetStyle");
|
||||
const QString str2 = config.group("KDE").readEntry("WidgetStyle");
|
||||
if (str2.isNull())
|
||||
continue;
|
||||
if (!list2.contains(str2, Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
combo->insertItem(str2, config.group("Misc").readEntry("Name"));
|
||||
const QString str3 = config.group("Misc").readEntry("Name");
|
||||
combo->insertItem(str2, str3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue