From 574e063864ddee719efffa155e87391286ac0a9b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 2 Oct 2010 13:54:22 -0600 Subject: [PATCH] Fix #6982 (Bulk import does not import all files) --- src/calibre/gui2/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 1b0027dcc2..47bb61a7dc 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -3,6 +3,7 @@ __copyright__ = '2008, Kovid Goyal ' """ The GUI """ import os, sys, Queue, threading from threading import RLock +from urllib import unquote from PyQt4.Qt import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt, \ QByteArray, QTranslator, QCoreApplication, QThread, \ @@ -505,6 +506,11 @@ class FileDialog(QObject): fs = QFileDialog.getOpenFileNames(parent, title, initial_dir, ftext, "") for f in fs: f = unicode(f) + if not f: continue + if not os.path.exists(f): + # QFileDialog for some reason quotes spaces + # on linux if there is more than one space in a row + f = unquote(f) if f and os.path.exists(f): self.selected_files.append(f) else: