Commit 51fb280b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Remove prefix code from Persistentsettings.

Reviewed-by: dt
parent f923a561
......@@ -46,9 +46,8 @@ PersistentSettingsReader::PersistentSettingsReader()
QVariant PersistentSettingsReader::restoreValue(const QString & variable) const
{
const QString &name = m_prefix + variable;
if (m_valueMap.contains(name))
return m_valueMap.value(name);
if (m_valueMap.contains(variable))
return m_valueMap.value(variable);
return QVariant();
}
......@@ -83,16 +82,6 @@ bool PersistentSettingsReader::load(const QString & fileName)
return true;
}
void PersistentSettingsReader::setPrefix(const QString &prefix)
{
m_prefix = prefix;
}
QString PersistentSettingsReader::prefix() const
{
return m_prefix;
}
QVariant PersistentSettingsReader::readValue(const QDomElement &valElement) const
{
QString name = valElement.nodeName();
......@@ -184,7 +173,7 @@ void PersistentSettingsWriter::writeValue(QDomElement &ps, const QVariant &varia
void PersistentSettingsWriter::saveValue(const QString & variable, const QVariant &value)
{
m_valueMap[m_prefix + variable] = value;
m_valueMap[variable] = value;
}
bool PersistentSettingsWriter::save(const QString & fileName, const QString & docType)
......@@ -216,13 +205,3 @@ bool PersistentSettingsWriter::save(const QString & fileName, const QString & do
file.close();
return true;
}
void PersistentSettingsWriter::setPrefix(const QString &prefix)
{
m_prefix = prefix;
}
QString PersistentSettingsWriter::prefix() const
{
return m_prefix;
}
......@@ -48,10 +48,8 @@ public:
QVariant restoreValue(const QString & variable) const;
QVariantMap restoreValues() const;
bool load(const QString & fileName);
void setPrefix(const QString &prefix);
QString prefix() const;
private:
QString m_prefix;
QVariant readValue(const QDomElement &valElement) const;
void readValues(const QDomElement &data);
QMap<QString, QVariant> m_valueMap;
......@@ -63,10 +61,8 @@ public:
PersistentSettingsWriter();
void saveValue(const QString & variable, const QVariant &value);
bool save(const QString & fileName, const QString & docType);
void setPrefix(const QString &prefix);
QString prefix() const;
private:
QString m_prefix;
void writeValue(QDomElement &ps, const QVariant &value);
QMap<QString, QVariant> m_valueMap;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment