Changed audio settings to CVariant after merge with master

This commit is contained in:
Klaus Basan
2014-06-09 17:35:37 +02:00
parent c99b340833
commit 61740fab0a
3 changed files with 14 additions and 4 deletions

View File

@@ -158,7 +158,7 @@ namespace BlackMisc
/* /*
* Value * Value
*/ */
BlackMisc::CStatusMessageList CSettingsAudio::value(const QString &path, const QString &command, const QVariant &value, bool &changedFlag) BlackMisc::CStatusMessageList CSettingsAudio::value(const QString &path, const QString &command, const CVariant &value, bool &changedFlag)
{ {
// TODO: This needs to be refactored to a smarter way to delegate commands // TODO: This needs to be refactored to a smarter way to delegate commands
changedFlag = false; changedFlag = false;

View File

@@ -52,7 +52,7 @@ namespace BlackMisc
bool operator !=(const CSettingsAudio &other) const; bool operator !=(const CSettingsAudio &other) const;
//! \copydoc BlackCore::IContextSettings //! \copydoc BlackCore::IContextSettings
virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const QVariant &value, bool &changedFlag); virtual BlackMisc::CStatusMessageList value(const QString &path, const QString &command, const BlackMisc::CVariant &value, bool &changedFlag);
//! \copydoc CValueObject::getValueHash //! \copydoc CValueObject::getValueHash
virtual uint getValueHash() const override; virtual uint getValueHash() const override;

View File

@@ -11,6 +11,7 @@
#define BLACKMISC_VARIANT_H #define BLACKMISC_VARIANT_H
#include <QVariant> #include <QVariant>
#include <QDateTime>
class QDBusArgument; class QDBusArgument;
@@ -104,6 +105,15 @@ namespace BlackMisc
//! Convert this variant to a bool. //! Convert this variant to a bool.
bool toBool() const { return m_v.toBool(); } bool toBool() const { return m_v.toBool(); }
//! Convert this variant to an integer.
int toInt() const { return m_v.toInt(); }
//! Convert this variant to double.
double toDouble() const { return m_v.toDouble(); }
//! Convert this variant to QDateTime.
QDateTime toDateTime() const { return m_v.toDateTime(); }
//! Set the variant to null. //! Set the variant to null.
void clear() { m_v.clear(); } void clear() { m_v.clear(); }