Browse Source

backups: fix unicode handling in passphrase and backup path

Convert from QString to unicode, not str object.
Marek Marczykowski-Górecki 10 years ago
parent
commit
53433bc47d
3 changed files with 6 additions and 6 deletions
  1. 2 2
      qubesmanager/backup.py
  2. 1 1
      qubesmanager/backup_utils.py
  3. 3 3
      qubesmanager/restore.py

+ 2 - 2
qubesmanager/backup.py

@@ -286,9 +286,9 @@ class BackupVMsWindow(Ui_Backup, QWizard):
         msg = []
 
         try:
-            backup.backup_do(str(self.dir_line_edit.text()),
+            backup.backup_do(unicode(self.dir_line_edit.text()),
                     self.files_to_backup,
-                    str(self.passphrase_line_edit.text()),
+                    unicode(self.passphrase_line_edit.text()),
                     progress_callback=self.update_progress_bar,
                     encrypted=self.encryption_checkbox.isChecked(),
                     appvm=self.target_appvm)

+ 1 - 1
qubesmanager/backup_utils.py

@@ -240,7 +240,7 @@ def select_path_button_clicked(dialog, select_file = False):
                                         else '/')
 
     if new_path != None:
-        new_path = str(new_path)
+        new_path = unicode(new_path)
         if os.path.basename(new_path) == 'qubes.xml':
             backup_location = os.path.dirname(new_path)
         else:

+ 3 - 3
qubesmanager/restore.py

@@ -138,8 +138,8 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
 
         try:
             self.vms_to_restore = backup.backup_restore_prepare(
-                    str(self.dir_line_edit.text()),
-                    str(self.passphrase_line_edit.text()),
+                    unicode(self.dir_line_edit.text()),
+                    unicode(self.passphrase_line_edit.text()),
                     options=self.restore_options,
                     host_collection=self.qvm_collection,
                     encrypted=self.encryption_checkbox.isChecked(),
@@ -276,7 +276,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
         self.done(0)
 
     def has_selected_dir(self):
-        backup_location = str(self.dir_line_edit.text())
+        backup_location = unicode(self.dir_line_edit.text())
         if not backup_location:
             return False
         if self.appvm_combobox.currentIndex() == 0: