mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #116 demonstrate CVariant by using it in the settings context
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user