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 536500 - Podcast download location file chooser never set to correct directory
Podcast download location file chooser never set to correct directory
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Podcast
0.11.x
Other All
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 526495 (view as bug list)
Depends on:
Blocks: 357768
 
 
Reported: 2008-06-03 20:37 UTC by Michel Alexandre Salim
Modified: 2008-09-12 12:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patches sources/rb-podcast-source.c to set file chooser correctly (582 bytes, patch)
2008-06-03 20:38 UTC, Michel Alexandre Salim
needs-work Details | Review
Make sure URI from file chooser is saved to GConf as a URI and not a path (669 bytes, patch)
2008-06-20 07:15 UTC, Michel Alexandre Salim
none Details | Review

Description Michel Alexandre Salim 2008-06-03 20:37:41 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
Comment 1 Michel Alexandre Salim 2008-06-03 20:38:45 UTC
Created attachment 112079 [details] [review]
Patches sources/rb-podcast-source.c to set file chooser correctly
Comment 2 Jonathan Matthew 2008-06-07 02:42:01 UTC
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.
Comment 3 Jonathan Matthew 2008-06-07 03:51:41 UTC
*** Bug 526495 has been marked as a duplicate of this bug. ***
Comment 4 Michel Alexandre Salim 2008-06-20 06:10:41 UTC
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?
Comment 5 Michel Alexandre Salim 2008-06-20 07:10:29 UTC
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?
Comment 6 Michel Alexandre Salim 2008-06-20 07:15:24 UTC
Created attachment 113097 [details] [review]
Make sure URI from file chooser is saved to GConf as a URI and not a path
Comment 7 Michel Alexandre Salim 2008-08-02 19:36:15 UTC
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)
Comment 8 Bastien Nocera 2008-08-08 14:33:01 UTC
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.
Comment 9 Jonathan Matthew 2008-09-07 11:13:58 UTC
I've fixed the above issues and committed the result.  The patch as it was didn't apply at all after the gio port.
Comment 10 Jonathan Matthew 2008-09-11 09:47:11 UTC
I didn't fix this completely: if the gconf key specifies a path rather than a URI, we need to update it on startup.
Comment 11 Jonathan Matthew 2008-09-12 12:08:59 UTC
OK, that bit's done, so I'm closing this again.