summaryrefslogtreecommitdiff
path: root/polkitgtkmate/polkitlockbutton.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-12-27 00:28:18 -0800
committerStefano Karapetsas <[email protected]>2012-12-27 00:28:18 -0800
commit29c348cdf95c8ddac41a027cc3a7e09d4fdc8560 (patch)
tree9cf97da4f6e957738740eb0115c03346732ff205 /polkitgtkmate/polkitlockbutton.c
parentd6c0362e70e695b1da921331f136d396d021f44c (diff)
parent12c23d62d0932bcecced3c2621674b89c4e6d265 (diff)
downloadmate-polkit-29c348cdf95c8ddac41a027cc3a7e09d4fdc8560.tar.bz2
mate-polkit-29c348cdf95c8ddac41a027cc3a7e09d4fdc8560.tar.xz
Merge pull request #3 from sbalneav/master
Fixed deprecation, compile error & warnings.
Diffstat (limited to 'polkitgtkmate/polkitlockbutton.c')
-rw-r--r--polkitgtkmate/polkitlockbutton.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/polkitgtkmate/polkitlockbutton.c b/polkitgtkmate/polkitlockbutton.c
index cedfa4d..079a94b 100644
--- a/polkitgtkmate/polkitlockbutton.c
+++ b/polkitgtkmate/polkitlockbutton.c
@@ -680,9 +680,9 @@ polkit_lock_button_new (const gchar *action_id)
static void
update_state (PolkitLockButton *button)
{
- const gchar *text;
- const gchar *tooltip;
- gboolean sensitive;
+ const gchar *text = NULL;
+ const gchar *tooltip = NULL;
+ gboolean sensitive = FALSE;
gboolean old_hidden;
GtkWidget *image;
@@ -735,11 +735,19 @@ update_state (PolkitLockButton *button)
image = gtk_image_new_from_icon_name (button->priv->authorized ? "changes-allow" : "changes-prevent",
GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_button_set_image (GTK_BUTTON (button->priv->button), image);
- gtk_label_set_text (GTK_LABEL (button->priv->label), text);
+
+ if (text != NULL)
+ {
+ gtk_label_set_text (GTK_LABEL (button->priv->label), text);
+ }
+
gtk_widget_set_sensitive (button->priv->button, sensitive);
- gtk_widget_set_tooltip_markup (GTK_WIDGET (button->priv->label), tooltip);
- gtk_widget_set_tooltip_markup (GTK_WIDGET (button->priv->button), tooltip);
+ if (tooltip != NULL)
+ {
+ gtk_widget_set_tooltip_markup (GTK_WIDGET (button->priv->label), tooltip);
+ gtk_widget_set_tooltip_markup (GTK_WIDGET (button->priv->button), tooltip);
+ }
if (button->priv->hidden)
{