rpms/gnome-panel/devel polkit-fix.patch, NONE, 1.1 gnome-panel.spec, 1.270, 1.271

Matthias Clasen (mclasen) fedora-extras-commits at redhat.com
Mon Mar 3 18:03:40 UTC 2008


Author: mclasen

Update of /cvs/extras/rpms/gnome-panel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9701

Modified Files:
	gnome-panel.spec 
Added Files:
	polkit-fix.patch 
Log Message:
Some upstream clock applet fixes


polkit-fix.patch:

--- NEW FILE polkit-fix.patch ---
diff -up gnome-panel-2.21.92/applets/clock/set-timezone.c.polkit-fix gnome-panel-2.21.92/applets/clock/set-timezone.c
--- gnome-panel-2.21.92/applets/clock/set-timezone.c.polkit-fix	2008-03-03 12:10:34.000000000 -0500
+++ gnome-panel-2.21.92/applets/clock/set-timezone.c	2008-03-03 12:10:50.000000000 -0500
@@ -75,6 +75,40 @@ get_system_bus (void)
         return bus;
 }
 
+static gboolean
+pk_io_watch_have_data (GIOChannel *channel, GIOCondition condition, gpointer user_data)
+{
+        int fd;
+        PolKitContext *pk_context = user_data;
+        fd = g_io_channel_unix_get_fd (channel);
+        polkit_context_io_func (pk_context, fd);
+        return TRUE;
+}
+
+static int 
+pk_io_add_watch_fn (PolKitContext *pk_context, int fd)
+{
+        guint id = 0;
+        GIOChannel *channel;
+        channel = g_io_channel_unix_new (fd);
+        if (channel == NULL)
+                goto out;
+        id = g_io_add_watch (channel, G_IO_IN, pk_io_watch_have_data, pk_context);
+        if (id == 0) {
+                g_io_channel_unref (channel);
+                goto out;
+        }
+        g_io_channel_unref (channel);
+out:
+        return id;
+}
+
+static void 
+pk_io_remove_watch_fn (PolKitContext *pk_context, int watch_id)
+{
+        g_source_remove (watch_id);
+}
+
 static PolKitContext *
 get_pk_context (void)
 {
@@ -82,6 +116,9 @@ get_pk_context (void)
 
 	if (pk_context == NULL) {
 		pk_context = polkit_context_new ();
+//                polkit_context_set_io_watch_functions (pk_context,
+//                                                       pk_io_add_watch_fn,
+//                                                       pk_io_remove_watch_fn);
 		if (!polkit_context_init (pk_context, NULL)) {
 			polkit_context_unref (pk_context);
 			pk_context = NULL;
@@ -126,22 +163,19 @@ can_do (const gchar *pk_action_id)
         pk_result = polkit_context_can_caller_do_action (pk_context, pk_action, pk_caller);
 
 	switch (pk_result) {
-        default:
         case POLKIT_RESULT_UNKNOWN:
         case POLKIT_RESULT_NO:
  		res = 0;
 		break;
-        case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
-        case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
-        case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
-        case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
-        case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
-        case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
-		res = 1;
-		break;
         case POLKIT_RESULT_YES:
 		res = 2;
 		break;
+        default:
+                /* This covers all the POLKIT_RESULT_ONLY_VIA_[SELF|ADMIN]_AUTH_* cases as more of these
+                 * may be added in the future.
+                 */
+		res = 1;
+		break;
 	}
 	
 out:
diff -up gnome-panel-2.21.92/applets/clock/clock.c.polkit-fix gnome-panel-2.21.92/applets/clock/clock.c
--- gnome-panel-2.21.92/applets/clock/clock.c.polkit-fix	2008-03-03 12:10:23.000000000 -0500
+++ gnome-panel-2.21.92/applets/clock/clock.c	2008-03-03 12:10:45.000000000 -0500
@@ -2266,11 +2266,15 @@ clock_migrate_to_26 (ClockData *clock)
 	else if (hourformat == 24)
 		clock->format = CLOCK_FORMAT_24;
 
-	panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
-				       KEY_FORMAT,
-				       gconf_enum_to_string (format_type_enum_map,
-							     clock->format),
-				       NULL);
+	/* It's still possible that we have none of the old keys, in which case
+	 * we're not migrating from 2.6, but the config is simply wrong. So
+	 * don't set the format key in this case. */
+	if (clock->format != CLOCK_FORMAT_INVALID)
+		panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
+					       KEY_FORMAT,
+					       gconf_enum_to_string (format_type_enum_map,
+								     clock->format),
+					       NULL);
 }
 
 static void


Index: gnome-panel.spec
===================================================================
RCS file: /cvs/extras/rpms/gnome-panel/devel/gnome-panel.spec,v
retrieving revision 1.270
retrieving revision 1.271
diff -u -r1.270 -r1.271
--- gnome-panel.spec	3 Mar 2008 15:57:27 -0000	1.270
+++ gnome-panel.spec	3 Mar 2008 18:02:59 -0000	1.271
@@ -22,7 +22,7 @@
 Summary: GNOME panel
 Name: gnome-panel
 Version: 2.21.92
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://www.gnome.org
 Source0: http://download.gnome.org/sources/gnome-panel/2.21/%{name}-%{version}.tar.bz2
 
@@ -108,6 +108,7 @@
 
 Patch14: gnome-panel-2.21.5-ck-shutdown.patch
 
+Patch22: polkit-fix.patch
 Patch23: sunrise.patch
 
 # http://bugzilla.gnome.org/show_bug.cgi?id=520111
@@ -158,6 +159,7 @@
 %patch10 -p1 -b .preferred-apps
 %patch11 -p1 -b .applet-error
 %patch14 -p1 -b .ck-shutdown
+%patch22 -p1 -b .polkit-fix
 %patch23 -p1 -b .sunrise
 %patch24 -p1 -b .allow-spurious-view-done-signals
 
@@ -344,6 +346,9 @@
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Mon Mar  3 2008 Matthias Clasen <mclasen at redhat.com> - 2.21.92-3
+- Some upstream clock applet fixes
+
 * Mon Mar  3 2008 Ray Strode <rstrode at redhat.com> - 2.21.92-2
 - Don't crash with Zimbra connector (bug 435355)
 




More information about the fedora-extras-commits mailing list