SHA256
1
0
forked from pool/kinfocenter6

Compare commits

...

42 Commits

Author SHA256 Message Date
Ana Guerrero
1032db6e44 Accepting request 1234204 from KDE:Frameworks
Plasma 6.2.5 (forwarded request 1234189 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1234204
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=18
2025-01-03 13:16:10 +00:00
Christophe Marin
5b960576e0 Plasma 6.2.5
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=42
2025-01-01 00:23:07 +00:00
Ana Guerrero
9811977847 Accepting request 1226703 from KDE:Frameworks
Plasma 6.2.4, untested (forwarded request 1226674 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1226703
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=17
2024-11-27 21:05:57 +00:00
Christophe Marin
d67fd7a7dd Plasma 6.2.4, untested
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=40
2024-11-27 00:22:15 +00:00
Ana Guerrero
6fd6e3d303 Accepting request 1221532 from KDE:Frameworks
Plasma 6.2.3 (forwarded request 1221508 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1221532
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=16
2024-11-06 15:50:25 +00:00
Christophe Marin
292428ea93 Plasma 6.2.3
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=38
2024-11-05 17:02:03 +00:00
Ana Guerrero
83e03f802e Accepting request 1217175 from KDE:Frameworks
Plasma 6.2.2 (forwarded request 1217086 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1217175
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=15
2024-10-24 13:40:58 +00:00
Christophe Marin
8784907685 Plasma 6.2.2
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=36
2024-10-23 07:42:47 +00:00
Ana Guerrero
fae10281e0 Accepting request 1208573 from KDE:Frameworks
OBS-URL: https://build.opensuse.org/request/show/1208573
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=14
2024-10-18 13:52:43 +00:00
Christophe Marin
f8298c7b5e - Add patches to fix the memory info page by switching from pkexec
to KAuth:
  * 0001-kcms-pull-dmidecode-helper-into-a-separate-dir.patch
  * 0002-refactor-dmidecode-helper-support-multiple-methods.patch
  * 0003-kcms-memory-use-KAuth-dmidecode-helper.patch

OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=34
2024-10-17 08:46:29 +00:00
Ana Guerrero
2143d8257f Accepting request 1208312 from KDE:Frameworks
Plasma 6.2.1 (forwarded request 1208221 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1208312
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=13
2024-10-16 21:40:28 +00:00
Christophe Marin
508e429528 Plasma 6.2.1
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=32
2024-10-16 07:41:12 +00:00
Ana Guerrero
45fd960f7b Accepting request 1205903 from KDE:Frameworks
Plasma 6.2.0

OBS-URL: https://build.opensuse.org/request/show/1205903
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=12
2024-10-07 19:47:21 +00:00
Christophe Marin
4f4da483dd Plasma 6.2.0 maybe not final tars. K:F publishing already disabled.
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=30
2024-10-06 09:00:03 +00:00
Christophe Marin
8123c26635 Plasma 6.2 beta, try 2
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=29
2024-09-26 10:49:49 +00:00
Ana Guerrero
20c189215d Accepting request 1200004 from KDE:Frameworks
Plasma 6.1.5. sddm-kcm6 needed a patch change. (forwarded request 1199935 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1200004
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=11
2024-09-11 14:54:58 +00:00
Dominique Leuenberger
a5b0db87de Accepting request 1191929 from KDE:Frameworks
Plasma 6.1.4 (forwarded request 1191908 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1191929
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=10
2024-08-08 08:56:02 +00:00
Christophe Marin
262d774734 Plasma 6.1.4
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=25
2024-08-06 19:17:10 +00:00
Ana Guerrero
d640b12663 Accepting request 1187985 from KDE:Frameworks
Plasma 6.1.3 (forwarded request 1187956 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1187985
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=9
2024-07-17 13:13:00 +00:00
Christophe Marin
e9808a504a Plasma 6.1.3
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=23
2024-07-16 17:34:18 +00:00
Ana Guerrero
973b7d7e00 Accepting request 1184992 from KDE:Frameworks
Plasma 6.1.2 (forwarded request 1184925 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1184992
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=8
2024-07-04 14:20:30 +00:00
Christophe Marin
06885aabc7 Plasma 6.1.2
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=21
2024-07-03 06:31:30 +00:00
Ana Guerrero
2890656574 Accepting request 1183363 from KDE:Frameworks
Plasma 6.1.1 (forwarded request 1183337 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1183363
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=7
2024-06-27 13:58:37 +00:00
Christophe Marin
78c85b8c60 Plasma 6.1.1
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=19
2024-06-26 11:06:08 +00:00
Ana Guerrero
1808227a45 Accepting request 1181114 from KDE:Frameworks
Plasma 6.1

OBS-URL: https://build.opensuse.org/request/show/1181114
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=6
2024-06-22 11:21:54 +00:00
Christophe Marin
6c2c36fb61 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=17 2024-06-16 08:49:29 +00:00
Christophe Marin
e02a8f075e OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=16 2024-06-16 08:46:11 +00:00
Christophe Marin
a014462a03 Plasma 6.1 maybe final, somewhat tested. KDE:Frameworks already publish disabled.
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=15
2024-06-16 08:35:30 +00:00
Ana Guerrero
66c42f3e47 Accepting request 1176096 from KDE:Frameworks
Plasma 6.0.5(.1) (forwarded request 1176041 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1176096
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=5
2024-05-27 09:45:40 +00:00
Christophe Marin
9a19407776 Plasma 6.0.5(.1)
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=13
2024-05-23 08:32:33 +00:00
Ana Guerrero
a4a6acb0a4 Accepting request 1168735 from KDE:Frameworks
Plasma 6.0.4(.1) (forwarded request 1168499 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1168735
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=4
2024-04-18 20:11:15 +00:00
Christophe Marin
5ef713f48e Plasma 6.0.4(.1)
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=11
2024-04-18 07:14:38 +00:00
Ana Guerrero
275db9eefc Accepting request 1162420 from KDE:Frameworks
Plasma 6.0.3. The release actually builds this time! (After other distros already found major issues...) (forwarded request 1162359 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1162420
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=3
2024-03-28 12:53:39 +00:00
Christophe Marin
fa2577dfb1 Plasma 6.0.3. The release actually builds this time! (After other distros already found major issues...)
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=9
2024-03-26 22:05:08 +00:00
Ana Guerrero
6ddc806833 Accepting request 1157693 from KDE:Frameworks
Plasma 6.0.2 + libksysguard5-helper upgrade fix + icon upgrade fix + gtk theme fix (forwarded request 1157674 from Vogtinator)

OBS-URL: https://build.opensuse.org/request/show/1157693
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=2
2024-03-14 16:43:15 +00:00
Christophe Marin
5de860c1f4 Plasma 6.0.2 + libksysguard5-helper upgrade fix + icon upgrade fix + gtk theme fix
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=7
2024-03-13 16:58:28 +00:00
Ana Guerrero
cdc87adf0e Accepting request 1155661 from KDE:Frameworks
Plasma 6.0.1

OBS-URL: https://build.opensuse.org/request/show/1155661
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kinfocenter6?expand=0&rev=1
2024-03-11 14:28:29 +00:00
ec7aba9473 Plasma 6.0.1 + some provides
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=5
2024-03-06 15:50:23 +00:00
Luca Beltrame
afd376eb21 More obsoletions + kirigami-addons 1.0.1
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=4
2024-03-05 12:37:49 +00:00
3ad57c7634 Add Provides/Obsoletes to replace plasma 5
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=3
2024-03-05 08:08:03 +00:00
Christophe Marin
d6af5ce121 Plasma 6.0 for now. Prj already publish disabled.
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=2
2024-02-25 12:05:22 +00:00
Luca Beltrame
cce241a791 Plasma 6 RC 2. Still untested...
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/kinfocenter6?expand=0&rev=1
2024-02-07 18:01:31 +00:00
13 changed files with 586 additions and 60 deletions

View File

@ -0,0 +1,73 @@
From 582cbde53cfb9e79182663bfd7c86aa46c0b46eb Mon Sep 17 00:00:00 2001
From: Kristen McWilliam <kmcwilliampublic@gmail.com>
Date: Thu, 29 Aug 2024 15:20:54 -0400
Subject: [PATCH 1/3] kcms: pull dmidecode-helper into a separate dir
This allows us to reuse the helper in other
places, like the memory info kcm.
---
kcms/CMakeLists.txt | 1 +
kcms/about-distro/src/CMakeLists.txt | 2 --
kcms/helpers/CMakeLists.txt | 4 ++++
.../src => helpers}/dmidecode-helper/CMakeLists.txt | 0
.../{about-distro/src => helpers}/dmidecode-helper/helper.cpp | 0
kcms/{about-distro/src => helpers}/dmidecode-helper/helper.h | 0
.../dmidecode-helper/org.kde.kinfocenter.dmidecode.actions | 0
7 files changed, 5 insertions(+), 2 deletions(-)
create mode 100644 kcms/helpers/CMakeLists.txt
rename kcms/{about-distro/src => helpers}/dmidecode-helper/CMakeLists.txt (100%)
rename kcms/{about-distro/src => helpers}/dmidecode-helper/helper.cpp (100%)
rename kcms/{about-distro/src => helpers}/dmidecode-helper/helper.h (100%)
rename kcms/{about-distro/src => helpers}/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions (100%)
diff --git a/kcms/CMakeLists.txt b/kcms/CMakeLists.txt
index f283f477..ce534f40 100644
--- a/kcms/CMakeLists.txt
+++ b/kcms/CMakeLists.txt
@@ -1,3 +1,4 @@
+add_subdirectory(helpers)
add_subdirectory( about-distro )
add_subdirectory(vulkan)
diff --git a/kcms/about-distro/src/CMakeLists.txt b/kcms/about-distro/src/CMakeLists.txt
index fffb24d6..961ac959 100644
--- a/kcms/about-distro/src/CMakeLists.txt
+++ b/kcms/about-distro/src/CMakeLists.txt
@@ -1,8 +1,6 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/Version.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-add_subdirectory(dmidecode-helper)
-
set(kcm_SRCS
CPUEntry.cpp
CPUEntry.h
diff --git a/kcms/helpers/CMakeLists.txt b/kcms/helpers/CMakeLists.txt
new file mode 100644
index 00000000..cbf024bd
--- /dev/null
+++ b/kcms/helpers/CMakeLists.txt
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
+
+add_subdirectory(dmidecode-helper)
diff --git a/kcms/about-distro/src/dmidecode-helper/CMakeLists.txt b/kcms/helpers/dmidecode-helper/CMakeLists.txt
similarity index 100%
rename from kcms/about-distro/src/dmidecode-helper/CMakeLists.txt
rename to kcms/helpers/dmidecode-helper/CMakeLists.txt
diff --git a/kcms/about-distro/src/dmidecode-helper/helper.cpp b/kcms/helpers/dmidecode-helper/helper.cpp
similarity index 100%
rename from kcms/about-distro/src/dmidecode-helper/helper.cpp
rename to kcms/helpers/dmidecode-helper/helper.cpp
diff --git a/kcms/about-distro/src/dmidecode-helper/helper.h b/kcms/helpers/dmidecode-helper/helper.h
similarity index 100%
rename from kcms/about-distro/src/dmidecode-helper/helper.h
rename to kcms/helpers/dmidecode-helper/helper.h
diff --git a/kcms/about-distro/src/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions b/kcms/helpers/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions
similarity index 100%
rename from kcms/about-distro/src/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions
rename to kcms/helpers/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions
--
2.47.0

View File

@ -0,0 +1,150 @@
From e6f449a1aa0bf5b1dceaff13390955bd3d21de9d Mon Sep 17 00:00:00 2001
From: Kristen McWilliam <kmcwilliampublic@gmail.com>
Date: Thu, 5 Sep 2024 13:03:45 -0400
Subject: [PATCH 2/3] refactor(dmidecode-helper): support multiple methods
This allows the helper to extend and support other
types of information, eg. memory information.
---
kcms/helpers/dmidecode-helper/helper.cpp | 60 +++++++++++++++++-------
kcms/helpers/dmidecode-helper/helper.h | 15 ++++++
2 files changed, 58 insertions(+), 17 deletions(-)
diff --git a/kcms/helpers/dmidecode-helper/helper.cpp b/kcms/helpers/dmidecode-helper/helper.cpp
index 396b2d74..e9d068dc 100644
--- a/kcms/helpers/dmidecode-helper/helper.cpp
+++ b/kcms/helpers/dmidecode-helper/helper.cpp
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
// SPDX-FileCopyrightText: 2021-2022 Harald Sitter <sitter@kde.org>
+// SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
#include "helper.h"
@@ -16,16 +17,18 @@ auto make_array(Input &&...args) -> std::array<Output, sizeof...(args)> // NB: w
return {std::forward<Input>(args)...};
}
-KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
+DMIDecodeHelper::DMIDecodeHelper(QObject *parent)
+ : QObject(parent)
{
- Q_UNUSED(args);
-
// PATH is super minimal when invoked through dbus
setenv("PATH", "/usr/sbin:/sbin:/usr/local/sbin", 1);
- const QString dmidecode = QStandardPaths::findExecutable("dmidecode");
- if (dmidecode.isEmpty()) {
- return KAuth::ActionReply::HelperErrorReply();
- }
+
+ m_dmidecodePath = QStandardPaths::findExecutable("dmidecode");
+}
+
+KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
+{
+ Q_UNUSED(args);
// NB: Microsoft also outlines a limited set of DMI values to be required for IOT OEM licensing, as such we
// can rely on the same fields to have sound content . Since this only applies to OEMs we still need to filter
@@ -33,19 +36,20 @@ KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
// https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/license-requirements?view=windows-11#smbios-support
KAuth::ActionReply reply;
- for (const auto &key : {QStringLiteral("system-manufacturer"),
- QStringLiteral("system-product-name"),
- QStringLiteral("system-version"),
- QStringLiteral("system-serial-number")}) {
- QProcess proc;
- proc.start(dmidecode, {QStringLiteral("--string"), key});
- proc.waitForFinished();
- const QByteArray output = proc.readAllStandardOutput().trimmed();
-
- if (output.isEmpty() || proc.error() != QProcess::UnknownError || proc.exitStatus() != QProcess::NormalExit) {
+
+ const auto keys = {QStringLiteral("system-manufacturer"),
+ QStringLiteral("system-product-name"),
+ QStringLiteral("system-version"),
+ QStringLiteral("system-serial-number")};
+
+ for (const auto &key : keys) {
+ auto result = executeDmidecode({QStringLiteral("--string"), key});
+ if (result.failed()) {
continue;
}
+ const auto output = result.data().value("result").toString();
+
// Fairly exhaustive filter list based on a dozen or so samples gathered from reddit and other places.
// These are values that may appear in the DMI system information but aren't really useful.
static const auto dummyData = make_array<QString>(QStringLiteral("system version"),
@@ -59,12 +63,34 @@ KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
QStringLiteral("not specified"),
QStringLiteral("not applicable")
/* may also be empty, but that is filtered above already */);
+
if (std::find(dummyData.cbegin(), dummyData.cend(), output.toLower()) != dummyData.cend()) {
continue;
}
reply.addData(key, output);
}
+
+ return reply;
+}
+
+KAuth::ActionReply DMIDecodeHelper::executeDmidecode(const QStringList &arguments)
+{
+ if (m_dmidecodePath.isEmpty()) {
+ return KAuth::ActionReply::HelperErrorReply();
+ }
+
+ QProcess proc;
+ proc.start(m_dmidecodePath, arguments);
+ proc.waitForFinished();
+ const QByteArray output = proc.readAllStandardOutput().trimmed();
+
+ if (output.isEmpty() || proc.error() != QProcess::UnknownError || proc.exitStatus() != QProcess::NormalExit) {
+ return KAuth::ActionReply::HelperErrorReply();
+ }
+
+ KAuth::ActionReply reply;
+ reply.addData("result", output);
return reply;
}
diff --git a/kcms/helpers/dmidecode-helper/helper.h b/kcms/helpers/dmidecode-helper/helper.h
index dd8fe90d..c1b588e8 100644
--- a/kcms/helpers/dmidecode-helper/helper.h
+++ b/kcms/helpers/dmidecode-helper/helper.h
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
// SPDX-FileCopyrightText: 2021 Harald Sitter <sitter@kde.org>
+// SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
#pragma once
@@ -8,6 +9,20 @@
class DMIDecodeHelper : public QObject
{
Q_OBJECT
+
+public:
+ explicit DMIDecodeHelper(QObject *parent = nullptr);
+
public Q_SLOTS:
KAuth::ActionReply systeminformation(const QVariantMap &args);
+
+private:
+ KAuth::ActionReply executeDmidecode(const QStringList &arguments);
+
+ /**
+ * Path to the dmidecode binary.
+ *
+ * If the binary is not found, this helper will not work.
+ */
+ QString m_dmidecodePath;
};
--
2.47.0

View File

@ -0,0 +1,254 @@
From 375abcd571b991aa1ea8436fad6c7a4d30f62fa1 Mon Sep 17 00:00:00 2001
From: Kristen McWilliam <kmcwilliampublic@gmail.com>
Date: Mon, 14 Oct 2024 15:45:02 -0400
Subject: [PATCH 3/3] kcms/memory: use KAuth dmidecode helper
Refactor to use a KAuth helper to run dmidecode as
root, rather than using the CommandOutputContext.
This means the KCM no longer requires the user to
enter their password to view memory information,
and won't show an obtuse error like before if the
user cancelled the password dialog.
---
kcms/helpers/dmidecode-helper/helper.cpp | 26 ++++++++++
kcms/helpers/dmidecode-helper/helper.h | 5 ++
.../org.kde.kinfocenter.dmidecode.actions | 7 +++
kcms/memory/CMakeLists.txt | 9 +++-
kcms/memory/main.cpp | 48 ++++++++++++++++---
kcms/memory/ui/main.qml | 25 ++++++++--
6 files changed, 108 insertions(+), 12 deletions(-)
diff --git a/kcms/helpers/dmidecode-helper/helper.cpp b/kcms/helpers/dmidecode-helper/helper.cpp
index e9d068dc..11921934 100644
--- a/kcms/helpers/dmidecode-helper/helper.cpp
+++ b/kcms/helpers/dmidecode-helper/helper.cpp
@@ -26,6 +26,24 @@ DMIDecodeHelper::DMIDecodeHelper(QObject *parent)
m_dmidecodePath = QStandardPaths::findExecutable("dmidecode");
}
+KAuth::ActionReply DMIDecodeHelper::memoryinformation(const QVariantMap &args)
+{
+ Q_UNUSED(args);
+
+ KAuth::ActionReply reply;
+ auto result = executeDmidecode({QStringLiteral("--type"), QStringLiteral("17")});
+
+ if (result.failed()) {
+ qWarning() << "DMIDecodeHelper: Unable to get memory information";
+ return KAuth::ActionReply::HelperErrorReply();
+ }
+
+ const QString output = result.data().value("result").toString();
+ reply.addData("memory", output);
+
+ return reply;
+}
+
KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
{
Q_UNUSED(args);
@@ -45,6 +63,8 @@ KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
for (const auto &key : keys) {
auto result = executeDmidecode({QStringLiteral("--string"), key});
if (result.failed()) {
+ qWarning() << "DMIDecodeHelper: Unable to get system information for " << key;
+ // We don't want to fail the entire action if we can't get a single piece of information.
continue;
}
@@ -71,6 +91,12 @@ KAuth::ActionReply DMIDecodeHelper::systeminformation(const QVariantMap &args)
reply.addData(key, output);
}
+ if (reply.data().isEmpty()) {
+ qWarning() << "DMIDecodeHelper: Unable to get system information";
+ // If we didn't get any data, we should fail the action.
+ return KAuth::ActionReply::HelperErrorReply();
+ }
+
return reply;
}
diff --git a/kcms/helpers/dmidecode-helper/helper.h b/kcms/helpers/dmidecode-helper/helper.h
index c1b588e8..805d5fa6 100644
--- a/kcms/helpers/dmidecode-helper/helper.h
+++ b/kcms/helpers/dmidecode-helper/helper.h
@@ -14,6 +14,11 @@ public:
explicit DMIDecodeHelper(QObject *parent = nullptr);
public Q_SLOTS:
+ /**
+ * Retrieves memory (RAM) information from dmidecode.
+ */
+ KAuth::ActionReply memoryinformation(const QVariantMap &args);
+
KAuth::ActionReply systeminformation(const QVariantMap &args);
private:
diff --git a/kcms/helpers/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions b/kcms/helpers/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions
index 66d3aa99..9f0c76f3 100644
--- a/kcms/helpers/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions
+++ b/kcms/helpers/dmidecode-helper/org.kde.kinfocenter.dmidecode.actions
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2021 Harald Sitter <sitter@kde.org>
+# SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
+
[Domain]
Icon=computer
URL=https://www.kde.org
@@ -47,6 +49,11 @@ Name[x-test]=xxDesktop Management Interfacexx
Name[zh_CN]=桌面管理界面 (DMI)
Name[zh_TW]=桌面管理介面
+[org.kde.kinfocenter.dmidecode.memoryinformation]
+Policy=yes
+Name=Memory Information
+Description=Read memory information from system's Desktop Management Interface (DMI)
+
[org.kde.kinfocenter.dmidecode.systeminformation]
Policy=yes
PolicyInactive=yes
diff --git a/kcms/memory/CMakeLists.txt b/kcms/memory/CMakeLists.txt
index 49219ac4..59c93b69 100644
--- a/kcms/memory/CMakeLists.txt
+++ b/kcms/memory/CMakeLists.txt
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2024 Thomas Duckworth <tduck973564@gmail.com>
+# SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
find_package(dmidecode)
set_package_properties(dmidecode PROPERTIES TYPE RUNTIME)
@@ -7,4 +8,10 @@ set_package_properties(dmidecode PROPERTIES TYPE RUNTIME)
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_memory\")
kinfocenter_add_kcm(kcm_memory main.cpp)
-target_link_libraries(kcm_memory PRIVATE KF6::CoreAddons KF6::KCMUtilsQuick KF6::I18n KInfoCenterInternal)
+target_link_libraries(kcm_memory PRIVATE
+ KF6::AuthCore
+ KF6::CoreAddons
+ KF6::KCMUtilsQuick
+ KF6::I18n
+ KInfoCenterInternal
+)
diff --git a/kcms/memory/main.cpp b/kcms/memory/main.cpp
index d2190140..7aab18ce 100644
--- a/kcms/memory/main.cpp
+++ b/kcms/memory/main.cpp
@@ -1,30 +1,64 @@
/*
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
SPDX-FileCopyrightText: 2024 Thomas Duckworth <tduck973564@gmail.com>
+ SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
*/
+#include <KAuth/Action>
+#include <KAuth/ExecuteJob>
+#include <KLocalizedString>
#include <KPluginFactory>
#include <KQuickConfigModule>
-#include "CommandOutputContext.h"
-
class KCMMemory : public KQuickConfigModule
{
Q_OBJECT
- Q_PROPERTY(CommandOutputContext *infoOutputContext READ outputContext CONSTANT FINAL)
+ Q_PROPERTY(QString memoryInformation READ memoryInformation NOTIFY changed)
public:
explicit KCMMemory(QObject *parent, const KPluginMetaData &data)
: KQuickConfigModule(parent, data)
{
- m_outputContext = new CommandOutputContext(QStringLiteral("pkexec"), {"dmidecode", "--type", "17"}, parent);
+ loadData();
}
- CommandOutputContext *outputContext() const
+
+ QString memoryInformation() const
{
- return m_outputContext;
+ return m_memoryInformation;
}
private:
- CommandOutputContext *m_outputContext;
+ Q_SIGNAL void changed();
+
+ /**
+ * The memory information that will be displayed in the KCM.
+ */
+ QString m_memoryInformation;
+
+ /**
+ * Load the memory information from the dmidecode helper.
+ */
+ void loadData()
+ {
+ KAuth::Action action(QStringLiteral("org.kde.kinfocenter.dmidecode.memoryinformation"));
+ action.setHelperId(QStringLiteral("org.kde.kinfocenter.dmidecode"));
+ KAuth::ExecuteJob *job = action.execute();
+
+ connect(job, &KJob::result, this, [this, job]() {
+ if (job->error()) {
+ qWarning() << "Failed to retrieve memory information: " << job->errorString();
+ return;
+ } else {
+ const auto reply = job->data();
+ if (reply.contains("memory")) {
+ m_memoryInformation = reply["memory"].toString();
+ }
+ }
+
+ Q_EMIT changed();
+ });
+
+ job->start();
+ }
};
K_PLUGIN_CLASS_WITH_JSON(KCMMemory, "kcm_memory.json")
diff --git a/kcms/memory/ui/main.qml b/kcms/memory/ui/main.qml
index 0300d619..42fdcbc7 100644
--- a/kcms/memory/ui/main.qml
+++ b/kcms/memory/ui/main.qml
@@ -1,14 +1,31 @@
/*
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
SPDX-FileCopyrightText: 2024 Thomas Duckworth <tduck973564@gmail.com>
+ SPDX-FileCopyrightText: 2024 Kristen McWilliam <kmcwilliampublic@gmail.com>
*/
-import QtQuick 2.5
+import QtQuick 2.15
+import org.kde.kirigami 2.20 as Kirigami
import org.kde.kcmutils as KCM
-import org.kde.kinfocenter.private 1.0 as KInfoCenter
+KCM.SimpleKCM {
+ id: kcm_memory
+ Kirigami.Theme.colorSet: Kirigami.Theme.View
+ Kirigami.Theme.inherit: false
-KInfoCenter.CommandOutputKCM {
- output: kcm.infoOutputContext
+ Kirigami.PlaceholderMessage {
+ anchors.centerIn: parent
+ width: parent.width - (Kirigami.Units.largeSpacing * 8)
+ visible: kcm.memoryInformation === ""
+ icon.name: "data-warning"
+ text: i18ndc("kinfocenter", "@info the KCM has no data to display", "No data available")
+ }
+
+ Kirigami.SelectableLabel {
+ id: text
+ text: kcm.memoryInformation
+ font.family: "monospace"
+ visible: kcm.memoryInformation !== ""
+ }
}
--
2.47.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69c4bebf97c5a980c3da57deedfff628254f03b7c094cca8d742f537bfc45738
size 718828

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmaWVKMACgkQ11dEg7tX
sY3JMQ//Vdl6zMvBjoSN2gQQZK0Cq+lEiZHQsewVQXT9SgiZPrrjyHX0fv2l0Mpp
h8Q+wyQuvgBY5JYOslz5UVp/FdQwIeglWKTQ/SzifOizPsBT4P0brqDJEzcz5BJJ
eZtnzqVMMu2avmdOoBpgNR/oiSu4FSgwsRsSFrKEBTDT7DPE0CUsbTuUEIX5zy4l
iDjc2Nyv5On/O8OCCgN7aMV3Rp0fZtdrJXiqPeP05iY/R/AtBjzr3gk724Rc6T2N
zMHEZQDAsp1uluWhIKL/Wo8mkHdxSuQUk2fefnQ9USVPRb4oB3F2eIteYqzi4lVl
9FA9BptbZfvB9dcd9b8MPBg0ZKQ6ft1KbqdP2pKOBOHHcImaBvAhf8+3zHJL4mNP
AG+kvCfAhfAy1HrZX3w2LaT0H29N85ACgXAEiseUvSW7gRK18DNhTATztVMYF1tV
Nf1PFumtvtVFPhkqYYBAGv/bnTVRXQGVA5uI/4aN/CRN/y6tA3RbvkqHf4aZH/K0
/kK8tLcoy6sNyiPXZ+8N35PUDRrNl8A+6C39RgYznjFr4IVuODXSSmJtnRFm7RZB
c4kBzrylL7wdPHPGjjnADHj7bC7VZo2zxLqD6iHvIVZhknRxKbZsJL96CziFspD0
/4dEIYE6KpR6yjhjZ3qdq/0AmiOcE+DPDEpwZ+mj7RhAvxjukaI=
=H72k
-----END PGP SIGNATURE-----

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:179dfdc224ff66f1d692456560b1c9f0dd74b568e233347182316709ac2520d9
size 718988

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmayGCEACgkQ11dEg7tX
sY0/kw/9HIB8Hbw4Mz0qmz0xmswOKEkoRErJhUR56EhPh0uNFQsvMidUB5ubpHyJ
x4JDX8dvAzT1uPITDfG7fLq9gPRUoJkALLXl4serf61nE5zdWAGVuSgK+NMQFN8t
fHrH/cZfqKMbtszFDO/IDpPj5Kr2Irwdi/bgVkZSrkyaKrznOVkAZp1GIwo79y97
jRet86vZPwmlhSTtmcCeIOgkMz7JkxZ6O0pb+bb7m6cIE2IIITNFWXBv0xgcPsO0
AmqZc4hnR3yf91dFoQp4M2PQZwBmV+MboIRxmvJFkojd3uiqAeXjKllKP/zp/3Gn
KA/U8lbsP0qAzvRrJGn8QZ5L2pWsSdPjiT9hkJ5qFgkNOxM+xZyvGPbAte/yo58i
VDrReeiQKoIcnvworlcZUiEMNai0kRJP+UA6MUhV9vViOB6ZTgRIQ/imukeSJana
+qC8kz6dzcKdzU8b/gu88VKJfTEARjLpAhwx3JqLKKgR6fq3XUfK5AqdELrJV1gc
Asjsix4mFV5QzDQaPwk4k/ye0kV2L45cLue072R3kqGWstWM5hbAh5NjffSIyqPt
Zy+E/f5JxtFh4u3WZRyZPHF9wR66lTe4CzYXCnploFMBz7gA7f+dtyiA5uQ+YdYU
ulTrwTTX0H4RJEADErfZkWMlFOE+eQsn3yCA9uZy9/6uRv78F1A=
=lLoV
-----END PGP SIGNATURE-----

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0976ae43756b6ddbf4e70e750cb17f422dabe7604c5e2f824ab4f1e0161ae5d0
size 720016

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmbgCFQACgkQ11dEg7tX
sY2jxRAAukjAlx7cA4jJNgoqhjKhqjoYTJuhcZPxkwKVqyyGcArtHlciKGndpz/d
2YyoN6HDY9z8tIbwJTgJ2mPNqHnwaT8FPitkA8fO54McoWnfqCUNCVOE56wKYZPq
T3bqlLfO1fipyGsffs+ivTXl1jYWjt8wGSSnVI/a89/HKcn/snqAoTvhlfnzQg5m
SIsxPEXjP9lPuDJtKbvUWHV5ZzlZ8RY/EfeOzIYzypBP9eftqsEgVrZqdSnaiSat
+16ffHMl2CThSJ8y/6yUIAo65MNX+Ikw1oYWjRPhArmUPDpes15r+wdd/gkqWAJi
GfDL5pSwv5A8h+0BF9y0DHLpjAP5TDpja0kyVfGeUFfoSg9mNGWmfux4C5NOjW0D
ul0jalqz0D+PbIE7Q3ft2X65gQaoUfyI4qN49M649UHN04e5Eu15P5Wkbimo/qo2
Js+ESeYvBTkYGiWrGlJ6iSqOJgAM1olmaSw/7smuMYJA7RtRKwk26QOOZmEvzlST
UmrG8Ljto8FKRFuIvLha6vIsvbGjSLcI4Cu9doX3DZ7sw99msB49EUI5GRtM3n37
GWrzHwKswlNrjdUXrJVpbVYc1mHsrghOWGv2pwm73gYyUm3jU7+pHTTc1xcdozw/
4oxAlZyoUTvDPA5432JLObQf+jScjXIOSASzuiZcpdNkMEFmYeE=
=acRA
-----END PGP SIGNATURE-----

3
kinfocenter-6.2.5.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9ed87edb3a24256189f8dc79c821b8f45589aab7032d8dde78d5d94cf0639ff9
size 732392

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmdy7PgACgkQ11dEg7tX
sY3N8hAAsQDSequKrBIJc6JJYxMSimq2LOBRTRMKp4nGDRIXMFzUKMVxjLiQY3DH
IgwGY7o12cxYvRnM3Ub3UEpFyeLfYgGFno9qIntp/cfj7Ef7T13z0a1xKjAXGaZT
5D14BRhRkCspSe6wXQB7Y4tkct16Uag7/Wk7jLb+FIU4VIFU5PiINT59L2YfOp1U
1guzAyiA9J6rbj9317IAMBWq/poHVYr8gqUOjCV3r+KcKzG7AHBHBbjfbwPHcXu4
RBCc7zTISi6/rTD5+5M3G5j5x4AYmHzZS44+TvNt82u17Nl+9yzhRFmSuYgtkojw
7zZ33RLgGkalYGvuQia/MeiUUGyTT4ygitanF+Q+qbYVV9jbnOjzfmLKHGt7MMQ+
gA1trPk2VUoRsxE5IOI+KrvEAuj40DUQKHYkz0ZoKOLpFXsIohguX2zAlq1QfSB3
XeFquIq/MYusgw99AS/A4NWa8Qz/lrM75kE6CdbDfyAXabXrCdj0XpxgqYHJyjVW
7vKD4WeUtp7Vx7frm488SWxCqblRmf0R6j+USpAXCs7MZHQACmw4PBMGZCFbrA0O
AEnoU0JgbjKsOc+jbta263m+qxF1yDol2tzX2w8PagwzgJaAhJNV31P4g6EIW3+g
Izq2PJoS64C9mkAUdSt95IBoc+EbLoRs5DZhkY/WY7wmmzBA6tg=
=BdEQ
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,85 @@
-------------------------------------------------------------------
Tue Dec 31 20:48:49 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.5:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.5
- Changes since 6.2.4:
* update version for new release
-------------------------------------------------------------------
Tue Nov 26 15:45:55 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.4:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.4
- Changes since 6.2.3:
* update version for new release
-------------------------------------------------------------------
Tue Nov 5 13:30:17 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.3:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.3
- Changes since 6.2.2:
* update version for new release
* appiumtests: fix wayland
-------------------------------------------------------------------
Tue Oct 22 14:07:23 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.2:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.2
- Changes since 6.2.1:
* update version for new release
-------------------------------------------------------------------
Thu Oct 17 08:32:43 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Add patches to fix the memory info page by switching from pkexec
to KAuth:
* 0001-kcms-pull-dmidecode-helper-into-a-separate-dir.patch
* 0002-refactor-dmidecode-helper-support-multiple-methods.patch
* 0003-kcms-memory-use-KAuth-dmidecode-helper.patch
-------------------------------------------------------------------
Tue Oct 15 16:53:24 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.1:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.1
- Changes since 6.2.0:
* update version for new release
-------------------------------------------------------------------
Sat Oct 5 10:44:16 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.2.0:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.2.0
- Changes since 6.1.90:
* update version for new release
-------------------------------------------------------------------
Tue Sep 17 14:53:27 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.90:
* New feature release
* For more details see https://kde.org/announcements/plasma/6/6.1.90
- Changes since 6.1.5:
* update version for new release
* Use ECMDeprecationSettings
* kcms: Add memory information KCM
* update version for new release
* remove dup appstream versions
* update version for new release
* appstream versions
* update version for new release
* Drop no longer needed KF6Widgets dependency
* update version for new release
-------------------------------------------------------------------
Tue Sep 10 14:53:42 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -16,8 +16,8 @@
#
%define kf6_version 6.2.0
%define qt6_version 6.6.0
%define kf6_version 6.5.0
%define qt6_version 6.7.0
%define rname kinfocenter
%bcond_without released
@ -26,7 +26,7 @@
# Latest ABI-stable Plasma (e.g. 6.0 in KF6, but 6.0.80 in KUF)
%{!?_plasma6_version: %define _plasma6_version %(echo %{_plasma6_bugfix} | awk -F. '{print $1"."$2}')}
Name: kinfocenter6
Version: 6.1.5
Version: 6.2.5
Release: 0
Summary: Utility that provides information about a computer system
License: GPL-2.0-or-later
@ -36,6 +36,10 @@ Source: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{ver
Source1: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz.sig
Source2: plasma.keyring
%endif
# PATCH-FIX-UPSTREAM
Patch1: 0001-kcms-pull-dmidecode-helper-into-a-separate-dir.patch
Patch2: 0002-refactor-dmidecode-helper-support-multiple-methods.patch
Patch3: 0003-kcms-memory-use-KAuth-dmidecode-helper.patch
# PATCH-FIX-OPENSUSE
Patch100: 0002-Look-for-binaries-in-Mesa-demos-path-as-well.patch
BuildRequires: kf6-extra-cmake-modules >= %{kf6_version}
@ -121,6 +125,7 @@ KDE Utility that provides information about a computer system.
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_glx.so
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_interrupts.so
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_kwinsupportinfo.so
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_memory.so
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_network.so
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_opencl.so
%{_kf6_plugindir}/plasma/kcms/kinfocenter/kcm_pci.so