Skip to content

Commit 5935fb0

Browse files
committed
Various cleanups
1 parent 6b48340 commit 5935fb0

File tree

8 files changed

+25
-16
lines changed

8 files changed

+25
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,6 @@ You can help us find and report bugs, suggest new features, help with translatio
200200
## License
201201

202202
WatchFlower is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
203-
Read the [LICENSE](LICENSE) file or [consult the license on the FSF website](https://www.gnu.org/licenses/gpl-3.0.txt) directly.
203+
Read the [LICENSE](LICENSE.md) file or [consult the license on the FSF website](https://www.gnu.org/licenses/gpl-3.0.txt) directly.
204204

205205
> Emeric Grange <[email protected]>

assets/android/res/values/apptheme.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<style name="AppTheme">
4+
<item name="android:windowFullscreen">true</item>
45
<item name="android:windowBackground">@android:color/white</item>
56
<item name="android:statusBarColor">@android:color/white</item>
67
<item name="android:navigationBarColor">@android:color/white</item>

qml/components/ChartThermometerMinMaxBar.qml

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import ThemeEngine
44
import "qrc:/utils/UtilsNumber.js" as UtilsNumber
55

66
Item {
7-
id: chartThermometerMinMaxBar
7+
id: minMaxBar
8+
89
implicitWidth: 32
910
implicitHeight: 128
1011

1112
property int www: 20
1213

14+
///////////////
15+
1316
Component.onCompleted: {
1417
setTemp()
1518
computeSize()
@@ -76,7 +79,7 @@ Item {
7679
text_temp_low.text = tl.toFixed(1) + "°"
7780
}
7881

79-
////////////////////////////////////////////////////////////////////////////
82+
///////////////
8083

8184
Rectangle {
8285
id: background
@@ -112,7 +115,7 @@ Item {
112115
color: Theme.colorText
113116
}
114117

115-
////////////////////////////////////////////////////////////////////////////
118+
///////////////
116119

117120
Item {
118121
id: containerbar
@@ -242,4 +245,6 @@ Item {
242245
}
243246
}
244247
}
248+
249+
///////////////
245250
}

qml/components/PlantSizeWidget.qml

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ RangeSlider {
2121
color: "#e1e4e9" // Theme.colorForeground
2222

2323
Rectangle {
24+
anchors.top: parent.top
25+
anchors.bottom: parent.bottom
2426
x: (control.first.visualPosition * parent.width)
2527
width: (control.second.visualPosition * parent.width) - x
26-
height: parent.height
2728
radius: 2
2829
color: "#ed5565" // Theme.colorPrimary
2930
}

qml/widgets/DeviceWidget.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ Item {
525525
////
526526

527527
Item {
528-
anchors.verticalCenter: parent.verticalCenter
528+
anchors.top: parent.top
529+
anchors.bottom: parent.bottom
529530
width: parent.height * 0.5
530-
height: parent.height
531531

532532
visible: !boxDevice.hasDataToday
533533

src/DeviceManager_export.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ QString DeviceManager::exportDataOpen()
9696
if (!m_devices_model->hasDevices()) return exportFilePath;
9797

9898
// Get temp directory path
99-
QString exportDirectoryPath = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).value(0);
99+
QString exportDirectoryPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
100100

101101
QDir exportDirectory(exportDirectoryPath + "/export");
102102
if (!exportDirectory.exists()) exportDirectory.mkpath(exportDirectoryPath + "/export");

src/device_environmental.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void DeviceEnvironmental::updateChartData_environmentalVoc(int maxDays)
128128
"FROM sensorData " \
129129
"WHERE deviceAddr = :deviceAddr AND timestamp >= " + datetime_months + " " \
130130
"GROUP BY " + strftime_mid + " " \
131-
"ORDER BY timestamp DESC "
131+
"ORDER BY timestamp DESC " \
132132
"LIMIT :maxDays;");
133133
graphData.bindValue(":deviceAddr", getAddress());
134134
graphData.bindValue(":maxDays", maxDays);

src/device_sensor.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ void DeviceSensor::checkDataAvailability()
980980

981981
if (hasData.exec() == false)
982982
{
983-
qWarning() << "> hasData.exec(1) ERROR" << hasData.lastError().type() << ":" << hasData.lastError().text();
984-
qWarning() << "> hasData.exec(1) >" << hasData.lastQuery();
983+
qWarning() << "> hasData.exec(1) ERROR"
984+
<< hasData.lastError().type() << ":" << hasData.lastError().text();
985985
}
986986

987987
while (hasData.next())
@@ -1060,13 +1060,15 @@ bool DeviceSensor::hasDataNamed(const QString &dataName) const
10601060
if (m_dbInternal || m_dbExternal)
10611061
{
10621062
QSqlQuery hasData;
1063-
hasData.prepare("SELECT COUNT(" + dataName + ") FROM " + tableName + " WHERE deviceAddr = :deviceAddr AND " + dataName + " > 0;");
1063+
hasData.prepare("SELECT COUNT(" + dataName + ") " \
1064+
"FROM " + tableName + " " \
1065+
"WHERE deviceAddr = :deviceAddr AND " + dataName + " > 0;");
10641066
hasData.bindValue(":deviceAddr", getAddress());
10651067

10661068
if (hasData.exec() == false)
10671069
{
1068-
qWarning() << "> hasData.exec(2) ERROR" << hasData.lastError().type() << ":" << hasData.lastError().text();
1069-
qWarning() << "> hasData.exec(2) >" << hasData.lastQuery();
1070+
qWarning() << "> hasData.exec(2) ERROR"
1071+
<< hasData.lastError().type() << ":" << hasData.lastError().text();
10701072
}
10711073

10721074
while (hasData.next())
@@ -1173,8 +1175,8 @@ bool DeviceSensor::hasData() const
11731175

11741176
if (hasData.exec() == false)
11751177
{
1176-
qWarning() << "> hasData.exec(3) ERROR" << hasData.lastError().type() << ":" << hasData.lastError().text();
1177-
qWarning() << "> hasData.exec(3) >" << hasData.lastQuery();
1178+
qWarning() << "> hasData.exec(3) ERROR"
1179+
<< hasData.lastError().type() << ":" << hasData.lastError().text();
11781180
}
11791181

11801182
while (hasData.next())

0 commit comments

Comments
 (0)