Commit dc443372 authored by Ali Abdallah's avatar Ali Abdallah
Browse files

Initialize Xfconf when the backend is to be used

Previously, xfconf_init was called on g_io_module_load. But this will
fatally fail on systems with no xfconfd running.

See Bug #14789 for more details.
parent 79bdf666
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -31,14 +31,6 @@

G_MODULE_EXPORT XFCONF_EXPORT void g_io_module_load (GIOModule *module)
{
  GError *error = NULL;

  if (!xfconf_init (&error)) {
    g_critical ("Failed to get connection to xfconfd: %s", error->message);
    g_error_free (error);
    return;
  }

  g_type_module_use(G_TYPE_MODULE(module));

  g_io_extension_point_implement(G_SETTINGS_BACKEND_EXTENSION_POINT_NAME,
@@ -49,7 +41,6 @@ G_MODULE_EXPORT XFCONF_EXPORT void g_io_module_load (GIOModule *module)

G_MODULE_EXPORT XFCONF_EXPORT void g_io_module_unload (GIOModule *module)
{
  xfconf_shutdown();
}

/* Module query */
+9 −0
Original line number Diff line number Diff line
@@ -297,6 +297,8 @@ xfconf_gsettings_backend_finalize (XfconfGsettingsBackend *self)

  g_hash_table_destroy (self->subscribed_prop);

  xfconf_shutdown();

  G_OBJECT_CLASS(xfconf_gsettings_backend_parent_class)->finalize((GObject*)self);
}

@@ -304,6 +306,13 @@ static void
xfconf_gsettings_backend_init (XfconfGsettingsBackend *self)
{
  const gchar *prg_name;
  GError *error = NULL;

  if (!xfconf_init (&error)) {
    g_critical ("Failed to get connection to xfconfd: %s", error->message);
    g_error_free (error);
    return;
  }

  self->nhandled_tree_node = 0;