background: Allow load background file relative to XML file

(cherry picked from commit 70fb75eb27)
This commit is contained in:
Damián Nohales 2018-12-19 22:37:20 +00:00 committed by Georges Basile Stavracas Neto
parent c2af930454
commit 4b2724eb3b

View file

@ -200,7 +200,10 @@ cc_background_xml_load_xml_internal (CcBackgroundXml *xml,
bg_uri = NULL; bg_uri = NULL;
} else { } else {
g_autoptr(GFile) file = NULL; g_autoptr(GFile) file = NULL;
file = g_file_new_for_commandline_arg (content); g_autofree gchar *dirname = NULL;
dirname = g_path_get_dirname (filename);
file = g_file_new_for_commandline_arg_and_cwd (content, dirname);
bg_uri = g_file_get_uri (file); bg_uri = g_file_get_uri (file);
} }
SET_FLAG(CC_BACKGROUND_ITEM_HAS_URI); SET_FLAG(CC_BACKGROUND_ITEM_HAS_URI);