summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@fedoraproject.org>2008-03-03 18:02:59 +0000
committerMatthias Clasen <mclasen@fedoraproject.org>2008-03-03 18:02:59 +0000
commit05dc87edc813bc95ea03d42a85be4c704daba2e5 (patch)
tree0a5477b9c36529aae7288adf952082021f8c57c8
parent881c85a605b25b68160b44b3ea39537b87495c95 (diff)
Some upstream clock applet fixesgnome-panel-2_21_92-3_fc9
-rw-r--r--gnome-panel.spec7
-rw-r--r--polkit-fix.patch107
2 files changed, 113 insertions, 1 deletions
diff --git a/gnome-panel.spec b/gnome-panel.spec
index 71609c7..64a92fd 100644
--- a/gnome-panel.spec
+++ b/gnome-panel.spec
@@ -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 @@ Patch11: applet-error.patch
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 @@ Panel Applets using the libpanel-applet library.
%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 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
+* Mon Mar 3 2008 Matthias Clasen <mclasen@redhat.com> - 2.21.92-3
+- Some upstream clock applet fixes
+
* Mon Mar 3 2008 Ray Strode <rstrode@redhat.com> - 2.21.92-2
- Don't crash with Zimbra connector (bug 435355)
diff --git a/polkit-fix.patch b/polkit-fix.patch
new file mode 100644
index 0000000..2d07445
--- /dev/null
+++ b/polkit-fix.patch
@@ -0,0 +1,107 @@
+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