mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
refs #415, mixin style lists
This commit is contained in:
@@ -39,12 +39,5 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
void CAudioDeviceInfoList::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CAudioDeviceInfoList>();
|
||||
qDBusRegisterMetaType<CAudioDeviceInfoList>();
|
||||
registerMetaValueType<CAudioDeviceInfoList>();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -25,9 +25,13 @@ namespace BlackMisc
|
||||
namespace Audio
|
||||
{
|
||||
//! Value object encapsulating a list of audio devices.
|
||||
class BLACKMISC_EXPORT CAudioDeviceInfoList : public CSequence<CAudioDeviceInfo>
|
||||
class BLACKMISC_EXPORT CAudioDeviceInfoList :
|
||||
public CSequence<CAudioDeviceInfo>,
|
||||
public BlackMisc::Mixin::MetaType<CAudioDeviceInfoList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAudioDeviceInfoList)
|
||||
|
||||
//! Default constructor.
|
||||
CAudioDeviceInfoList();
|
||||
|
||||
@@ -42,15 +46,6 @@ namespace BlackMisc
|
||||
|
||||
//! Count (as of type)
|
||||
int count(CAudioDeviceInfo::DeviceType type) const;
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
QVariant toQVariant() const { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::convertFromQVariant
|
||||
void convertFromQVariant(const QVariant &variant) { BlackMisc::setFromQVariant(this, variant); }
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
};
|
||||
|
||||
} //namespace
|
||||
|
||||
@@ -21,13 +21,6 @@ namespace BlackMisc
|
||||
CSequence(other)
|
||||
{ }
|
||||
|
||||
void CVoiceRoomList::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<CVoiceRoomList>();
|
||||
qDBusRegisterMetaType<CVoiceRoomList>();
|
||||
registerMetaValueType<CVoiceRoomList>();
|
||||
}
|
||||
|
||||
const CVoiceRoomList &CVoiceRoomList::twoEmptyRooms()
|
||||
{
|
||||
static CVoiceRoomList emptyRooms;
|
||||
|
||||
@@ -24,27 +24,20 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Audio
|
||||
{
|
||||
/*!
|
||||
* Value object encapsulating a list of voice rooms.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CVoiceRoomList : public CSequence<CVoiceRoom>
|
||||
//! Value object encapsulating a list of voice rooms.
|
||||
class BLACKMISC_EXPORT CVoiceRoomList :
|
||||
public CSequence<CVoiceRoom>,
|
||||
public BlackMisc::Mixin::MetaType<CVoiceRoomList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CVoiceRoomList)
|
||||
|
||||
//! Default constructor.
|
||||
CVoiceRoomList();
|
||||
|
||||
//! Construct from a base class object.
|
||||
CVoiceRoomList(const CSequence &other);
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
QVariant toQVariant() const { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::convertFromQVariant
|
||||
void convertFromQVariant(const QVariant &variant) { BlackMisc::setFromQVariant(this, variant); }
|
||||
|
||||
//! \brief Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! Frequently needed for voice room resolutions
|
||||
static const CVoiceRoomList &twoEmptyRooms();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user