diff --git a/src/blackcore/context_settings_impl.cpp b/src/blackcore/context_settings_impl.cpp index a026a458f..5a584b8dd 100644 --- a/src/blackcore/context_settings_impl.cpp +++ b/src/blackcore/context_settings_impl.cpp @@ -96,4 +96,22 @@ 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()) + { + // 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 diff --git a/src/blackcore/context_settings_impl.h b/src/blackcore/context_settings_impl.h index 4b8c7dad1..4032d1d44 100644 --- a/src/blackcore/context_settings_impl.h +++ b/src/blackcore/context_settings_impl.h @@ -44,6 +44,7 @@ namespace BlackCore const QString &getSettingsDirectory() const { return BlackMisc::Settings::CSettingUtilities::getSettingsDirectory(); } //! \copydoc IContextSettings::value() + virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value) override; public slots: //! \copydoc IContextSettings::getNetworkSettings() @@ -52,8 +53,14 @@ namespace BlackCore //! \copydoc IContextSettings::getHotkeys() 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: friend class CRuntime; diff --git a/src/blackcore/context_settings_proxy.cpp b/src/blackcore/context_settings_proxy.cpp index 706eaf5a9..0e310adb2 100644 --- a/src/blackcore/context_settings_proxy.cpp +++ b/src/blackcore/context_settings_proxy.cpp @@ -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()) - { - // 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 diff --git a/src/blackcore/context_settings_proxy.h b/src/blackcore/context_settings_proxy.h index 5d5ef0512..a2f44b374 100644 --- a/src/blackcore/context_settings_proxy.h +++ b/src/blackcore/context_settings_proxy.h @@ -31,19 +31,6 @@ namespace BlackCore //! \brief Destructor 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: friend class CRuntime; BlackMisc::CGenericDBusInterface *m_dBusInterface; @@ -67,13 +54,9 @@ namespace BlackCore //! \copydoc IContextSettings::getHotkeys() virtual BlackMisc::Hardware::CKeyboardKeyList getHotkeys() const 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. - */ - BlackMisc::CStatusMessageList value(const QString &path, const QString &command, QDBusVariant value, int unifiedBlackMetaType); + //! \copydoc IContextSettings::value + virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value) override; + }; }