[gdm] common: Remove settings client / server
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] common: Remove settings client / server
- Date: Thu, 13 Feb 2014 22:01:41 +0000 (UTC)
commit dcec22b0ad9f1c50d10d4bbbfa69bbfad6232357
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Feb 13 16:18:20 2014 -0500
common: Remove settings client / server
This is used in *one* place in the simple slave. Just port it
over to use gdm_settings_direct instead of keeping an entire
DBus API around for just one call...
.gitignore | 4 -
common/Makefile.am | 44 ---
common/gdm-settings-client.c | 513 ---------------------------------
common/gdm-settings-client.h | 63 ----
common/gdm-settings.c | 113 --------
common/gdm-settings.xml | 18 --
common/test-settings-client.c | 89 ------
common/test-settings-server.c | 102 -------
daemon/gdm-simple-slave.c | 4 +-
daemon/simple-slave-main.c | 6 -
gui/simple-chooser/chooser-main.c | 2 -
gui/simple-chooser/gdm-host-chooser.c | 2 -
po/POTFILES.in | 3 -
13 files changed, 1 insertions(+), 962 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 970248c..762cd54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,8 +42,6 @@ gdm-session-glue.h
gdm-session-glue.c
gdm-session-worker-glue.h
gdm-session-worker-glue.c
-gdm-settings-glue.h
-gdm-settings-glue.c
gdm-simple-greeter.desktop.in
gdm-simple-greeter.schemas
gdm-simple-slave-glue.h
@@ -96,8 +94,6 @@ INSTALL
aclocal.m4
autom4te.cache/
common/test-log
-common/test-settings-client
-common/test-settings-server
compile
config.guess
config.h.in
diff --git a/common/Makefile.am b/common/Makefile.am
index b8687da..ece167b 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -27,20 +27,9 @@ noinst_LTLIBRARIES = \
libgdmcommon.la \
$(NULL)
-BUILT_SOURCES = \
- gdm-settings-glue.h \
- $(NULL)
-
gdmdir = $(datadir)/gdm
gdm_DATA = gdb-cmd
-gdm-settings-glue.c gdm-settings-glue.h : gdm-settings.xml Makefile.am
- $(AM_V_GEN)gdbus-codegen \
- --c-namespace=GdmDBus \
- --interface-prefix=org.gnome.DisplayManager \
- --generate-c-code=gdm-settings-glue \
- $(srcdir)/gdm-settings.xml
-
if MKDTEMP_MISSING
MKDTEMP_FILES = mkdtemp.c mkdtemp.h
else
@@ -65,18 +54,11 @@ libgdmcommon_la_SOURCES = \
gdm-settings-utils.c \
gdm-settings-direct.c \
gdm-settings-direct.h \
- gdm-settings-client.h \
- gdm-settings-client.c \
gdm-log.h \
gdm-log.c \
$(MKDTEMP_FILES) \
$(NULL)
-nodist_libgdmcommon_la_SOURCES = \
- gdm-settings-glue.h \
- gdm-settings-glue.c \
- $(NULL)
-
libgdmcommon_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
@@ -96,8 +78,6 @@ libgdmcommon_la_LDFLAGS = \
$(NULL)
noinst_PROGRAMS = \
- test-settings-server \
- test-settings-client \
test-log \
$(NULL)
@@ -110,31 +90,7 @@ test_log_LDADD = \
$(COMMON_LIBS) \
$(NULL)
-test_settings_server_SOURCES = \
- test-settings-server.c \
- $(NULL)
-
-test_settings_server_LDADD = \
- libgdmcommon.la \
- $(COMMON_LIBS) \
- $(NULL)
-
-test_settings_client_SOURCES = \
- test-settings-client.c \
- $(NULL)
-
-test_settings_client_LDADD = \
- libgdmcommon.la \
- $(COMMON_LIBS) \
- $(NULL)
-
-CLEANFILES = \
- gdm-settings-glue.c \
- $(BUILT_SOURCES) \
- $(NULL)
-
EXTRA_DIST = \
- gdm-settings.xml \
mkdtemp.c \
mkdtemp.h \
$(gdm_DATA) \
diff --git a/common/gdm-settings.c b/common/gdm-settings.c
index 9e68056..1040fbb 100644
--- a/common/gdm-settings.c
+++ b/common/gdm-settings.c
@@ -36,20 +36,13 @@
#include <gio/gio.h>
#include "gdm-settings.h"
-#include "gdm-settings-glue.h"
#include "gdm-settings-desktop-backend.h"
-#define GDM_DBUS_PATH "/org/gnome/DisplayManager"
-#define GDM_SETTINGS_DBUS_PATH GDM_DBUS_PATH "/Settings"
-#define GDM_SETTINGS_DBUS_NAME "org.gnome.DisplayManager.Settings"
-
#define GDM_SETTINGS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SETTINGS,
GdmSettingsPrivate))
struct GdmSettingsPrivate
{
- GDBusConnection *connection;
- GdmDBusSettings *skeleton;
GdmSettingsBackend *backend;
};
@@ -79,10 +72,6 @@ gdm_settings_error_quark (void)
return ret;
}
-/*
-dbus-send --system --print-reply --dest=org.gnome.DisplayManager /org/gnome/DisplayManager/Settings
org.gnome.DisplayManager.Settings.GetValue string:"xdmcp/Enable"
-*/
-
gboolean
gdm_settings_get_value (GdmSettings *settings,
const char *key,
@@ -107,10 +96,6 @@ gdm_settings_get_value (GdmSettings *settings,
return res;
}
-/*
-dbus-send --system --print-reply --dest=org.gnome.DisplayManager /org/gnome/DisplayManager/Settings
org.gnome.DisplayManager.Settings.SetValue string:"xdmcp/Enable" string:"false"
-*/
-
gboolean
gdm_settings_set_value (GdmSettings *settings,
const char *key,
@@ -137,91 +122,6 @@ gdm_settings_set_value (GdmSettings *settings,
return res;
}
-static gboolean
-handle_get_value (GdmDBusSettings *settings,
- GDBusMethodInvocation *invocation,
- const char *key,
- gpointer user_data)
-{
- GdmSettings *self = GDM_SETTINGS (user_data);
- GError *error = NULL;
- char *value = NULL;
-
- gdm_settings_get_value (self, key, &value, &error);
- if (error) {
- g_dbus_method_invocation_return_gerror (invocation, error);
- g_error_free (error);
- return TRUE;
- }
-
- gdm_dbus_settings_complete_get_value (settings, invocation,
- value);
- g_free (value);
-
- return TRUE;
-}
-
-static gboolean
-handle_set_value (GdmDBusSettings *settings,
- GDBusMethodInvocation *invocation,
- const char *key,
- const char *value,
- gpointer user_data)
-{
- GdmSettings *self = GDM_SETTINGS (user_data);
- GError *error = NULL;
-
- gdm_settings_set_value (self, key, value, &error);
- if (error) {
- g_dbus_method_invocation_return_gerror (invocation, error);
- g_error_free (error);
- return TRUE;
- }
-
- gdm_dbus_settings_complete_set_value (settings, invocation);
-
- return TRUE;
-}
-
-static gboolean
-register_settings (GdmSettings *settings)
-{
- GError *error = NULL;
-
- error = NULL;
- settings->priv->connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
- if (settings->priv->connection == NULL) {
- if (error != NULL) {
- g_critical ("error getting system bus: %s", error->message);
- g_error_free (error);
- }
- exit (1);
- }
-
- settings->priv->skeleton = GDM_DBUS_SETTINGS (gdm_dbus_settings_skeleton_new ());
- g_signal_connect_object (settings->priv->skeleton,
- "handle-get-value",
- G_CALLBACK (handle_get_value),
- settings,
- 0);
- g_signal_connect_object (settings->priv->skeleton,
- "handle-set-value",
- G_CALLBACK (handle_set_value),
- settings,
- 0);
-
- g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (settings->priv->skeleton),
- settings->priv->connection,
- GDM_SETTINGS_DBUS_PATH,
- NULL);
-
- return TRUE;
-}
-
-/*
-dbus-send --system --print-reply --dest=org.gnome.DisplayManager /org/gnome/DisplayManager/Settings
org.freedesktop.DBus.Introspectable.Introspect
-*/
-
static void
gdm_settings_class_init (GdmSettingsClass *klass)
{
@@ -257,9 +157,6 @@ backend_value_changed (GdmSettingsBackend *backend,
/* proxy it to internal listeners */
g_signal_emit (settings, signals [VALUE_CHANGED], 0, key, old_value, new_value);
-
- /* and to dbus */
- gdm_dbus_settings_emit_value_changed (settings->priv->skeleton, key, old_value, new_value);
}
static void
@@ -299,17 +196,7 @@ gdm_settings_new (void)
if (settings_object != NULL) {
g_object_ref (settings_object);
} else {
- gboolean res;
-
settings_object = g_object_new (GDM_TYPE_SETTINGS, NULL);
- g_object_add_weak_pointer (settings_object,
- (gpointer *) &settings_object);
- res = register_settings (settings_object);
- if (! res) {
- g_warning ("Unable to register settings");
- g_object_unref (settings_object);
- return NULL;
- }
}
return GDM_SETTINGS (settings_object);
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index d83216b..a58368d 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -44,7 +44,6 @@
#include "gdm-common.h"
-#include "gdm-settings-client.h"
#include "gdm-settings-keys.h"
#include "gdm-simple-slave.h"
@@ -1491,8 +1490,7 @@ gdm_simple_slave_run (GdmSimpleSlave *slave)
slave->priv->server = gdm_server_new (display_name, seat_id, auth_file, display_is_initial);
disable_tcp = TRUE;
- if (gdm_settings_client_get_boolean (GDM_KEY_DISALLOW_TCP,
- &disable_tcp)) {
+ if (gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disable_tcp)) {
g_object_set (slave->priv->server,
"disable-tcp", disable_tcp,
NULL);
diff --git a/daemon/simple-slave-main.c b/daemon/simple-slave-main.c
index 5c6bfa2..a94a5ad 100644
--- a/daemon/simple-slave-main.c
+++ b/daemon/simple-slave-main.c
@@ -43,7 +43,6 @@
#include "gdm-settings.h"
#include "gdm-settings-direct.h"
#include "gdm-settings-keys.h"
-#include "gdm-settings-client.h"
static GdmSettings *settings = NULL;
static int gdm_return_code = 0;
@@ -159,11 +158,6 @@ main (int argc,
exit (1);
}
- if (! gdm_settings_client_init (DATADIR "/gdm/gdm.schemas", "/")) {
- g_critical ("Unable to initialize settings client");
- exit (1);
- }
-
main_loop = g_main_loop_new (NULL, FALSE);
g_unix_signal_add (SIGTERM, on_shutdown_signal_cb, main_loop);
diff --git a/gui/simple-chooser/chooser-main.c b/gui/simple-chooser/chooser-main.c
index ca5b92c..54aebf1 100644
--- a/gui/simple-chooser/chooser-main.c
+++ b/gui/simple-chooser/chooser-main.c
@@ -33,8 +33,6 @@
#include "gdm-common.h"
#include "gdm-log.h"
-#include "gdm-settings-client.h"
-#include "gdm-settings-keys.h"
#include "gdm-chooser-session.h"
diff --git a/gui/simple-chooser/gdm-host-chooser.c b/gui/simple-chooser/gdm-host-chooser.c
index fa15be3..47f37d4 100644
--- a/gui/simple-chooser/gdm-host-chooser.c
+++ b/gui/simple-chooser/gdm-host-chooser.c
@@ -33,8 +33,6 @@
#include "gdm-common.h"
#include "gdm-log.h"
-#include "gdm-settings-client.h"
-#include "gdm-settings-keys.h"
#include "gdm-chooser-host.h"
#include "gdm-host-chooser-dialog.h"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index eec3fa5..44ff2d6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,13 +4,10 @@ common/gdm-common.c
common/gdm-log.c
common/gdm-settings-backend.c
common/gdm-settings.c
-common/gdm-settings-client.c
common/gdm-settings-desktop-backend.c
common/gdm-settings-direct.c
common/gdm-settings-utils.c
common/test-log.c
-common/test-settings-client.c
-common/test-settings-server.c
daemon/gdm-display-access-file.c
daemon/gdm-display.c
daemon/gdm-display-store.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]