[polkit-qt] Next attempt of fix-deprecated-warnings patch

Radek Novacek rnovacek at fedoraproject.org
Fri Oct 15 21:30:02 UTC 2010


commit 09440d1f11657c7bd386ffa33889542f474a0e47
Author: Radek Novacek <rad.n at centrum.cz>
Date:   Fri Oct 15 23:29:50 2010 +0200

    Next attempt of fix-deprecated-warnings patch

 polkit-qt-0.96.1-fix-deprecated-warnings.patch |   72 +++++++++++++++++-------
 polkit-qt.spec                                 |   12 ++--
 2 files changed, 58 insertions(+), 26 deletions(-)
---
diff --git a/polkit-qt-0.96.1-fix-deprecated-warnings.patch b/polkit-qt-0.96.1-fix-deprecated-warnings.patch
index fa136b0..5b65a6d 100644
--- a/polkit-qt-0.96.1-fix-deprecated-warnings.patch
+++ b/polkit-qt-0.96.1-fix-deprecated-warnings.patch
@@ -1,7 +1,54 @@
-Index: core/polkitqt1-authority.cpp
-===================================================================
---- core/polkitqt1-authority.cpp	(revision 1183413)
-+++ core/polkitqt1-authority.cpp	(working copy)
+diff -ur polkit-qt-1-0.96.1/agent/polkitqt1-agent-listener.cpp polkit-qt-1-0.96.1_new/agent/polkitqt1-agent-listener.cpp
+--- polkit-qt-1-0.96.1/agent/polkitqt1-agent-listener.cpp	2010-10-15 21:30:06.295018901 +0200
++++ polkit-qt-1-0.96.1_new/agent/polkitqt1-agent-listener.cpp	2010-10-15 21:22:34.102034730 +0200
+@@ -39,6 +39,7 @@
+ {
+ public:
+     PolkitAgentListener *listener;
++    void *registeredHandle;
+ };
+ 
+ Listener::Listener(QObject *parent)
+@@ -66,6 +67,8 @@
+     qDebug("Destroying listener");
+ 
+     ListenerAdapter::instance()->removeListener(this);
++    if (d->registeredHandle)
++        polkit_agent_listener_unregister(d->registeredHandle);
+     if (d->listener != NULL)
+         g_object_unref(d->listener);
+ }
+@@ -73,17 +76,24 @@
+ bool Listener::registerListener(PolkitQt1::Subject *subject, const QString &objectPath)
+ {
+     GError *error = NULL;
+-
+-    bool r = polkit_agent_register_listener(d->listener,
++    d->registeredHandle = polkit_agent_listener_register(d->listener,
++                                            POLKIT_AGENT_REGISTER_FLAGS_NONE,
+                                             subject->subject(),
+                                             objectPath.toAscii().data(),
++                                            NULL,
+                                             &error);
++
+     if (error != NULL) {
+         qWarning() << QString("Cannot register authentication agent: %1").arg(error->message);
+         g_error_free(error);
+         return false;
+     }
+-    return r;
++    if (d->registeredHandle == NULL)
++    {
++        qWarning() << QString("Cannot register authentication agent!");
++        return false;
++    }
++    return true;
+ }
+ 
+ const PolkitAgentListener *Listener::listener()
+diff -ur polkit-qt-1-0.96.1/core/polkitqt1-authority.cpp polkit-qt-1-0.96.1_new/core/polkitqt1-authority.cpp
+--- polkit-qt-1-0.96.1/core/polkitqt1-authority.cpp	2010-07-03 12:17:13.000000000 +0200
++++ polkit-qt-1-0.96.1_new/core/polkitqt1-authority.cpp	2010-10-15 15:21:47.396705581 +0200
 @@ -177,12 +177,17 @@
      m_revokeTemporaryAuthorizationsCancellable = g_cancellable_new();
      m_revokeTemporaryAuthorizationCancellable = g_cancellable_new();
@@ -22,20 +69,3 @@ Index: core/polkitqt1-authority.cpp
          return;
      }
  
-Index: agent/polkitqt1-agent-listener.cpp
-===================================================================
---- agent/polkitqt1-agent-listener.cpp	(revision 1183413)
-+++ agent/polkitqt1-agent-listener.cpp	(working copy)
-@@ -73,9 +73,11 @@
- {
-     GError *error = NULL;
- 
--    bool r = polkit_agent_register_listener(d->listener,
-+    bool r = polkit_agent_listener_register(d->listener,
-+                                            POLKIT_AGENT_REGISTER_FLAGS_RUN_IN_THREAD,
-                                             subject->subject(),
-                                             objectPath.toAscii().data(),
-+                                            NULL,
-                                             &error);
-     if (error != NULL) {
-         qWarning() << QString("Cannot register authentication agent: %1").arg(error->message);
diff --git a/polkit-qt.spec b/polkit-qt.spec
index 71c4b3f..8afe7c6 100644
--- a/polkit-qt.spec
+++ b/polkit-qt.spec
@@ -1,6 +1,6 @@
 Name:            polkit-qt
 Version:         0.96.1
-Release:         3%{?dist}
+Release:         4%{?dist}
 Summary:         Qt bindings for PolicyKit
 
 Group:           System Environment/Libraries
@@ -57,13 +57,12 @@ BuildArch: noarch
 # module installation
 %patch0 -p1 -b .install-cmake-find
 
-# Fix deprecation warning with polkit-0.98
-# REVERT FOR NOW as it causes https://bugs.kde.org/show_bug.cgi?id=254150
-# %patch1 -p0
-
 # NULL checking
 %patch2 -p0
 
+# Fix deprecation warning with polkit-0.98, second try
+%patch1 -p1
+
 %build
 mkdir -p %{_target_platform}
 pushd %{_target_platform}
@@ -116,6 +115,9 @@ rm -rf %{buildroot}
 %doc html/*
 
 %changelog
+* Fri Oct 15 2010 Radek Novacek <rnovacek at redhat.com> - 0.96.1-4
+- Next attempt of fix-deprecated-warnings patch
+
 * Thu Oct 14 2010 Jaroslav Reznik <jreznik at redhat.com> - 0.96.1-3
 - Revert fix-deprecated-warnings as it causes kde#254150
 


More information about the scm-commits mailing list