refs #116 demonstrate CVariant by using it in the settings context

This commit is contained in:
Mathew Sutcliffe
2014-05-16 19:45:55 +01:00
parent 2726a7a09a
commit 1b82536913
7 changed files with 18 additions and 43 deletions

View File

@@ -171,7 +171,7 @@ namespace BlackCore
/*
* Pass value
*/
BlackMisc::CStatusMessageList CContextSettings::value(const QString &path, const QString &command, const QVariant &value)
BlackMisc::CStatusMessageList CContextSettings::value(const QString &path, const QString &command, const BlackMisc::CVariant &value)
{
Q_ASSERT(path.length() > 3);
Q_ASSERT(path.indexOf('/') >= 0);
@@ -212,21 +212,4 @@ namespace BlackCore
return msgs;
}
/*
* DBus version of value
*/
BlackMisc::CStatusMessageList CContextSettings::value(const QString &path, const QString &command, QDBusVariant value, int unifiedBlackMetaType)
{
QVariant qv = value.variant();
if (qv.canConvert<QDBusArgument>())
{
// convert from QDBusArgument
int type = BlackMisc::firstBlackMetaType() + unifiedBlackMetaType; // unify
qv = BlackMisc::fixQVariantFromDbusArgument(qv, type);
}
// when called locally, this will call the virtual method
// of the concrete implementation in context_settings
return this->value(path, command, qv);
}
} // namespace