summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-14 16:48:52 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-14 16:48:52 +0000
commit993967b89ce2e552294afe8c290a6c54ad60fe30 (patch)
treec5c6a0d31fb47a79e2ee30e91dd59c33bc2efe63
parent55367611f5d8de80a0322dbcc69c8311a8ac3e01 (diff)
downloaddrakx-net-993967b89ce2e552294afe8c290a6c54ad60fe30.tar
drakx-net-993967b89ce2e552294afe8c290a6c54ad60fe30.tar.gz
drakx-net-993967b89ce2e552294afe8c290a6c54ad60fe30.tar.bz2
drakx-net-993967b89ce2e552294afe8c290a6c54ad60fe30.tar.xz
drakx-net-993967b89ce2e552294afe8c290a6c54ad60fe30.zip
short-circuit to avoid creating useless widgets
-rwxr-xr-xbin/net_applet4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/net_applet b/bin/net_applet
index 629d16f..6662fe3 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -404,10 +404,10 @@ sub create_action_item {
my @menu = create_menu_choices($action);
@menu || $actions{$action}{header} or return ();
gtkshow(create_menu($name,
- if_($actions{$action}{header},
+ $actions{$action}{header} ? (
create_action_item($actions{$action}{header}),
gtkshow(Gtk2::SeparatorMenuItem->new),
- ),
+ ) : (),
@menu,
));
} else {