fix cinst stuff, not happy

This commit is contained in:
Patrick von Reth 2015-01-22 13:31:50 +01:00
parent cf1d34af11
commit 6e0ac042d0
4 changed files with 15 additions and 2 deletions

View File

@ -67,6 +67,11 @@ SnoreCore *SnorePlugin::snore()
return m_snore.data();
}
const SnoreCore *SnorePlugin::snore() const
{
return m_snore.data();
}
QVariant SnorePlugin::value(const QString &key) const
{
return snore()->settings()->value(normaliseKey(key));
@ -86,7 +91,7 @@ void SnorePlugin::setDefaultValue(const QString &key, const QVariant &value, con
}
}
QString SnorePlugin::normaliseKey(const QString &key)
QString SnorePlugin::normaliseKey(const QString &key) const
{
return QString("%1/%2").arg(m_name, key);
}

View File

@ -52,6 +52,8 @@ public:
virtual bool deinitialize();
bool isInitialized();
SnoreCore *snore();
const SnoreCore *snore() const;
const QString &name() const;
QVariant value(const QString &key) const;
@ -60,7 +62,7 @@ public:
private:
SnorePlugin() {}
QString normaliseKey(const QString &key);
QString normaliseKey(const QString &key) const;
QString m_name;
bool m_initialized;

View File

@ -232,6 +232,11 @@ QSettings *SnoreCore::settings()
return d->m_settings;
}
const QSettings *SnoreCore::settings() const{
Q_D(const SnoreCore);
return d->m_settings;
}
const QHash<QString, QString> &SnoreCore::settingsDescription() const
{
Q_D(const SnoreCore);

View File

@ -167,6 +167,7 @@ public:
* @return a pointer to the global settings
*/
QSettings *settings();
const QSettings *settings() const;
/**
* @return a hashmap containing the documentation of the settings keys.