/*
* Copyright (C) 2010 Robert Ancell.
* Author: Robert Ancell <robert.ancell@canonical.com>
*
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2 or version 3 of the License.
* See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
*/
#include <string.h>
#include <gio/gdesktopappinfo.h>
enum {
};
typedef struct
{
#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_SESSION, LightDMSessionPrivate)
static gint
{
}
static LightDMSession *
{
if (g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, NULL) ||
return NULL;
domain = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN, NULL);
#else
domain = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, "X-GNOME-Gettext-Domain", NULL);
#endif
name = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, domain, NULL);
if (!name)
{
g_warning ("Ignoring session without name");
return NULL;
}
try_exec = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_TRY_EXEC, domain, NULL);
if (try_exec)
{
if (!full_path)
{
return NULL;
}
}
priv->comment = g_key_file_get_locale_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_COMMENT, domain, NULL);
return session;
}
static GList *
{
if (error)
g_clear_error (&error);
if (!directory)
return NULL;
while (TRUE)
{
break;
continue;
key_file = g_key_file_new ();
if (error)
g_clear_error (&error);
if (result)
{
if (session)
{
g_debug ("Loaded session %s (%s, %s)", path, GET_PRIVATE (session)->name, GET_PRIVATE (session)->comment);
}
else
}
}
return sessions;
}
static void
update_sessions (void)
{
if (have_sessions)
return;
/* Use session directory from configuration */
/* FIXME: This should be sent in the greeter connection */
if (error)
g_clear_error (&error);
if (result)
{
if (value)
{
}
if (value)
{
}
}
}
/**
* lightdm_get_sessions:
*
* Get the available sessions.
*
* Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
**/
GList *
lightdm_get_sessions (void)
{
update_sessions ();
return local_sessions;
}
/**
* lightdm_get_remote_sessions:
*
* Get the available remote sessions.
*
* Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
**/
GList *
lightdm_get_remote_sessions (void)
{
update_sessions ();
return remote_sessions;
}
/**
* lightdm_session_get_key:
* @session: A #LightDMSession
*
* Get the key for a session
*
* Return value: The session key
**/
const gchar *
{
}
/**
* lightdm_session_get_name:
* @session: A #LightDMSession
*
* Get the name for a session
*
* Return value: The session name
**/
const gchar *
{
}
/**
* lightdm_session_get_comment:
* @session: A #LightDMSession
*
* Get the comment for a session
*
* Return value: The session comment
**/
const gchar *
{
}
static void
{
}
static void
{
}
static void
{
switch (prop_id) {
case PROP_KEY:
break;
case PROP_NAME:
break;
case PROP_COMMENT:
break;
default:
break;
}
}
static void
{
}
static void
{
g_param_spec_string ("key",
"key",
"Session key",
NULL,
g_param_spec_string ("name",
"name",
"Session name",
NULL,
g_param_spec_string ("comment",
"comment",
"Session comment",
NULL,
}