fix encoding issues where the users filesystem isn't utf-8 (needs testing)
This commit is contained in:
parent
5b0f93ba72
commit
acba442ddb
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
import sys
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import os.path
|
import os.path
|
||||||
import gobject
|
import gobject
|
||||||
|
@ -158,8 +159,10 @@ class CreateTorrentDialog:
|
||||||
chooser.destroy()
|
chooser.destroy()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
path = result.decode('utf-8').encode(sys.getfilesystemencoding())
|
||||||
|
|
||||||
self.files_treestore.clear()
|
self.files_treestore.clear()
|
||||||
self.files_treestore.append(None, [result, gtk.STOCK_FILE, deluge.common.get_path_size(result)])
|
self.files_treestore.append(None, [result, gtk.STOCK_FILE, deluge.common.get_path_size(path)])
|
||||||
self.adjust_piece_size()
|
self.adjust_piece_size()
|
||||||
chooser.destroy()
|
chooser.destroy()
|
||||||
|
|
||||||
|
@ -184,9 +187,10 @@ class CreateTorrentDialog:
|
||||||
chooser.destroy()
|
chooser.destroy()
|
||||||
return
|
return
|
||||||
|
|
||||||
self.files_treestore.clear()
|
path = result.decode('utf-8').encode(sys.getfilesystemencoding())
|
||||||
|
|
||||||
self.files_treestore.append(None, [result, gtk.STOCK_OPEN, deluge.common.get_path_size(result)])
|
self.files_treestore.clear()
|
||||||
|
self.files_treestore.append(None, [result, gtk.STOCK_OPEN, deluge.common.get_path_size(path)])
|
||||||
self.adjust_piece_size()
|
self.adjust_piece_size()
|
||||||
chooser.destroy()
|
chooser.destroy()
|
||||||
|
|
||||||
|
@ -328,7 +332,7 @@ class CreateTorrentDialog:
|
||||||
self.glade.get_widget("progress_dialog").hide_all()
|
self.glade.get_widget("progress_dialog").hide_all()
|
||||||
|
|
||||||
deferToThread(self.create_torrent,
|
deferToThread(self.create_torrent,
|
||||||
path,
|
path.decode('utf-8').encode(sys.getfilesystemencoding()),
|
||||||
tracker,
|
tracker,
|
||||||
piece_length,
|
piece_length,
|
||||||
self._on_create_torrent_progress,
|
self._on_create_torrent_progress,
|
||||||
|
|
Loading…
Reference in New Issue