File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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>
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff 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-
5922QString System::getGitHash () const
6023{
6124 return QString (QT_STRINGIFY (GIT_CURRENT_SHA1));
Original file line number Diff line number Diff line change 22#define SYSTEM_H
33
44#include < QObject>
5- #include < QDate>
65
76class 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
You can’t perform that action at this time.
0 commit comments