summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-08 14:41:33 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-08 14:52:03 -0400
commitdd9c1a0cad35082724bba59235af031246c06ce5 (patch)
treed87fae1e6ce41e19ca1b8506424c1801faf8cc7a /common
parent4228ef3194fff11dcdcdce0b61aa0474fffb066d (diff)
downloaddconf-dd9c1a0cad35082724bba59235af031246c06ce5.tar.gz
clean up and factor out the 'shm' code
Remove the shm code from the engine and the service and put it in a separate convenience library in shm/. Remove the vestigial shmdir weirdness from the service (since shmdir is now always relative to XDG_RUNTIME_DIR and has been for some time). The purpose of this is so that dconf-engine can be properly unit-tested. dconf-engine now has five points of contact with the world (excluding the users of the engine themselves): - the DCONF_PROFILE environment variable - fopen() of profile files - shm - gvdb - dbus The environment variable is quite easily controlled. fopen() is intercepted in the engine testcase with a interpose of the libc symbol. With this commit now each of dbus, gvdb and shm are implemented in separate utility modules that can be mocked from the testcases.
Diffstat (limited to 'common')
-rw-r--r--common/Makefile.am4
-rw-r--r--common/dconf-shmdir.c35
-rw-r--r--common/dconf-shmdir.h30
3 files changed, 1 insertions, 68 deletions
diff --git a/common/Makefile.am b/common/Makefile.am
index 29c4667..324f0fe 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -10,9 +10,7 @@ INCLUDES = $(glib_CFLAGS)
libdconf_common_a_SOURCES = \
dconf-changeset.h \
dconf-changeset.c \
- dconf-paths.c \
- dconf-shmdir.h \
- dconf-shmdir.c
+ dconf-paths.c
libdconf_common_shared_a_CFLAGS = -fPIC -DPIC $(libdconf_common_a_CFLAGS)
libdconf_common_shared_a_SOURCES = $(libdconf_common_a_SOURCES)
diff --git a/common/dconf-shmdir.c b/common/dconf-shmdir.c
deleted file mode 100644
index 839a487..0000000
--- a/common/dconf-shmdir.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright © 2010 Codethink Limited
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the licence, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ryan Lortie <desrt@desrt.ca>
- */
-
-#include "dconf-shmdir.h"
-
-gchar *
-dconf_shmdir_from_environment (void)
-{
- gchar *result;
-
- result = g_build_filename (g_get_user_runtime_dir (), "dconf", NULL);
-
- if (g_mkdir_with_parents (result, 0700) != 0)
- g_critical ("unable to create '%s'; dconf will not work properly.", result);
-
- return result;
-}
diff --git a/common/dconf-shmdir.h b/common/dconf-shmdir.h
deleted file mode 100644
index 3b08de6..0000000
--- a/common/dconf-shmdir.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright © 2010 Codethink Limited
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the licence, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ryan Lortie <desrt@desrt.ca>
- */
-
-#ifndef __dconf_shmdir_h__
-#define __dconf_shmdir_h__
-
-#include <glib.h>
-
-G_GNUC_INTERNAL
-gchar *dconf_shmdir_from_environment (void);
-
-#endif /* __dconf_shmdir_h__ */