add setCancel method and modify URL
(cherry picked from commit 0642075e4790ae1e66f7877df022eb7d24e7f3c7)
This commit is contained in:
parent
43e79ac3d9
commit
beb453508a
46
0001-add-setCancel-method.patch
Normal file
46
0001-add-setCancel-method.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
From a029a2c04e6bb51c1e9591ddcc44ce736ac969b0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: loong_C <loong_c@yeah.net>
|
||||||
|
Date: Thu, 21 Jul 2022 10:31:44 +0800
|
||||||
|
Subject: [PATCH] add setCancel method
|
||||||
|
|
||||||
|
---
|
||||||
|
agent/polkitqt1-agent-session.cpp | 6 ++++++
|
||||||
|
agent/polkitqt1-agent-session.h | 5 +++++
|
||||||
|
2 files changed, 11 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/agent/polkitqt1-agent-session.cpp b/agent/polkitqt1-agent-session.cpp
|
||||||
|
index e70ace0..6092fa4 100644
|
||||||
|
--- a/agent/polkitqt1-agent-session.cpp
|
||||||
|
+++ b/agent/polkitqt1-agent-session.cpp
|
||||||
|
@@ -150,6 +150,12 @@ void AsyncResult::setCompleted()
|
||||||
|
d->result = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
+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 42b30e8..d0ff89c 100644
|
||||||
|
--- a/agent/polkitqt1-agent-session.h
|
||||||
|
+++ b/agent/polkitqt1-agent-session.h
|
||||||
|
@@ -44,6 +44,11 @@ public:
|
||||||
|
*/
|
||||||
|
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.
|
||||||
|
* Method complete() must be called anyway.
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
@ -1,11 +1,12 @@
|
|||||||
Name: polkit-qt-1
|
Name: polkit-qt-1
|
||||||
Version: 0.114.0
|
Version: 0.114.0
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Qt bindings for PolicyKit
|
Summary: Qt bindings for PolicyKit
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/
|
URL: https://invent.kde.org/libraries/polkit-qt-1
|
||||||
Source0: http://download.kde.org/stable/%{name}/polkit-qt-1-%{version}.tar.xz
|
Source0: http://download.kde.org/stable/%{name}/polkit-qt-1-%{version}.tar.xz
|
||||||
|
Patch0: 0001-add-setCancel-method.patch
|
||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -82,6 +83,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jul 21 2022 loong_C <loong_c@yeah.net> - 0.114.0-2
|
||||||
|
- add setCancel method and modify URL
|
||||||
|
|
||||||
* Thu Jan 13 2022 pei-jiankang <peijiankang@kylinos.cn> - 0.114.0-1
|
* Thu Jan 13 2022 pei-jiankang <peijiankang@kylinos.cn> - 0.114.0-1
|
||||||
- update to upstream version 0.114.0
|
- update to upstream version 0.114.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user