summaryrefslogtreecommitdiff
path: root/sys-auth/polkit-qt/files/polkit-qt-0.114.0-glib-2.36.patch
blob: bc9da1c4dc4f0e74ee4bdb8c63d2d275b7e423d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
From 2656bf02e19f282ee963309a48ba497873e9fa40 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Fri, 6 Aug 2021 11:57:43 +0200
Subject: [PATCH] Require glib 2.36 and remove "do nothing" g_type_init

g_type_init deprecated and a no-op since glib 2.36

glib 2.36 was released in 2013, i think it's a reasonable min dependency
nowadays
---
 CMakeLists.txt                            | 2 +-
 agent/polkitqt1-agent-listener.cpp        | 4 ----
 agent/polkitqtlistener.cpp                | 1 -
 core/polkitqt1-actiondescription.cpp      | 2 --
 core/polkitqt1-authority.cpp              | 2 --
 core/polkitqt1-details.cpp                | 2 --
 core/polkitqt1-identity.cpp               | 2 --
 core/polkitqt1-subject.cpp                | 5 -----
 core/polkitqt1-temporaryauthorization.cpp | 1 -
 examples/agent/pkagentexample.cpp         | 2 --
 10 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a82f8cb..dd0977e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,7 @@ set(POLKITQT-1_INCLUDE_PATH "polkit-qt5-1")
 
 pkg_check_modules(POLKIT_GOBJECT polkit-gobject-1 REQUIRED IMPORTED_TARGET)
 pkg_check_modules(POLKIT_AGENT polkit-agent-1 REQUIRED IMPORTED_TARGET)
-pkg_check_modules(GLIB2 glib-2.0 REQUIRED IMPORTED_TARGET)
+pkg_check_modules(GLIB2 glib-2.0>=2.36 REQUIRED IMPORTED_TARGET)
 pkg_check_modules(GOBJECT gobject-2.0 REQUIRED IMPORTED_TARGET)
 
 add_definitions(-DQT_NO_KEYWORDS)
diff --git a/agent/polkitqt1-agent-listener.cpp b/agent/polkitqt1-agent-listener.cpp
index cb99299..27348b1 100644
--- a/agent/polkitqt1-agent-listener.cpp
+++ b/agent/polkitqt1-agent-listener.cpp
@@ -34,8 +34,6 @@ public:
 Listener::Listener(QObject *parent)
         : QObject(parent), d(new ListenerPrivate)
 {
-    g_type_init();
-
     d->listener = polkit_qt_listener_new();
 
     qDebug() << "New PolkitAgentListener " << d->listener;
@@ -46,8 +44,6 @@ Listener::Listener(QObject *parent)
 Listener::Listener(PolkitAgentListener *listener, QObject *parent)
         : QObject(parent), d(new ListenerPrivate)
 {
-    g_type_init();
-
     d->listener = listener;
     
     if (d->listener != nullptr) {
diff --git a/agent/polkitqtlistener.cpp b/agent/polkitqtlistener.cpp
index 69c4f8a..e8713b5 100644
--- a/agent/polkitqtlistener.cpp
+++ b/agent/polkitqtlistener.cpp
@@ -49,7 +49,6 @@ G_DEFINE_TYPE(PolkitQtListener, polkit_qt_listener, POLKIT_AGENT_TYPE_LISTENER)
 
 static void polkit_qt_listener_init(PolkitQtListener *listener)
 {
-    g_type_init();
 }
 
 static void polkit_qt_listener_finalize(GObject *object)
diff --git a/core/polkitqt1-actiondescription.cpp b/core/polkitqt1-actiondescription.cpp
index f865c37..c08f5c4 100644
--- a/core/polkitqt1-actiondescription.cpp
+++ b/core/polkitqt1-actiondescription.cpp
@@ -55,8 +55,6 @@ ActionDescription::ActionDescription()
 ActionDescription::ActionDescription(PolkitActionDescription *polkitActionDescription)
         : d(new Data)
 {
-    g_type_init();
-
     d->actionId = QString::fromUtf8(polkit_action_description_get_action_id(polkitActionDescription));
     d->description = QString::fromUtf8(polkit_action_description_get_description(polkitActionDescription));
     d->message = QString::fromUtf8(polkit_action_description_get_message(polkitActionDescription));
diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp
index a891b92..73dd97e 100644
--- a/core/polkitqt1-authority.cpp
+++ b/core/polkitqt1-authority.cpp
@@ -172,8 +172,6 @@ void Authority::Private::init()
     QDBusError error;
     QDBusError dbus_error;
 
-    g_type_init();
-
     m_systemBus = new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SystemBus,
                                                                     QStringLiteral("polkit_qt_system_bus")));
 
diff --git a/core/polkitqt1-details.cpp b/core/polkitqt1-details.cpp
index b9494f0..ba107b1 100644
--- a/core/polkitqt1-details.cpp
+++ b/core/polkitqt1-details.cpp
@@ -39,14 +39,12 @@ public:
 Details::Details()
         : d(new Data)
 {
-    g_type_init();
     d->polkitDetails = polkit_details_new();
 }
 
 Details::Details(PolkitDetails *pkDetails)
         : d(new Data)
 {
-    g_type_init();
     d->polkitDetails = pkDetails;
     
     if (d->polkitDetails != nullptr) {
diff --git a/core/polkitqt1-identity.cpp b/core/polkitqt1-identity.cpp
index 2489c33..0924c5a 100644
--- a/core/polkitqt1-identity.cpp
+++ b/core/polkitqt1-identity.cpp
@@ -39,13 +39,11 @@ public:
 Identity::Identity()
         : d(new Data)
 {
-    g_type_init();
 }
 
 Identity::Identity(PolkitIdentity *polkitIdentity)
         : d(new Data)
 {
-    g_type_init();
     d->identity = polkitIdentity;
 
     if (d->identity) {
diff --git a/core/polkitqt1-subject.cpp b/core/polkitqt1-subject.cpp
index 3d86437..3dae3bd 100644
--- a/core/polkitqt1-subject.cpp
+++ b/core/polkitqt1-subject.cpp
@@ -39,13 +39,11 @@ public:
 Subject::Subject()
         : d(new Data)
 {
-    g_type_init();
 }
 
 Subject::Subject(PolkitSubject *subject)
         : d(new Data)
 {
-    g_type_init();
     d->subject = subject;
     
     if (d->subject != nullptr) {
@@ -95,9 +93,6 @@ QString Subject::toString() const
 
 Subject Subject::fromString(const QString &string)
 {
-    // should be in polkit library!!! but for strange reason it's necessary to have it here
-    g_type_init();
-
     Subject subject;
     GError *error = nullptr;
     subject.d->subject = polkit_subject_from_string(string.toUtf8().data(), &error);
diff --git a/core/polkitqt1-temporaryauthorization.cpp b/core/polkitqt1-temporaryauthorization.cpp
index 64209ff..ae40f3b 100644
--- a/core/polkitqt1-temporaryauthorization.cpp
+++ b/core/polkitqt1-temporaryauthorization.cpp
@@ -38,7 +38,6 @@ public:
 TemporaryAuthorization::TemporaryAuthorization(PolkitTemporaryAuthorization *pkTemporaryAuthorization)
         : d(new Data)
 {
-    g_type_init();
     d->id = QString::fromUtf8(polkit_temporary_authorization_get_id(pkTemporaryAuthorization));
     d->actionId = QString::fromUtf8(polkit_temporary_authorization_get_action_id(pkTemporaryAuthorization));
     d->subject = Subject::fromString(polkit_subject_to_string(polkit_temporary_authorization_get_subject(pkTemporaryAuthorization)));
diff --git a/examples/agent/pkagentexample.cpp b/examples/agent/pkagentexample.cpp
index 8b1128b..da555c7 100644
--- a/examples/agent/pkagentexample.cpp
+++ b/examples/agent/pkagentexample.cpp
@@ -9,8 +9,6 @@
 PkAgentExample::PkAgentExample(int &argc, char **argv)
         : QCoreApplication(argc, argv)
 {
-    g_type_init();
-
     PolkitQt1::UnixSessionSubject session(getpid());
 
     m_listener.registerListener(session, "/org/kde/PolicyKit1/AuthenticationAgent");
-- 
GitLab