This repository was archived by the owner on Apr 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ class DeviceInfoPrivate
43
43
44
44
QSet<DeviceInfo::Feature> m_features;
45
45
QSet<Qt::Key> m_keys;
46
+ QString m_model;
47
+ QString m_baseModel;
48
+ QString m_designation;
49
+ QString m_manufacturer;
50
+ QString m_prettyName;
46
51
};
47
52
48
53
DeviceInfoPrivate::DeviceInfoPrivate ()
@@ -65,6 +70,13 @@ DeviceInfoPrivate::DeviceInfoPrivate()
65
70
free (keys);
66
71
}
67
72
73
+ /* Note: These queries always return non-null C string */
74
+ m_model = ssusysinfo_device_model (si);
75
+ m_baseModel = ssusysinfo_device_base_model (si);
76
+ m_designation = ssusysinfo_device_designation (si);
77
+ m_manufacturer = ssusysinfo_device_manufacturer (si);
78
+ m_prettyName = ssusysinfo_device_pretty_name (si);
79
+
68
80
ssusysinfo_delete (si);
69
81
}
70
82
@@ -95,3 +107,33 @@ bool DeviceInfo::hasHardwareKey(Qt::Key key) const
95
107
Q_D (const DeviceInfo);
96
108
return d->m_keys .contains (key);
97
109
}
110
+
111
+ QString DeviceInfo::model () const
112
+ {
113
+ Q_D (const DeviceInfo);
114
+ return d->m_model ;
115
+ }
116
+
117
+ QString DeviceInfo::baseModel () const
118
+ {
119
+ Q_D (const DeviceInfo);
120
+ return d->m_baseModel ;
121
+ }
122
+
123
+ QString DeviceInfo::designation () const
124
+ {
125
+ Q_D (const DeviceInfo);
126
+ return d->m_designation ;
127
+ }
128
+
129
+ QString DeviceInfo::manufacturer () const
130
+ {
131
+ Q_D (const DeviceInfo);
132
+ return d->m_manufacturer ;
133
+ }
134
+
135
+ QString DeviceInfo::prettyName () const
136
+ {
137
+ Q_D (const DeviceInfo);
138
+ return d->m_prettyName ;
139
+ }
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ class DeviceInfoPrivate;
43
43
class SYSTEMSETTINGS_EXPORT DeviceInfo: public QObject
44
44
{
45
45
Q_OBJECT
46
+ Q_PROPERTY (QString model READ model CONSTANT)
47
+ Q_PROPERTY (QString baseModel READ baseModel CONSTANT)
48
+ Q_PROPERTY (QString designation READ designation CONSTANT)
49
+ Q_PROPERTY (QString manufacturer READ manufacturer CONSTANT)
50
+ Q_PROPERTY (QString prettyName READ prettyName CONSTANT)
46
51
47
52
public:
48
53
enum Feature {
@@ -100,6 +105,12 @@ class SYSTEMSETTINGS_EXPORT DeviceInfo: public QObject
100
105
Q_INVOKABLE bool hasFeature (DeviceInfo::Feature feature) const ;
101
106
Q_INVOKABLE bool hasHardwareKey (Qt::Key key) const ;
102
107
108
+ QString model () const ;
109
+ QString baseModel () const ;
110
+ QString designation () const ;
111
+ QString manufacturer () const ;
112
+ QString prettyName () const ;
113
+
103
114
private:
104
115
105
116
DeviceInfoPrivate *d_ptr;
You can’t perform that action at this time.
0 commit comments