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 132500 - Location entry should do tilde expansion
Location entry should do tilde expansion
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.3.x
Other All
: Normal normal
: Small feature
Assigned To: Federico Mena Quintero
gedit QA volunteers
: 136167 136770 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-25 20:10 UTC by Matt T. Proud
Modified: 2008-05-14 02:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch with fix, untested for the VFS backend (5.29 KB, patch)
2004-03-18 22:06 UTC, Federico Mena Quintero
none Details | Review
Updated patch. (6.70 KB, patch)
2004-03-19 16:53 UTC, Federico Mena Quintero
committed Details | Review

Description Matt T. Proud 2004-01-25 20:10:25 UTC
Open gedit with a blank document; type in "asdf" into the box.
Proceed with a "File=>Save As"
In the "Filename:" box, type "~/asdf "
Click "Save"
Await a dialog stating: Could not save the file "/home/matt/~/asdf".

This behavior seems quite strange, for I can use "." and ".." in the
"Filename:" box.
Comment 1 Paolo Borelli 2004-02-09 18:47:09 UTC
I'm moving this to gtk+ (GtkFileChoser) since also eog seems to not be
able to save an image as ~/my_image.png.
Comment 2 Federico Mena Quintero 2004-03-02 01:31:05 UTC
Now that the file chooser uses an auxiliary dialog for the location
entry, I'm retitling this bug.

The location entry should support tilde expansion, as in typing
"~/foo.txt", "~username/foo.txt".
Comment 3 Darren Adams 2004-03-04 12:14:42 UTC
*** Bug 136167 has been marked as a duplicate of this bug. ***
Comment 4 Federico Mena Quintero 2004-03-10 17:19:26 UTC
*** Bug 136770 has been marked as a duplicate of this bug. ***
Comment 5 Federico Mena Quintero 2004-03-18 22:06:23 UTC
Created attachment 25784 [details] [review]
Patch with fix, untested for the VFS backend
Comment 6 Federico Mena Quintero 2004-03-18 22:07:13 UTC
The attached patch fixes this, and works fine with the Unix backend. 
I haven't tested it with the gnome-vfs backend; will do so after lunch.
Comment 7 Federico Mena Quintero 2004-03-19 16:53:25 UTC
Attaching another patch.  This one puts the expansion logic in
GtkFileSystem::parse, and makes GtkFileChooserEntry have the necessary
checks for an "invalid" intermediate state.
Comment 8 Federico Mena Quintero 2004-03-19 16:53:54 UTC
Created attachment 25810 [details] [review]
Updated patch.
Comment 9 Federico Mena Quintero 2004-04-06 01:25:49 UTC
JRB, can you please take a look at this?
Comment 10 Jonathan Blandford 2004-04-06 21:23:44 UTC
It looked good to me -- I like the fact that you moved the ~ expansion code
totally to the filesystem.  Two quick thoughts
1) it needs to be ported to the libgnomeui backend too
2) you need a g_return_if_fail (str !=NULL) in gtk_file_system_parse().
Comment 11 Federico Mena Quintero 2004-04-07 18:03:27 UTC
Thanks, committed.  It turns out that the VFS backend already did tilde
expansion on its own.
Comment 12 Morten Welinder 2004-04-08 01:16:58 UTC
/me brings out the evil eye...

Is there a reason it disallows "~" or "~foo"?

And why does it specifically allow "~nouser/oink"?

Finally, I don't think it returns the expected value if the home directory is "/".
(And what if it isn't absolute?)
Comment 13 Federico Mena Quintero 2004-04-14 16:49:49 UTC
Let's try to do this for 2.4.2.  I'm not sure we can do it with the current
GtkFileSystem API.

I'm lowering the priority because although those cases don't work, you *can*
still access those folders by other means --- type "~/" or "~foo/", or hit
Alt-Home in the first case.
Comment 14 Elijah Newren 2004-06-19 18:44:01 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.