Skip to content

Commit 08d08f6

Browse files
authored
Merge pull request #195 from saeugetier/181-date-selector-in-qt6
remove ability to set the time
2 parents 32025f2 + 1548f80 commit 08d08f6

7 files changed

Lines changed: 0 additions & 209 deletions

File tree

qml.qrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
<file>images/StarsBackground.jpg</file>
5353
<file>images/RedBorder.png</file>
5454
<file>images/icon/FourBorder.svg</file>
55-
<file>qml/TimeSettings.qml</file>
56-
<file>qml/TimeSettingsForm.ui.qml</file>
5755
<file>shaders/sepia.frag</file>
5856
<file>shaders/vignette.frag</file>
5957
<file>shaders/blueseeker.frag</file>

qml/SettingsPopup.qml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,4 @@ SettingsPopupForm {
132132
labelTime.text = qsTr("Time: ") + dateString;
133133
}
134134
}
135-
136-
buttonSetTime.onClicked:
137-
{
138-
timeSettings.open()
139-
}
140-
141-
142-
TimeSettings
143-
{
144-
id: timeSettings
145-
146-
onSetTime:
147-
{
148-
system.setTime(time)
149-
}
150-
}
151-
152135
}

qml/SettingsPopupForm.ui.qml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Popup {
2121
property alias switchPrinter: switchPrinter
2222
property alias switchPrintFromGallery: switchPrintFromGallery
2323
property alias buttonCopyPhotos: buttonCopyPhotos
24-
property alias buttonSetTime: buttonSetTime
2524
property alias switchMirrorCamera: switchMirrorCamera
2625
property alias comboBoxPrinter: comboBoxPrinter
2726
property alias comboBoxCamera: comboBoxCamera
@@ -282,12 +281,6 @@ Popup {
282281
Label {
283282
id: labelTime
284283
text: qsTr("Current time")
285-
anchors.verticalCenter: buttonSetTime.verticalCenter
286-
}
287-
288-
Button {
289-
id: buttonSetTime
290-
text: qsTr("Set time")
291284
}
292285
}
293286

qml/TimeSettings.qml

Lines changed: 0 additions & 75 deletions
This file was deleted.

qml/TimeSettingsForm.ui.qml

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/system.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,6 @@ void System::restart()
1919
process.startDetached("reboot");
2020
}
2121

22-
bool System::setTime(QDateTime date)
23-
{
24-
int result = -1;
25-
26-
qDebug() << "Set Time " << date.toString("yyyy-MM-dd hh::mm::ss");
27-
#ifdef __linux__
28-
QProcess process;
29-
QStringList arguments;
30-
arguments.append("-s");
31-
arguments.append(date.toString("yyyy-MM-dd hh:mm:ss"));
32-
process.start("date", arguments);
33-
process.waitForFinished();
34-
result = process.exitCode();
35-
if(result != 0)
36-
{
37-
qDebug() << "Setting time failed. Exit code: " << result;
38-
qDebug() << process.readAllStandardOutput() << "\n" << process.readAllStandardError() << "\n" << process.errorString();
39-
}
40-
else
41-
{
42-
process.start("hwclock -w");
43-
process.waitForFinished();
44-
result = process.exitCode();
45-
if(result != 0)
46-
{
47-
qDebug() << "Writing clock to hwclock failed with exit code:" << result;
48-
qDebug() << process.readAllStandardOutput() << "\n" << process.readAllStandardError() << "\n" << process.errorString();
49-
}
50-
}
51-
#elif __APPLE__
52-
#pragma message ( "setting the time is not implemented for MacOS" )
53-
#elif _WIN32
54-
#pragma message ( "setting the time is not implemented for Windows" )
55-
#endif
56-
return (result == 0);
57-
}
58-
5922
QString System::getGitHash() const
6023
{
6124
return QString(QT_STRINGIFY(GIT_CURRENT_SHA1));

src/system.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define SYSTEM_H
33

44
#include <QObject>
5-
#include <QDate>
65

76
class System : public QObject
87
{
@@ -11,7 +10,6 @@ class System : public QObject
1110
System();
1211
Q_INVOKABLE void shutdown();
1312
Q_INVOKABLE void restart();
14-
Q_INVOKABLE bool setTime(QDateTime date);
1513
Q_INVOKABLE QString getGitHash() const;
1614
};
1715

0 commit comments

Comments
 (0)