Skip to content

Commit ac9ac0b

Browse files
committed
Rename DeviceInfo to DeviceSpecs to remove conflict
This renames the DeviceInfo QML class in org.asteroid.utils to DeviceSpecs to avoid a conflict with an unrelated DeviceInfo class defined in org.nemomobile.systemsettings. This fixes #56 Signed-off-by: Ed Beroset <beroset@ieee.org>
1 parent fb476fd commit ac9ac0b

9 files changed

+28
-28
lines changed

src/controls/qml/Application.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ Application_p {
101101
edge: Qt.RightEdge
102102
visible: false
103103
z: 10
104-
anchors.verticalCenterOffset: DeviceInfo.flatTireHeight/2
104+
anchors.verticalCenterOffset: DeviceSpecs.flatTireHeight/2
105105
}
106106

107107
Indicator {
108108
id: leftIndicator
109109
edge: Qt.LeftEdge
110110
visible: true
111111
z: 10
112-
anchors.verticalCenterOffset: DeviceInfo.flatTireHeight/2
112+
anchors.verticalCenterOffset: DeviceSpecs.flatTireHeight/2
113113
}
114114

115115
Indicator {

src/controls/qml/BorderGestureArea.qml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ import org.asteroid.utils 1.0
110110
MouseArea {
111111
id: root
112112

113-
property int boundary: width*DeviceInfo.borderGestureWidth
113+
property int boundary: width*DeviceSpecs.borderGestureWidth
114114
property bool delayReset
115115

116116
signal gestureStarted(string gesture)

src/controls/qml/Dims.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ QtObject {
7070
\brief Returns a dimension that is \a number percent of the screen height.
7171
*/
7272
function h(number) {
73-
return (number/100)*(Screen.desktopAvailableHeight+DeviceInfo.flatTireHeight)
73+
return (number/100)*(Screen.desktopAvailableHeight+DeviceSpecs.flatTireHeight)
7474
}
7575

7676
/*!
7777
\qmlmethod real l(real number)
7878
\brief Returns a dimension that is \a number percent of the screen width or height; whichever is smaller.
7979
*/
8080
function l(number) {
81-
if(Screen.desktopAvailableWidth > (Screen.desktopAvailableHeight+DeviceInfo.flatTireHeight))
81+
if(Screen.desktopAvailableWidth > (Screen.desktopAvailableHeight+DeviceSpecs.flatTireHeight))
8282
return h(number)
8383
else
8484
return w(number)

src/controls/qml/ListItem.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ Item {
9696
anchors {
9797
verticalCenter: parent.verticalCenter
9898
left: parent.left
99-
leftMargin: DeviceInfo.hasRoundScreen ? Dims.w(18) : Dims.w(12)
99+
leftMargin: DeviceSpecs.hasRoundScreen ? Dims.w(18) : Dims.w(12)
100100
}
101101
}
102102

103103
Label {
104104
id: label
105105

106106
anchors {
107-
leftMargin: DeviceInfo.hasRoundScreen ? Dims.w(6) : Dims.w(10)
107+
leftMargin: DeviceSpecs.hasRoundScreen ? Dims.w(6) : Dims.w(10)
108108
left: icon.right
109109
verticalCenter: parent.verticalCenter
110110
}

src/controls/qml/PageHeader.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Item {
8080
}
8181
verticalAlignment: Text.AlignVCenter
8282
horizontalAlignment: Text.AlignHCenter
83-
leftPadding: DeviceInfo.hasRoundScreen ? Dims.w(25) : 0
84-
rightPadding: DeviceInfo.hasRoundScreen ? Dims.w(25) : 0
83+
leftPadding: DeviceSpecs.hasRoundScreen ? Dims.w(25) : 0
84+
rightPadding: DeviceSpecs.hasRoundScreen ? Dims.w(25) : 0
8585
wrapMode: Text.WordWrap
8686
maximumLineCount: 2
8787
}

src/utils/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
set(SRC
22
src/utils_plugin.cpp
3-
src/deviceinfo.cpp
3+
src/devicespecs.cpp
44
src/fileinfo.cpp
55
src/bluetoothstatus.cpp)
66
set(HEADERS
77
src/utils_plugin.h
8-
src/deviceinfo.h
8+
src/devicespecs.h
99
src/fileinfo.h
1010
src/bluetoothstatus.h)
1111

src/utils/src/deviceinfo.cpp renamed to src/utils/src/devicespecs.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
#include "deviceinfo.h"
18+
#include "devicespecs.h"
1919
#include <QFile>
2020

2121
const char* CONFIG_FILE = "/etc/asteroid/machine.conf";
2222
const char* HOST_FILE = "/etc/hostname";
2323
const char* OS_RELEASE_FILE = "/etc/os-release";
2424

25-
DeviceInfo::DeviceInfo()
25+
DeviceSpecs::DeviceInfo()
2626
: m_settings(CONFIG_FILE, QSettings::IniFormat)
2727
{
2828
QSettings::Status status(m_settings.status());
@@ -57,47 +57,47 @@ DeviceInfo::DeviceInfo()
5757
}
5858
}
5959

60-
bool DeviceInfo::hasRoundScreen()
60+
bool DeviceSpecs::hasRoundScreen()
6161
{
6262
return m_settings.value("Display/ROUND", false).toBool();
6363
}
6464

65-
double DeviceInfo::borderGestureWidth()
65+
double DeviceSpecs::borderGestureWidth()
6666
{
6767
return m_settings.value("Display/BORDER_GESTURE_WIDTH", 0.1).toFloat();
6868
}
6969

70-
int DeviceInfo::flatTireHeight()
70+
int DeviceSpecs::flatTireHeight()
7171
{
7272
return m_settings.value("Display/FLAT_TIRE", 0).toInt();
7373
}
7474

75-
bool DeviceInfo::needsBurnInProtection()
75+
bool DeviceSpecs::needsBurnInProtection()
7676
{
7777
return m_settings.value("Display/NEEDS_BURN_IN_PROTECTION", true).toBool();
7878
}
7979

80-
bool DeviceInfo::hasWlan()
80+
bool DeviceSpecs::hasWlan()
8181
{
8282
return m_settings.value("Capabilities/HAS_WLAN", false).toBool();
8383
}
8484

85-
bool DeviceInfo::hasSpeaker()
85+
bool DeviceSpecs::hasSpeaker()
8686
{
8787
return m_settings.value("Capabilities/HAS_SPEAKER", false).toBool();
8888
}
8989

90-
QString DeviceInfo::hostname() const
90+
QString DeviceSpecs::hostname() const
9191
{
9292
return m_hostname;
9393
}
9494

95-
QString DeviceInfo::machineName() const
95+
QString DeviceSpecs::machineName() const
9696
{
9797
return m_settings.value("Identity/MACHINE", "unknown").toString();
9898
}
9999

100-
QString DeviceInfo::buildID() const
100+
QString DeviceSpecs::buildID() const
101101
{
102102
return m_buildid;
103103
}

src/utils/src/deviceinfo.h renamed to src/utils/src/devicespecs.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#include <QQmlEngine>
2424
#include <QSettings>
2525

26-
class DeviceInfo : public QObject
26+
class DeviceSpecs : public QObject
2727
{
2828
Q_OBJECT
29-
Q_DISABLE_COPY(DeviceInfo)
29+
Q_DISABLE_COPY(DeviceSpecs)
3030
Q_PROPERTY(bool hasRoundScreen READ hasRoundScreen CONSTANT)
3131
Q_PROPERTY(double borderGestureWidth READ borderGestureWidth CONSTANT)
3232
Q_PROPERTY(int flatTireHeight READ flatTireHeight CONSTANT)
@@ -36,14 +36,14 @@ class DeviceInfo : public QObject
3636
Q_PROPERTY(QString hostname READ hostname CONSTANT)
3737
Q_PROPERTY(QString machineName READ machineName CONSTANT)
3838
Q_PROPERTY(QString buildID READ buildID CONSTANT)
39-
DeviceInfo();
39+
DeviceSpecs();
4040
public:
4141
static QObject *qmlInstance(QQmlEngine *engine, QJSEngine *scriptEngine)
4242
{
4343
Q_UNUSED(engine);
4444
Q_UNUSED(scriptEngine);
4545

46-
return new DeviceInfo;
46+
return new DeviceSpecs;
4747
}
4848
bool hasRoundScreen();
4949
double borderGestureWidth();

src/utils/src/utils_plugin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "utils_plugin.h"
1919
#include <QtQml>
2020
#include "bluetoothstatus.h"
21-
#include "deviceinfo.h"
21+
#include "devicespecs.h"
2222
#include "fileinfo.h"
2323

2424
UtilsPlugin::UtilsPlugin(QObject *parent) : QQmlExtensionPlugin(parent)
@@ -29,7 +29,7 @@ void UtilsPlugin::registerTypes(const char *uri)
2929
{
3030
Q_ASSERT(uri == QLatin1String("org.asteroid.utils"));
3131

32-
qmlRegisterSingletonType<DeviceInfo>(uri, 1,0, "DeviceInfo", &DeviceInfo::qmlInstance);
32+
qmlRegisterSingletonType<DeviceSpecs>(uri, 1,0, "DeviceInfo", &DeviceInfo::qmlInstance);
3333
qmlRegisterSingletonType<FileInfo>(uri, 1, 0, "FileInfo", &FileInfo::qmlInstance);
3434
qmlRegisterType<BluetoothStatus>(uri, 1, 0, "BluetoothStatus");
3535
}

0 commit comments

Comments
 (0)