Merge pull request #42177 from jtojnar/deja-dup-nautilus

deja-dup: fix nautilus extension breaking nautilus
This commit is contained in:
Franz Pletz 2018-06-19 16:53:56 +00:00 committed by GitHub
commit bcc60fad86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

@ -19,8 +19,13 @@ stdenv.mkDerivation rec {
src = ./fix-paths.patch;
inherit coreutils;
})
./hardcode-gsettings.patch
];
postPatch = ''
substituteInPlace deja-dup/nautilus/NautilusExtension.c --subst-var-by DEJA_DUP_GSETTINGS_PATH $out/share/gsettings-schemas/${name}/glib-2.0/schemas
'';
nativeBuildInputs = [
meson ninja pkgconfig vala_0_40 gettext itstool
appstream-glib desktop-file-utils libxml2 wrapGAppsHook

@ -0,0 +1,38 @@
--- a/deja-dup/nautilus/NautilusExtension.c
+++ b/deja-dup/nautilus/NautilusExtension.c
@@ -24,6 +24,8 @@
#include <glib/gi18n-lib.h>
GList *dirs = NULL;
+GSettingsSchemaSource *schema_source = NULL;
+GSettingsSchema *schema = NULL;
GSettings *settings = NULL;
// This will treat a < b iff a is 'lower' in the file tree than b
@@ -313,7 +315,13 @@
bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
- settings = g_settings_new("org.gnome.DejaDup");
+ schema_source = g_settings_schema_source_new_from_directory ("@DEJA_DUP_GSETTINGS_PATH@",
+ g_settings_schema_source_get_default (), TRUE, NULL);
+
+ schema = g_settings_schema_source_lookup (schema_source,
+ "org.gnome.DejaDup", FALSE);
+
+ settings = g_settings_new_full (schema, NULL, NULL);
g_signal_connect(settings, "changed::include-list",
update_include_excludes, NULL);
g_signal_connect(settings, "changed::exclude-list",
@@ -329,7 +337,11 @@
void nautilus_module_shutdown(void)
{
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
g_object_unref(settings);
+ schema_source = NULL;
+ schema = NULL;
settings = NULL;
update_include_excludes(); /* will clear it now that settings is NULL */