Code review comment for lp:~mdeslaur/indicator-session/lp1220201

Revision history for this message
Charles Kerr (charlesk) wrote :

Marc, this is a great point, but we should probably apply this when there's >1 user on the system as well.

What about merging this else clause and the next one this way:

$ bzr diff
=== modified file 'src/service.c'
--- src/service.c 2013-09-05 19:44:55 +0000
+++ src/service.c 2013-09-25 14:49:19 +0000
@@ -463,16 +463,15 @@
       item = g_menu_item_new (ellipsis ? _("Switch Account…")
                                        : _("Switch Account"), action);
     }
- else if (g_hash_table_size (p->users) == 1)
- {
- const char * action = "indicator.switch-to-greeter";
- item = g_menu_item_new (_("Lock"), action);
- }
   else
     {
- const char * action = "indicator.switch-to-greeter";
- item = g_menu_item_new (ellipsis ? _("Lock/Switch Account…")
- : _("Lock/Switch Account"), action);
+ const char * action = "indicator.switch-to-screensaver";
+
+ if (g_hash_table_size (p->users) == 1)
+ item = g_menu_item_new (_("Lock"), action);
+ else
+ item = g_menu_item_new (ellipsis ? _("Lock/Switch Account…")
+ : _("Lock/Switch Account"), action);
     }
   str = g_settings_get_string (p->keybinding_settings, "screensaver");
   g_menu_item_set_attribute (item, "accel", "s", str);

« Back to merge proposal