mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
refs #199 , refs #85 Moved specialized value method into right place (impl, not proxy - it is a receiver method)
This specialized method can be removed with refs #116
This commit is contained in:
@@ -96,4 +96,22 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
return msgs;
|
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
|
} // namespace
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace BlackCore
|
|||||||
const QString &getSettingsDirectory() const { return BlackMisc::Settings::CSettingUtilities::getSettingsDirectory(); }
|
const QString &getSettingsDirectory() const { return BlackMisc::Settings::CSettingUtilities::getSettingsDirectory(); }
|
||||||
|
|
||||||
//! \copydoc IContextSettings::value()
|
//! \copydoc IContextSettings::value()
|
||||||
|
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value) override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! \copydoc IContextSettings::getNetworkSettings()
|
//! \copydoc IContextSettings::getNetworkSettings()
|
||||||
@@ -52,8 +53,14 @@ namespace BlackCore
|
|||||||
//! \copydoc IContextSettings::getHotkeys()
|
//! \copydoc IContextSettings::getHotkeys()
|
||||||
virtual BlackMisc::Hardware::CKeyboardKeyList getHotkeys() const override;
|
virtual BlackMisc::Hardware::CKeyboardKeyList getHotkeys() const override;
|
||||||
|
|
||||||
//! \copydoc IContextSettings::value()
|
/*!
|
||||||
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value) override;
|
* \brief DBus version of value method.
|
||||||
|
* \remarks Basically an unwanted signature as this is different from the "local" signature and
|
||||||
|
* contains explicit DBus types (a: QDbusArgument, b: type for conversion).
|
||||||
|
* If this can be removed, fine. -> https://dev.vatsim-germany.org/issues/116
|
||||||
|
*/
|
||||||
|
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, QDBusVariant value, int unifiedBlackMetaType);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class CRuntime;
|
friend class CRuntime;
|
||||||
|
|||||||
@@ -65,20 +65,8 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DBus version of value
|
|
||||||
*/
|
*/
|
||||||
BlackMisc::CStatusMessageList CContextSettingsProxy::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
|
} // namespace
|
||||||
|
|||||||
@@ -31,19 +31,6 @@ namespace BlackCore
|
|||||||
//! \brief Destructor
|
//! \brief Destructor
|
||||||
virtual ~CContextSettingsProxy() {}
|
virtual ~CContextSettingsProxy() {}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Handle value
|
|
||||||
* \param path where value belongs to
|
|
||||||
* \param command what to do with value
|
|
||||||
* \param value
|
|
||||||
* \return messages generated during handling
|
|
||||||
* \remarks Do not make this a slot, no DBus XML signature shall be created. The QVariant
|
|
||||||
* will be send a tailored value method using QDBusVariant
|
|
||||||
* @see value(const QString &, const QString &, QDBusVariant, int)
|
|
||||||
*/
|
|
||||||
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class CRuntime;
|
friend class CRuntime;
|
||||||
BlackMisc::CGenericDBusInterface *m_dBusInterface;
|
BlackMisc::CGenericDBusInterface *m_dBusInterface;
|
||||||
@@ -67,13 +54,9 @@ namespace BlackCore
|
|||||||
//! \copydoc IContextSettings::getHotkeys()
|
//! \copydoc IContextSettings::getHotkeys()
|
||||||
virtual BlackMisc::Hardware::CKeyboardKeyList getHotkeys() const override;
|
virtual BlackMisc::Hardware::CKeyboardKeyList getHotkeys() const override;
|
||||||
|
|
||||||
/*!
|
//! \copydoc IContextSettings::value
|
||||||
* \brief DBus version of value method.
|
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value) override;
|
||||||
* \remarks Basically an unwanted signature as this is different from the "local" signature and
|
|
||||||
* contains explicit DBus types (a: QDbusArgument, b: type for conversion).
|
|
||||||
* If this can be removed, fine.
|
|
||||||
*/
|
|
||||||
BlackMisc::CStatusMessageList value(const QString &path, const QString &command, QDBusVariant value, int unifiedBlackMetaType);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user