From 1d1a19f4d0914a6a4fafe68fcd35ef55855ac28e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 10 Jul 2010 16:25:00 -0600 Subject: [PATCH 1/4] Upgrade to Qt 4.6.3 in linux binary builds --- setup/installer/linux/freeze.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup/installer/linux/freeze.py b/setup/installer/linux/freeze.py index 8c56ed4fb7..382c7ffeee 100644 --- a/setup/installer/linux/freeze.py +++ b/setup/installer/linux/freeze.py @@ -40,6 +40,7 @@ class LinuxFreeze(Command): '/usr/bin/pdftohtml', '/usr/lib/libwmflite-0.2.so.7', '/usr/lib/liblcms.so.1', + '/usr/lib/liblcms2.so.2', '/usr/lib/libstlport.so.5.1', '/tmp/calibre-mount-helper', '/usr/lib/libunrar.so', @@ -50,10 +51,9 @@ class LinuxFreeze(Command): '/usr/lib/libpodofo.so.0.8.1', '/lib/libz.so.1', '/lib/libuuid.so.1', - '/usr/lib/libtiff.so.3', + '/usr/lib/libtiff.so.5', '/lib/libbz2.so.1', - '/usr/lib/libpoppler.so.5', - '/usr/lib/libpoppler-qt4.so.3', + '/usr/lib/libpoppler.so.6', '/usr/lib/libxml2.so.2', '/usr/lib/libopenjpeg.so.2', '/usr/lib/libxslt.so.1', @@ -62,10 +62,10 @@ class LinuxFreeze(Command): '/usr/lib/libgthread-2.0.so.0', stdcpp, ffi, - '/usr/lib/libpng12.so.0', + '/usr/lib/libpng14.so.14', '/usr/lib/libexslt.so.0', - '/usr/lib/libMagickWand.so.2', - '/usr/lib/libMagickCore.so.2', + '/usr/lib/libMagickWand.so.3', + '/usr/lib/libMagickCore.so.3', '/usr/lib/libgcrypt.so.11', '/usr/lib/libgpg-error.so.0', '/usr/lib/libphonon.so.4', From 30436a9e6aa58ff5009733ccbb9f71519d8e4ffb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Jul 2010 09:28:27 -0600 Subject: [PATCH 2/4] Fix #6100 (Improved aldiko support) --- src/calibre/devices/android/driver.py | 10 ++++++++++ src/calibre/devices/usbms/device.py | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index 5642235b31..9951dc57ad 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -70,6 +70,16 @@ class ANDROID(USBMS): dirs = [x.strip() for x in dirs.split(',')] self.EBOOK_DIR_MAIN = dirs + def get_main_ebook_dir(self, for_upload=False): + dirs = self.EBOOK_DIR_MAIN + if not for_upload: + def aldiko_tweak(x): + return 'eBooks' if x == 'eBooks/import' else x + if isinstance(dirs, basestring): + dirs = [dirs] + dirs = list(map(aldiko_tweak, dirs)) + return dirs + class S60(USBMS): name = 'S60 driver' diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 55790420f2..c07b7fd761 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -732,7 +732,7 @@ class Device(DeviceConfig, DevicePlugin): traceback.print_exc() self._main_prefix = self._card_a_prefix = self._card_b_prefix = None - def get_main_ebook_dir(self): + def get_main_ebook_dir(self, for_upload=False): return self.EBOOK_DIR_MAIN def _sanity_check(self, on_card, files): @@ -750,7 +750,7 @@ class Device(DeviceConfig, DevicePlugin): path = os.path.join(self._card_b_prefix, *(self.EBOOK_DIR_CARD_B.split('/'))) else: - candidates = self.get_main_ebook_dir() + candidates = self.get_main_ebook_dir(for_upload=True) if isinstance(candidates, basestring): candidates = [candidates] candidates = [ From ba94ea9670eb7010328d721830881199cee1a842 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Jul 2010 09:47:41 -0600 Subject: [PATCH 3/4] oops --- src/calibre/gui2/convert/structure_detection.ui | 6 +----- src/calibre/gui2/custom_column_widgets.py | 9 ++------- src/calibre/gui2/library/delegates.py | 8 ++++---- src/calibre/gui2/library/models.py | 4 +--- src/calibre/library/caches.py | 4 ++-- src/calibre/utils/date.py | 2 +- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/calibre/gui2/convert/structure_detection.ui b/src/calibre/gui2/convert/structure_detection.ui index 67fd0a31b2..e4414473f5 100644 --- a/src/calibre/gui2/convert/structure_detection.ui +++ b/src/calibre/gui2/convert/structure_detection.ui @@ -28,11 +28,7 @@ - - - 30 - - + diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index 58c2f15452..2a9c81e8ee 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -132,11 +132,9 @@ class DateEdit(QDateEdit): def focusInEvent(self, x): self.setSpecialValueText('') - QDateEdit.focusInEvent(self, x) def focusOutEvent(self, x): self.setSpecialValueText(_('Undefined')) - QDateEdit.focusOutEvent(self, x) class DateTime(Base): @@ -144,10 +142,7 @@ class DateTime(Base): self.widgets = [QLabel('&'+self.col_metadata['name']+':', parent), DateEdit(parent)] w = self.widgets[1] - format = self.col_metadata['display'].get('date_format','') - if not format: - format = 'dd MMM yyyy' - w.setDisplayFormat(format) + w.setDisplayFormat('dd MMM yyyy') w.setCalendarPopup(True) w.setMinimumDate(UNDEFINED_QDATE) w.setSpecialValueText(_('Undefined')) @@ -161,7 +156,7 @@ class DateTime(Base): def getter(self): val = self.widgets[1].date() - if val <= UNDEFINED_QDATE: + if val == UNDEFINED_QDATE: val = None else: val = qt_to_dt(val) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index 40f7a2e4e0..529055ecd2 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -96,7 +96,7 @@ class DateDelegate(QStyledItemDelegate): # {{{ def displayText(self, val, locale): d = val.toDate() - if d <= UNDEFINED_QDATE: + if d == UNDEFINED_QDATE: return '' return format_date(d.toPyDate(), 'dd MMM yyyy') @@ -116,7 +116,7 @@ class PubDateDelegate(QStyledItemDelegate): # {{{ def displayText(self, val, locale): d = val.toDate() - if d <= UNDEFINED_QDATE: + if d == UNDEFINED_QDATE: return '' format = tweaks['gui_pubdate_display_format'] if format is None: @@ -194,7 +194,7 @@ class CcDateDelegate(QStyledItemDelegate): # {{{ def displayText(self, val, locale): d = val.toDate() - if d <= UNDEFINED_QDATE: + if d == UNDEFINED_QDATE: return '' return format_date(d.toPyDate(), self.format) @@ -217,7 +217,7 @@ class CcDateDelegate(QStyledItemDelegate): # {{{ def setModelData(self, editor, model, index): val = editor.date() - if val <= UNDEFINED_QDATE: + if val == UNDEFINED_QDATE: val = None model.setData(index, QVariant(val), Qt.EditRole) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 89008735fe..9f1a72b021 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -1216,9 +1216,7 @@ class DeviceBooksModel(BooksModel): # {{{ return done def set_editable(self, editable): - # Cannot edit if metadata is sent on connect. Reason: changes will - # revert to what is in the library on next connect. - self.editable = editable and prefs['manage_device_metadata']!='on_connect' + self.editable = editable def set_search_restriction(self, s): pass diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index af950a36fc..d46ae23d90 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -209,13 +209,13 @@ class ResultCache(SearchQueryParser): if query == 'false': for item in self._data: if item is None: continue - if item[loc] is None or item[loc] <= UNDEFINED_DATE: + if item[loc] is None or item[loc] == UNDEFINED_DATE: matches.add(item[0]) return matches if query == 'true': for item in self._data: if item is None: continue - if item[loc] is not None and item[loc] > UNDEFINED_DATE: + if item[loc] is not None and item[loc] != UNDEFINED_DATE: matches.add(item[0]) return matches diff --git a/src/calibre/utils/date.py b/src/calibre/utils/date.py index b25940d23d..c5fba13f57 100644 --- a/src/calibre/utils/date.py +++ b/src/calibre/utils/date.py @@ -44,7 +44,7 @@ parse_date_day_first = compute_locale_info_for_parse_date() utc_tz = _utc_tz = tzutc() local_tz = _local_tz = SafeLocalTimeZone() -UNDEFINED_DATE = datetime(1000,1,1, tzinfo=utc_tz) +UNDEFINED_DATE = datetime(101,1,1, tzinfo=utc_tz) def parse_date(date_string, assume_utc=False, as_utc=True, default=None): ''' From de0aea0eb7630ed467997d66d15f7b6790b10483 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Jul 2010 09:52:15 -0600 Subject: [PATCH 4/4] Possible fix for conversion box being too wide --- src/calibre/gui2/convert/structure_detection.ui | 6 +++++- src/calibre/gui2/convert/xexp_edit.ui | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/convert/structure_detection.ui b/src/calibre/gui2/convert/structure_detection.ui index e4414473f5..2e97c0d3ca 100644 --- a/src/calibre/gui2/convert/structure_detection.ui +++ b/src/calibre/gui2/convert/structure_detection.ui @@ -28,7 +28,11 @@ - + + + 20 + + diff --git a/src/calibre/gui2/convert/xexp_edit.ui b/src/calibre/gui2/convert/xexp_edit.ui index 1b0196a8a1..f98eb8b1b8 100644 --- a/src/calibre/gui2/convert/xexp_edit.ui +++ b/src/calibre/gui2/convert/xexp_edit.ui @@ -43,6 +43,15 @@ 0 + + + 500 + 16777215 + + + + 30 +