diff options
| author | Javier <dev.git@javispedro.com> | 2014-11-30 21:32:13 +0100 |
|---|---|---|
| committer | Javier <dev.git@javispedro.com> | 2014-11-30 21:32:13 +0100 |
| commit | dadca6f0b1e4660876cccb51702998d378a5dc03 (patch) | |
| tree | d445720615174a49ec79dbe5bb3817778a6451df /daemon/appinfo.cpp | |
| parent | 2e0e33bd2d588a96fc471d024de583ec7d287f5e (diff) | |
convert appinfo into a Q_GADGET with properties
Diffstat (limited to 'daemon/appinfo.cpp')
| -rw-r--r-- | daemon/appinfo.cpp | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/daemon/appinfo.cpp b/daemon/appinfo.cpp new file mode 100644 index 0000000..a4442a3 --- /dev/null +++ b/daemon/appinfo.cpp @@ -0,0 +1,142 @@ +#include "appinfo.h" +#include <QSharedData> + +struct AppInfoData : public QSharedData { + QUuid uuid; + QString shortName; + QString longName; + QString companyName; + int versionCode; + QString versionLabel; + bool watchface; + bool jskit; + QHash<QString, int> appKeys; + QString path; +}; + +AppInfo::AppInfo() : d(new AppInfoData) +{ + d->versionCode = 0; + d->watchface = false; + d->jskit = false; +} + +AppInfo::AppInfo(const AppInfo &rhs) : d(rhs.d) +{ +} + +AppInfo &AppInfo::operator=(const AppInfo &rhs) +{ + if (this != &rhs) + d.operator=(rhs.d); + return *this; +} + +AppInfo::~AppInfo() +{ +} + +QUuid AppInfo::uuid() const +{ + return d->uuid; +} + +void AppInfo::setUuid(const QUuid &uuid) +{ + d->uuid = uuid; +} + +QString AppInfo::shortName() const +{ + return d->shortName; +} + +void AppInfo::setShortName(const QString &string) +{ + d->shortName = string; +} + +QString AppInfo::longName() const +{ + return d->longName; +} + +void AppInfo::setLongName(const QString &string) +{ + d->longName = string; +} + +QString AppInfo::companyName() const +{ + return d->companyName; +} + +void AppInfo::setCompanyName(const QString &string) +{ + d->companyName = string; +} + +int AppInfo::versionCode() const +{ + return d->versionCode; +} + +void AppInfo::setVersionCode(int code) +{ + d->versionCode = code; +} + +QString AppInfo::versionLabel() const +{ + return d->versionLabel; +} + +void AppInfo::setVersionLabel(const QString &string) +{ + d->versionLabel = string; +} + +bool AppInfo::isWatchface() const +{ + return d->watchface; +} + +void AppInfo::setWatchface(bool b) +{ + d->watchface = b; +} + +bool AppInfo::isJSKit() const +{ + return d->jskit; +} + +void AppInfo::setJSKit(bool b) +{ + d->jskit = b; +} + +QHash<QString, int> AppInfo::appKeys() const +{ + return d->appKeys; +} + +void AppInfo::setAppKeys(const QHash<QString, int> &appKeys) +{ + d->appKeys = appKeys; +} + +void AppInfo::addAppKey(const QString &key, int value) +{ + d->appKeys.insert(key, value); +} + +QString AppInfo::path() const +{ + return d->path; +} + +void AppInfo::setPath(const QString &string) +{ + d->path = string; +} |
