Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/backend-dbus/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,21 +1114,32 @@ static void
indicator_session_actions_dbus_init (IndicatorSessionActionsDbus * self)
{
priv_t * p;
GSettings * s;
GSettings * s = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/null/NULL/


p = indicator_session_actions_dbus_get_instance_private (self);
p->cancellable = g_cancellable_new ();
p->seat_allows_activation = TRUE;
self->priv = p;

s = g_settings_new ("org.gnome.desktop.lockdown");
g_signal_connect_swapped (s, "changed::disable-lock-screen",
G_CALLBACK(indicator_session_actions_notify_can_lock), self);
g_signal_connect_swapped (s, "changed::disable-log-out",
G_CALLBACK(indicator_session_actions_notify_can_logout), self);
g_signal_connect_swapped (s, "changed::disable-user-switching",
G_CALLBACK(indicator_session_actions_notify_can_switch), self);
p->lockdown_settings = s;
if (ayatana_common_utils_is_gnome() || ayatana_common_utils_is_budgie())
{
s = g_settings_new ("org.gnome.desktop.lockdown");
}
elif (ayatana_common_utils_is_mate())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/elif/else if/

{
s = g_settings_new ("org.mate.desktop.lockdown");
}

if (s)
{
g_signal_connect_swapped (s, "changed::disable-lock-screen",
G_CALLBACK(indicator_session_actions_notify_can_lock), self);
g_signal_connect_swapped (s, "changed::disable-log-out",
G_CALLBACK(indicator_session_actions_notify_can_logout), self);
g_signal_connect_swapped (s, "changed::disable-user-switching",
G_CALLBACK(indicator_session_actions_notify_can_switch), self);
p->lockdown_settings = s;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now we have the possibility that p->lockdown_settings might no longer be set here, does indicator_session_actions_dbus_get_instance_private() ensure that it is initialized to NULL and does the code handling it expect it to be null?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're not sure about this it might be a better idea to check for Mate and else assume GNOME.


s = g_settings_new ("org.ayatana.indicator.session");
g_signal_connect_swapped (s, "changed::suppress-logout-restart-shutdown",
Expand Down