From 06dc53ab169bd1722ee3cb42b37ae770b4afee15 Mon Sep 17 00:00:00 2001 From: hanshuang Date: Wed, 15 Nov 2023 13:39:32 +0800 Subject: [PATCH] fix dde-polkit-agent compile problem --- 0001-add-setCancel-method.patch | 45 +++++++++++++++++++++++++++++++++ polkit-qt-1.spec | 6 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0001-add-setCancel-method.patch diff --git a/0001-add-setCancel-method.patch b/0001-add-setCancel-method.patch new file mode 100644 index 0000000..27d7139 --- /dev/null +++ b/0001-add-setCancel-method.patch @@ -0,0 +1,45 @@ +From c1871601dd00f87f075e72df7d9f07fd2d85db19 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 7 Nov 2023 15:34:59 +0800 +Subject: [PATCH] add setCancel method + +--- + agent/polkitqt1-agent-session.cpp | 6 ++++++ + agent/polkitqt1-agent-session.h | 4 ++++ + 2 files changed, 10 insertions(+) + +diff --git a/agent/polkitqt1-agent-session.cpp b/agent/polkitqt1-agent-session.cpp +index 7aea332..c76c871 100644 +--- a/agent/polkitqt1-agent-session.cpp ++++ b/agent/polkitqt1-agent-session.cpp +@@ -163,6 +163,12 @@ void AsyncResult::setCompleted() + d->result = NULL; + } + ++void AsyncResult::setCancel(const QString &text) ++{ ++ Q_ASSERT(d->result); ++ g_simple_async_result_set_error(d->result, POLKIT_ERROR, POLKIT_ERROR_CANCELLED, "%s", text.toUtf8().data()); ++} ++ + void AsyncResult::setError(const QString &text) + { + Q_ASSERT(d->result); +diff --git a/agent/polkitqt1-agent-session.h b/agent/polkitqt1-agent-session.h +index 0f763e8..8999bca 100644 +--- a/agent/polkitqt1-agent-session.h ++++ b/agent/polkitqt1-agent-session.h +@@ -55,6 +55,10 @@ public: + * \brief Mark the action that is tied to this result as completed. + */ + void setCompleted(); ++ /** ++ * \brief Mark the action that is tied to this result as cancelled. ++ */ ++ void setCancel(const QString &text); + + /** + * \brief Sets an error for the asynchronous result. +-- +2.27.0 + diff --git a/polkit-qt-1.spec b/polkit-qt-1.spec index f17f82f..944e684 100644 --- a/polkit-qt-1.spec +++ b/polkit-qt-1.spec @@ -1,12 +1,13 @@ Name: polkit-qt-1 Version: 0.113.0 -Release: 3 +Release: 4 Summary: Qt bindings for PolicyKit License: GPLv2+ URL: https://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/ Source0: http://download.kde.org/stable/%{name}/polkit-qt-1-%{version}.tar.xz Source1: macros.polkit-qt +Patch1: 0001-add-setCancel-method.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -95,6 +96,9 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.polkit-qt %changelog +* Wed Nov 15 2023 hanshuang - 0.113.0-4 +- add setCancel method fix dde-polkit-agent compile problem + * Sat Jan 29 2022 herengui - 0.113.0-3 - add rpm macros