IGN:Fix stupid bug in implementation of is_ok_to_us_qt

This commit is contained in:
Kovid Goyal 2009-04-28 14:33:27 -07:00
parent c50e47fdd8
commit 02be6743ad
2 changed files with 4 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class USBMS(Device):
CAN_SET_METADATA = False CAN_SET_METADATA = False
def __init__(self, key='-1', log_packets=False, report_progress=None): def __init__(self, key='-1', log_packets=False, report_progress=None):
Device.__init__(self, key=key, log_packets=log_packets, Device.__init__(self, key=key, log_packets=log_packets,
report_progress=report_progress) report_progress=report_progress)
def get_device_information(self, end_session=True): def get_device_information(self, end_session=True):
@ -225,14 +225,14 @@ class USBMS(Device):
@classmethod @classmethod
def metadata_from_path(cls, path): def metadata_from_path(cls, path):
return metadata_from_formats([path]) return metadata_from_formats([path])
@classmethod @classmethod
def book_from_path(cls, path): def book_from_path(cls, path):
fileext = path_to_ext(path) fileext = path_to_ext(path)
mi = cls.metadata_from_path(path) mi = cls.metadata_from_path(path)
mime = mime_type_ext(fileext) mime = mime_type_ext(fileext)
authors = authors_to_string(mi.authors) authors = authors_to_string(mi.authors)
book = Book(path, mi.title, authors, mime) book = Book(path, mi.title, authors, mime)
return book return book

View File

@ -464,6 +464,7 @@ class Application(QApplication):
def __init__(self, args): def __init__(self, args):
qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args] qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args]
QApplication.__init__(self, qargs) QApplication.__init__(self, qargs)
global gui_thread
gui_thread = QThread.currentThread() gui_thread = QThread.currentThread()
self.translator = QTranslator(self) self.translator = QTranslator(self)
lang = get_lang() lang = get_lang()