Fix #6982 (Bulk import does not import all files)

This commit is contained in:
Kovid Goyal 2010-10-02 13:54:22 -06:00
parent 9b17ac6f69
commit 574e063864

View File

@ -3,6 +3,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
""" The GUI """ """ The GUI """
import os, sys, Queue, threading import os, sys, Queue, threading
from threading import RLock from threading import RLock
from urllib import unquote
from PyQt4.Qt import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt, \ from PyQt4.Qt import QVariant, QFileInfo, QObject, SIGNAL, QBuffer, Qt, \
QByteArray, QTranslator, QCoreApplication, QThread, \ QByteArray, QTranslator, QCoreApplication, QThread, \
@ -505,6 +506,11 @@ class FileDialog(QObject):
fs = QFileDialog.getOpenFileNames(parent, title, initial_dir, ftext, "") fs = QFileDialog.getOpenFileNames(parent, title, initial_dir, ftext, "")
for f in fs: for f in fs:
f = unicode(f) 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): if f and os.path.exists(f):
self.selected_files.append(f) self.selected_files.append(f)
else: else: