base: presets moved from $HOME/.gstreamer-0.11 to $HOME/.local/share/gstreamer-0.11

This commit is contained in:
Philippe Normand 2011-04-29 14:14:53 +02:00 committed by Sebastian Dröge
parent c3b778f9b1
commit 081202b9d3
2 changed files with 17 additions and 11 deletions

View file

@ -883,7 +883,7 @@ gst_encoding_target_load (const gchar * name, const gchar * category,
/* Try from local profiles */
tldir =
g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
g_build_filename (g_get_user_data_dir (), "gstreamer-" GST_MAJORMINOR,
GST_ENCODING_TARGET_DIRECTORY, NULL);
target = gst_encoding_target_subload (tldir, category, lfilename, error);
g_free (tldir);
@ -1006,7 +1006,7 @@ gst_encoding_target_save (GstEncodingTarget * target, GError ** error)
lfilename = g_strdup_printf ("%s" GST_ENCODING_TARGET_SUFFIX, target->name);
filename =
g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
g_build_filename (g_get_user_data_dir (), "gstreamer-" GST_MAJORMINOR,
GST_ENCODING_TARGET_DIRECTORY, target->category, lfilename, NULL);
g_free (lfilename);
@ -1059,7 +1059,8 @@ gst_encoding_list_available_categories (void)
gchar *topdir;
/* First try user-local categories */
topdir = g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
topdir =
g_build_filename (g_get_user_data_dir (), "gstreamer-" GST_MAJORMINOR,
GST_ENCODING_TARGET_DIRECTORY, NULL);
res = get_categories (topdir);
g_free (topdir);
@ -1175,7 +1176,8 @@ gst_encoding_list_all_targets (const gchar * categoryname)
gchar *topdir;
/* Get user-locals */
topdir = g_build_filename (g_get_home_dir (), ".gstreamer-" GST_MAJORMINOR,
topdir =
g_build_filename (g_get_user_data_dir (), "gstreamer-" GST_MAJORMINOR,
GST_ENCODING_TARGET_DIRECTORY, NULL);
res = get_all_targets (topdir, categoryname);
g_free (topdir);

View file

@ -289,7 +289,8 @@ GST_START_TEST (test_saving_profile)
fail_unless (gst_encoding_target_save (orig, NULL));
/* Check we can load it */
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.11",
profile_file_name =
g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
"encoding-profiles", "herding", "myponytarget2.gep", NULL);
GST_DEBUG ("Loading target from '%s'", profile_file_name);
loaded = gst_encoding_target_load_from_file (profile_file_name, NULL);
@ -411,7 +412,8 @@ GST_START_TEST (test_loading_profile)
gst_encoding_target_unref (target);
/* Test loading using fully specified path */
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.11",
profile_file_name =
g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
"encoding-profiles", "herding", "myponytarget.gep", NULL);
GST_DEBUG ("Loading target from '%s'", profile_file_name);
@ -544,11 +546,13 @@ remove_profile_file (void)
{
gchar *profile_file_name;
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.11",
profile_file_name =
g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
"encoding-profiles", "herding", "myponytarget.gep", NULL);
g_unlink (profile_file_name);
g_free (profile_file_name);
profile_file_name = g_build_filename (g_get_home_dir (), ".gstreamer-0.11",
profile_file_name =
g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
"encoding-profiles", "herding", "myponytarget2.gep", NULL);
g_unlink (profile_file_name);
g_free (profile_file_name);
@ -562,10 +566,10 @@ create_profile_file (void)
GError *error = NULL;
profile_dir =
g_build_filename (g_get_home_dir (), ".gstreamer-0.11",
g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
"encoding-profiles", "herding", NULL);
profile_file_name =
g_build_filename (g_get_home_dir (), ".gstreamer-0.11",
g_build_filename (g_get_user_data_dir (), "gstreamer-0.11",
"encoding-profiles", "herding", "myponytarget.gep", NULL);
g_mkdir_with_parents (profile_dir, S_IRUSR | S_IWUSR | S_IXUSR);
if (!g_file_set_contents (profile_file_name, profile_string,
@ -597,7 +601,7 @@ profile_suite (void)
gchar *gst_dir;
/* cehck if we can create profiles */
gst_dir = g_build_filename (g_get_home_dir (), ".gstreamer-0.11", NULL);
gst_dir = g_build_filename (g_get_user_data_dir (), "gstreamer-0.11", NULL);
can_write = (g_access (gst_dir, R_OK | W_OK | X_OK) == 0);
g_free (gst_dir);