After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736231 - save-file plugin doesn't gratefully handle unset XDG_VIDEOS_DIR
save-file plugin doesn't gratefully handle unset XDG_VIDEOS_DIR
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-07 13:38 UTC by Andreas Henriksson
Modified: 2014-09-07 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Henriksson 2014-09-07 13:38:20 UTC
When running totem this warning can be seen:

(totem:14134): GLib-GIO-CRITICAL **: g_file_new_for_path: assertion 'path != NULL' failed

It seems to be caused by XDG_VIDEOS_DIR being unset on my system and the "save-file" totem plugin not handling the g_get_user_special_dir call returning NULL properly in two places.


totem-3.13.92$ grep -A 2 g_get_user_special_dir src/plugins/save-file/*
src/plugins/save-file/totem-save-file.c:		dest_path = g_build_filename (g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS), filename, NULL);
src/plugins/save-file/totem-save-file.c-		dest_uri = g_filename_to_uri (dest_path, NULL, NULL);
src/plugins/save-file/totem-save-file.c-		g_free (dest_path);
--
src/plugins/save-file/totem-save-file.c:	videos_dir = g_file_new_for_path (g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS));
src/plugins/save-file/totem-save-file.c-	if (file_has_ancestor (file, videos_dir)) {
src/plugins/save-file/totem-save-file.c-		g_debug ("Not enabling offline save, as '%s' already in ~/Videos", mrl);

(Also notice the hard-coded path in the debug output could be changed to use %s and videos_dir to say the correct directory.)