aboutsummaryrefslogtreecommitdiff
path: root/system/lxqt-admin/code-improvements.patch
diff options
context:
space:
mode:
authorIsaac Yu <isaacyu@protonmail.com>2024-07-21 21:20:23 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-07-22 06:28:34 +0700
commitb8779ef9a57d82a9e10ccac79a3f170ac8b13c67 (patch)
tree50996db49614f82a9301c8fe9c29f43473544936 /system/lxqt-admin/code-improvements.patch
parent7d9fbc2daef1c9f5cd101ab8b76668701bdfdf47 (diff)
system/lxqt-admin: Added (LXQt system administration tool).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/lxqt-admin/code-improvements.patch')
-rw-r--r--system/lxqt-admin/code-improvements.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/system/lxqt-admin/code-improvements.patch b/system/lxqt-admin/code-improvements.patch
new file mode 100644
index 0000000000..138d35ed00
--- /dev/null
+++ b/system/lxqt-admin/code-improvements.patch
@@ -0,0 +1,77 @@
+--- a/lxqt-admin-time/fbsdtimedatectl.cpp
++++ b/lxqt-admin-time/fbsdtimedatectl.cpp
+@@ -46,11 +46,12 @@
+ QString FBSDTimeDateCtl::timeZone() const
+ {
+ QFile tzFile(QSL("/var/db/zoneinfo"));
+- if (!tzFile.open(QFile::ReadOnly | QFile::Text)) return QSL("Unknown");
+- QTextStream in(&tzFile);
+- QString lastTZone = in.readLine();
+- return lastTZone;
++ if (!tzFile.open(QFile::ReadOnly | QFile::Text))
++ return QSL("Unknown");
+
++ QTextStream in(&tzFile);
++ QString lastTZone = in.readLine();
++ return lastTZone;
+ }
+
+ bool FBSDTimeDateCtl::setTimeZone(QString timeZone, QString& /*errorMessage*/)
+@@ -76,8 +77,7 @@
+ process.waitForFinished(-1);
+ QString t = QString::fromLatin1(process.readAllStandardOutput());
+ QStringList o = t.split(QSL("\n"));
+- for (QStringList::iterator it = o.begin();
+- it != o.end(); ++it) {
++ for (QStringList::iterator it = o.begin(); it != o.end(); ++it) {
+ QString current = *it;
+ if(!current.startsWith(QSL("#")) && current.contains(QSL("ntpd_enable"),Qt::CaseInsensitive) && current.contains(QSL("yes"),Qt::CaseInsensitive)) {
+ return true;
+--- a/lxqt-admin-time/nosdtimedatectl.cpp
++++ b/lxqt-admin-time/nosdtimedatectl.cpp
+@@ -46,10 +46,12 @@
+ QString NOSDTimeDateCtl::timeZone() const
+ {
+ QFile tzFile(QSL("/etc/timezone"));
+- if (!tzFile.open(QFile::ReadOnly | QFile::Text)) return QSL("Unknown");
+- QTextStream in(&tzFile);
+- QString lastTZone = in.readLine();
+- return lastTZone;
++ if (!tzFile.open(QFile::ReadOnly | QFile::Text))
++ return QSL("Unknown");
++
++ QTextStream in(&tzFile);
++ QString lastTZone = in.readLine();
++ return lastTZone;
+ }
+
+ bool NOSDTimeDateCtl::setTimeZone(QString timeZone, QString& /*errorMessage*/)
+@@ -99,18 +101,19 @@
+ {
+ QFile tzFile(QSL("/etc/sysconfig/clock"));
+ if (!tzFile.open(QFile::ReadOnly | QFile::Text))
+- return false;
++ return false;
++
+ QTextStream in(&tzFile);
+ QString all = in.readAll();
+ QStringList sl = all.split(QSL("\n"));
+- for (QStringList::iterator it = sl.begin(); it != sl.end(); it++) {
+- QString current = *it;
+- if(current.startsWith(QSL("#")))
+- continue;
+- if(current.startsWith(QSL("UTC=1")) || current.startsWith(QSL("UTC=true")))
+- return false;
+- if(current.startsWith(QSL("UTC=0")) || current.startsWith(QSL("UTC=false")))
+- return true;
++ for (QStringList::iterator it = sl.begin(); it != sl.end(); ++it) {
++ QString current = *it;
++ if(current.startsWith(QSL("#")))
++ continue;
++ if(current.startsWith(QSL("UTC=1")) || current.startsWith(QSL("UTC=true")))
++ return false;
++ if(current.startsWith(QSL("UTC=0")) || current.startsWith(QSL("UTC=false")))
++ return true;
+ }
+ return false;
+ }