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 358638 - network browsing doesn't work
network browsing doesn't work
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: file-chooser
2.16.x
Other All
: Normal major
: future
Assigned To: Federico Mena Quintero
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2006-09-30 22:54 UTC by Jan de Groot
Modified: 2006-10-05 18:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Patch to fix the problem (1.33 KB, patch)
2006-09-30 22:56 UTC, Jan de Groot
accepted-commit_now Details | Review
patch adjusted for the branch (2.11 KB, patch)
2006-10-05 10:38 UTC, Kjartan Maraas
committed Details | Review
Use tmpsize instead of strlen(tmp) (HEAD branch) (1.22 KB, patch)
2006-10-05 18:09 UTC, Jan de Groot
none Details | Review
same patch for cancelation-changes branch (1.09 KB, patch)
2006-10-05 18:10 UTC, Jan de Groot
none Details | Review

Description Jan de Groot 2006-09-30 22:54:10 UTC
Network browsing from the libgnomeui filechooser plugin doesn't work. As stated by someone on desktop-devel-list, this is because g_keyfile is used to load a local file, which isn't possible when it's about a virtual gnomevfs URI like smblink-root.desktop.
Comment 1 Jan de Groot 2006-09-30 22:56:49 UTC
Created attachment 73723 [details] [review]
Patch to fix the problem

Instead of resolving the uri to a local file and feeding to g_keyfile_load_from_file, just read the file using gnomevfs and feed it to g_keyfile_load_from_data.
Comment 2 Federico Mena Quintero 2006-10-04 17:42:44 UTC
Thanks for the patch, Jan :)

This is the right solution in the short term.  The long-term approach is to make those operations asynchronous.

The patch is good to go for 2.16; please commit it to HEAD with a ChangeLog.  For extra brownie points, please commit it to the "cancelation-changes" branch as well :)

Thanks again!
Comment 3 Jan de Groot 2006-10-04 18:20:37 UTC
I don't have commit access to CVS/SVN, so one of the gnome developers has to do it.
Comment 4 Kjartan Maraas 2006-10-05 10:21:00 UTC
Commited. Thanks.
Comment 5 Kjartan Maraas 2006-10-05 10:38:29 UTC
Created attachment 74044 [details] [review]
patch adjusted for the branch

Attaching the patch I commited on the branch for good measure. I had to apply it by hand since there were conflicts.
Comment 6 Kjartan Maraas 2006-10-05 10:45:12 UTC
Btw, I think both calls to gnome_vfs_read_entire_file() should have &tmpsize and not tmpsize, I commited this slight fix to both branches since the patch as it stands causes warnings.
Comment 7 Jan de Groot 2006-10-05 11:08:54 UTC
I think that also explains the corruption I had when passing tmpsize as length to g_keyfile_load_from_data. In that case the strlen would be useless and tmpsize can  be used I guess.
Comment 8 Christian Persch 2006-10-05 11:19:45 UTC
Won't this hang the whole app while trying to retrieve the desktop file from the remote server?

Also, why is this marked FIXED? Comment 2 says that the right thing is to
make those operations asynchronous.
Comment 9 Jan de Groot 2006-10-05 11:26:58 UTC
I don't know how gnomevfs creates these .desktop files, but if it creates them in-memory on the fly, it shouldn't matter much: as the .desktop file is in-memory at that moment, gnomevfs should be able to read it instantly and pass it to g_keyfile_load_from_data. AFAIK it's gnomevfs that creates these virtual files, allocates memory for it while scanning network shares, etc. After that, the files are read completely from memory, so the blocking part happens before the read process.
Comment 10 Jan de Groot 2006-10-05 18:09:25 UTC
Created attachment 74071 [details] [review]
Use tmpsize instead of strlen(tmp) (HEAD branch)
Comment 11 Jan de Groot 2006-10-05 18:10:31 UTC
Created attachment 74073 [details] [review]
same patch for cancelation-changes branch