Debian Codegraph @

src/apps.cpp

raw symbols SCIP
1 // Copyright (C) 2014 Sacha Refshauge
2
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 3.0.
6
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License 3.0 for more details.
11
12 // A copy of the GPL 3.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
14
15 // Official GIT repository and contact information can be found at
16 // http://github.com/xsacha/Sachesi
17
18 #include "apps.h"
19
20 #define SET_QML2(type, name, caps) \
21 type Apps::name() const { \
22 return _ ## name; \
23 } \
24 void Apps::caps(const type &var) { \
25 if (var != _ ## name) { \
26 _ ## name = var; \
27 emit name ## Changed(); \
28 } \
29 }
30
31 Apps::Apps(QObject *parent)
32 : QObject(parent)
33 , _name(""), _url(""), _friendlyName(""), _packageId("")
34 , _code(0), _size(0)
35 , _isMarked(false), _isAvailable(true), _isInstalled(false)
36 , _type("")
37 , _installedVersion(""), _version(""), _versionId("")
38 , _checksum("")
39 { }
40
41 Apps::Apps(const Apps* app, QObject *parent)
42 : QObject(parent)
43 , _name(app->name()), _url(app->url()), _friendlyName(app->friendlyName()), _packageId(app->packageId())
44 , _code(app->code()), _size(app->size())
45 , _isMarked(app->isMarked()), _isAvailable(app->isAvailable()), _isInstalled(app->isInstalled())
46 , _type(app->type())
47 , _installedVersion(app->installedVersion()), _version(app->version()), _versionId(app->versionId())
48 , _checksum(app->checksum())
49 { }
50
51 SET_QML2(QString, name, setName)
52 SET_QML2(QString, url, setUrl)
53 SET_QML2(QString, friendlyName, setFriendlyName)
54 SET_QML2(QString, packageId, setPackageId)
55 SET_QML2(int, code, setCode)
56 SET_QML2(int, size, setSize)
57 SET_QML2(bool, isMarked, setIsMarked)
58 SET_QML2(bool, isAvailable, setIsAvailable)
59 SET_QML2(bool, isInstalled, setIsInstalled)
60 SET_QML2(QString, type, setType)
61 SET_QML2(QString, installedVersion, setInstalledVersion)
62 SET_QML2(QString, version, setVersion)
63 SET_QML2(QString, versionId, setVersionId)
64 SET_QML2(QString, checksum, setChecksum)