Save a few bytes.
authorRoy Marples <roy@marples.name>
Tue, 3 Feb 2009 10:34:10 +0000 (10:34 +0000)
committerRoy Marples <roy@marples.name>
Tue, 3 Feb 2009 10:34:10 +0000 (10:34 +0000)
menu.c

diff --git a/menu.c b/menu.c
index 54e72493cdf91044543f03c751ae49a1dfe6593b..22b2aead67f81bcd44e330e16cac6956b9dc98db 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -94,6 +94,7 @@ add_scan_results(GtkMenu *menu, const struct if_msg *ifm)
        GtkWidget *item, *image, *box, *label, *bar;
        double perc;
        int strength;
+       const char *icon;
 
        for (gl = ifm->scan_results; gl; gl = gl->next) {
                ifa = (const struct if_ap *)gl->data;
@@ -107,11 +108,11 @@ add_scan_results(GtkMenu *menu, const struct if_msg *ifm)
                if (g_strcmp0(ifm->ssid, ifa->ssid) == 0)
                        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
                if (ifa->flags == NULL)
-                       image = gtk_image_new_from_icon_name("network-wireless",
-                                                            GTK_ICON_SIZE_MENU);
+                       icon = "network-wireless";
                else
-                       image = gtk_image_new_from_icon_name("network-wireless-encrypted",
-                                                            GTK_ICON_SIZE_MENU);
+                       icon = "network-wireless-encrypted";
+               image = gtk_image_new_from_icon_name(icon,
+                                                    GTK_ICON_SIZE_MENU);
                gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
 
                bar = gtk_progress_bar_new();