Changeset 9610

Show
Ignore:
Timestamp:
05/11/08 01:21:28 (7 months ago)
Author:
js
Message:

Fix DnD FT on Windows:
* Fix helpers.py so URL is decoded correctly.
* Fix code in roster_window.py so the \0 that's alway the last file

on win32 is ignored.

This also fixes and closes #2398.

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/helpers.py

    r9585 r9610  
    586586 
    587587def get_file_path_from_dnd_dropped_uri(uri): 
    588         path = urllib.url2pathname(uri) # escape special chars 
     588        path = urllib.unquote(uri) # escape special chars 
    589589        path = path.strip('\r\n\x00') # remove \r\n and NULL 
    590590        # get the path to file 
    591         if path.startswith('file:\\\\\\'): # windows 
     591        if re.match('^file:///[a-zA-Z]:/', path): # windows 
    592592                path = path[8:] # 8 is len('file:///') 
    593593        elif path.startswith('file://'): # nautilus, rox 
  • trunk/src/roster_window.py

    r9607 r9610  
    37823782                        uri = data.strip() 
    37833783                        uri_splitted = uri.split() # we may have more than one file dropped 
     3784                        try: 
     3785                                uri_splitted.remove('\0') # This is always the last element in windows 
     3786                        except ValueError: 
     3787                                pass 
    37843788                        nb_uri = len(uri_splitted) 
    37853789                        # Check the URIs