[gnome-session/wip/benzea/systemd-user-switch: 4/13] manager: Allow fetching the configured session without manager
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session/wip/benzea/systemd-user-switch: 4/13] manager: Allow fetching the configured session without manager
- Date: Tue, 14 May 2019 21:33:28 +0000 (UTC)
commit 103114afdfea9797ad7b1e3f3944f54d8c0c5038
Author: Benjamin Berg <bberg redhat com>
Date: Sat Apr 20 01:14:31 2019 +0200
manager: Allow fetching the configured session without manager
When starting on systemd we need to know the session to start for the
target name. However, we don't need anything else from the manager, so
allow calling the function with NULL.
gnome-session/gsm-manager.c | 10 ++++++++--
gnome-session/gsm-manager.h | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index bdc4594b..356c9776 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -1455,10 +1455,16 @@ gsm_manager_start (GsmManager *manager)
start_phase (manager);
}
-const char *
+char *
_gsm_manager_get_default_session (GsmManager *manager)
{
- return g_settings_get_string (manager->priv->session_settings,
+ g_autoptr(GSettings) session_settings = NULL;
+
+ if (manager)
+ session_settings = g_object_ref (manager->priv->session_settings);
+ else
+ session_settings = g_settings_new (SESSION_SCHEMA);
+ return g_settings_get_string (session_settings,
KEY_SESSION_NAME);
}
diff --git a/gnome-session/gsm-manager.h b/gnome-session/gsm-manager.h
index 9ac09e77..3ce4350f 100644
--- a/gnome-session/gsm-manager.h
+++ b/gnome-session/gsm-manager.h
@@ -116,7 +116,7 @@ gboolean gsm_manager_add_legacy_session_apps (GsmManager *
void gsm_manager_start (GsmManager *manager);
-const char * _gsm_manager_get_default_session (GsmManager *manager);
+char * _gsm_manager_get_default_session (GsmManager *manager);
void _gsm_manager_set_active_session (GsmManager *manager,
const char *session_name,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]