From 3ba464e1c3d1cfc94fa61ff5a56b3e58061524f0 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sat, 7 Feb 2009 14:49:26 +0000 Subject: [PATCH] if name doesn't exist, try to get it from key svn path=/trunk/KDE/kdelibs/; revision=922727 --- configloader.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configloader.cpp b/configloader.cpp index 0a5e981b7..f145bc2d2 100644 --- a/configloader.cpp +++ b/configloader.cpp @@ -112,11 +112,11 @@ bool ConfigLoaderHandler::startElement(const QString &namespaceURI, const QStrin for (int i = 0; i < numAttrs; ++i) { QString name = attrs.localName(i).toLower(); if (name == "name") { - m_name = attrs.value(i); + m_name = attrs.value(i).trimmed(); } else if (name == "type") { m_type = attrs.value(i).toLower(); } else if (name == "key") { - m_key = attrs.value(i); + m_key = attrs.value(i).trimmed(); } } } else if (tag == "choice") { @@ -182,9 +182,15 @@ bool ConfigLoaderHandler::endElement(const QString &namespaceURI, void ConfigLoaderHandler::addItem() { if (m_name.isEmpty()) { - return; + if (m_key.isEmpty()) { + return; + } + + m_name = m_key; } + m_name.remove(' '); + KConfigSkeletonItem *item = 0; if (m_type == "bool") {