Guy Harris wrote:
On Sat, Jan 31, 2004 at 07:34:12PM +0100, Ulf Lamping wrote:
Although I just used plain GTK mechanisms (working on win32 both GTK
version 1 and 2),
it might not be working on other platforms.
Especially the string format of the dragged target filename might differ
on the various platforms.
At least with KDE 3.0's file manager/Web browser Konqueror, file name
URI's appear to be of the form
file:/foo/bar/...
so that only "file:" should be stripped off. I've checked in a change
to do that, and can now drop capture files from Konqueror into Ethereal.
Perhaps we should look for "file:" followed by an arbitrary number of
"/"s, and, at least on UNIX, strip off all but the last "/".
I've checked in some explanations of the different URI syntax on Win32
and UNIX sytems.
What I completely forgotten was: URI's can have escaped characters in
them, to quote the comment I added about this:
* we have to replace escaped chars to their equivalents,
* e.g. %20 (always a two digit hexstring) -> ' '
* the percent character itself '%' is escaped be a double one "%%"
This is especially true for spaces in filenames (often used in Win32
systems).
I've added the mechanism for unescaping the chars, and split the whole
conversion URI to filename code
into the new function: dnd_uri2filename() as this conversion was
becoming a bit too long.
Removed the comment about "possibly absolute pathnames" as this will be
always be an absolute pathname,
as there is no relation between the source and destination (working dir)
of a DND transfer,
the whole information of the DND transfer must be in the DND data for
that reason IMHO.
Regards, ULFL