GNOME Bugzilla – Bug 536500
Podcast download location file chooser never set to correct directory
Last modified: 2008-09-12 12:08:59 UTC
Please describe the problem: The file chooser (Edit->Preferences->Podcasts, Download location) always displays the current directory (the home directory if launched from the application menu; otherwise, the current directory on the shell), rather than the actual directory set in the gconf key. This is because the file chooser was accessed using gtk_file_chooser_set_current_folder_uri, but given a file path instead. The boolean return value is never checked and thus the error escapes unnoticed. Using gtk_file_chooser_set_current_folder rather than the _uri variant fixes this. Steps to reproduce: 1. Navigate to the Podcasts tab as described above 2. Note the download location listed in file chooser 3. Repeat, this time launching Rhythmbox from a different directory Actual results: File chooser shows the current working directory Expected results: File chooser shows the podcast download directory Does this happen every time? Yes Other information: Patch attached, done against rhythmbox-0.11.5
Created attachment 112079 [details] [review] Patches sources/rb-podcast-source.c to set file chooser correctly
It works correctly here. Does your podcast download directory have a space in its path or something? Also, I think it would be better to store a URI in gconf.
*** Bug 526495 has been marked as a duplicate of this bug. ***
Nope; no spaces. Here is what the key contains: download_prefix = /local/data/michel/Podcasts I agree that storing a URI is better; the problem is, right now Rhythmbox is storing the directory as a string, but reading it as an URI (and throwing away any failure indication). Would you accept a patch that makes sure the path is stored as a URI?
I can confirm that setting the GConf key manually to an URI (prepending file://) temporarily fixes the problem. However, using the file chooser to then change the Podcast folder reintroduces the issue (a path get saved, rather than the URI). This is the culprit (in a pristine 0.11.5 tarball, so it's not a distribution issue. Wonder how it's not reproducible on your machine, that's a bit bizarre): static void rb_podcast_source_btn_file_change_cb (GtkFileChooserButton *widget, const char *key) { char *uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (widget)); eel_gconf_set_string (key, gnome_vfs_get_local_path_from_uri (uri)); g_free (uri); } the URI is retrieved from the file chooser (I've also confirmed that this work using PyGTK). *BUT* it gets converted to a local path before being saved to GConf. Why?
Created attachment 113097 [details] [review] Make sure URI from file chooser is saved to GConf as a URI and not a path
Could someone make a decision whether to merge the patch or not, and if not, to provide a rationale for it? 0.11.6 has been released with the same bug, and we don't want to miss the window for the autumn releases of Linux distributions (Fedora 10 and Ubuntu 8.10)
In rb_podcast_manager_db_entry_deleted_cb() (under podcast/): /* try to remove the directory * (will only work once it's empty) */ You'll need to make use of a URI as well. The schema needs to be updated to mention that we have a URI, not a file path. rb_podcast_manager_get_podcast_dir() would need to set a URI as well.
I've fixed the above issues and committed the result. The patch as it was didn't apply at all after the gio port.
I didn't fix this completely: if the gconf key specifies a path rather than a URI, we need to update it on startup.
OK, that bit's done, so I'm closing this again.