From dde0bcc868bf77a00225a05ad30eeb38a1003648 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 13 Apr 2014 23:41:48 +0200 Subject: [PATCH] added a ctor to autogenerate an id --- libguh/plugin/devicedescriptor.cpp | 12 +++++++++++- libguh/plugin/devicedescriptor.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libguh/plugin/devicedescriptor.cpp b/libguh/plugin/devicedescriptor.cpp index 70523938..34bd3a86 100644 --- a/libguh/plugin/devicedescriptor.cpp +++ b/libguh/plugin/devicedescriptor.cpp @@ -1,6 +1,16 @@ #include "devicedescriptor.h" -DeviceDescriptor::DeviceDescriptor() +DeviceDescriptor::DeviceDescriptor(): + m_id(DeviceDescriptorId::createDeviceDescriptorId()) +{ + +} + +DeviceDescriptor::DeviceDescriptor(const DeviceClassId &deviceClassId, const QString &title, const QString &description): + m_id(DeviceDescriptorId::createDeviceDescriptorId()), + m_deviceClassId(deviceClassId), + m_title(title), + m_description(description) { } diff --git a/libguh/plugin/devicedescriptor.h b/libguh/plugin/devicedescriptor.h index 08d42e7e..ab239d7b 100644 --- a/libguh/plugin/devicedescriptor.h +++ b/libguh/plugin/devicedescriptor.h @@ -9,6 +9,7 @@ class DeviceDescriptor { public: DeviceDescriptor(); + DeviceDescriptor(const DeviceClassId &deviceClassId, const QString &title = QString(), const QString &description = QString()); DeviceDescriptor(const DeviceDescriptorId &id, const DeviceClassId &deviceClassId, const QString &title = QString(), const QString &description = QString()); bool isValid() const;