mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Correct some problems with setting the ondevice column values when the device is disconnected.
This commit is contained in:
parent
67d570de1c
commit
0d57a3fb18
@ -1294,7 +1294,8 @@ class DeviceMixin(object): # {{{
|
|||||||
self.book_db_uuid_path_map = None
|
self.book_db_uuid_path_map = None
|
||||||
return
|
return
|
||||||
|
|
||||||
if not hasattr(self, 'db_book_uuid_cache'):
|
if not self.device_manager.is_device_connected or \
|
||||||
|
not hasattr(self, 'db_book_uuid_cache'):
|
||||||
return loc
|
return loc
|
||||||
|
|
||||||
if self.book_db_id_cache is None:
|
if self.book_db_id_cache is None:
|
||||||
|
@ -125,7 +125,7 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
|
|
||||||
def refresh_ondevice(self):
|
def refresh_ondevice(self):
|
||||||
self.db.refresh_ondevice()
|
self.db.refresh_ondevice()
|
||||||
self.resort()
|
self.refresh(reset=False)
|
||||||
self.research()
|
self.research()
|
||||||
|
|
||||||
def set_book_on_device_func(self, func):
|
def set_book_on_device_func(self, func):
|
||||||
|
@ -579,10 +579,7 @@ class BuiltinOndevice(BuiltinFormatterFunction):
|
|||||||
|
|
||||||
def evaluate(self, formatter, kwargs, mi, locals):
|
def evaluate(self, formatter, kwargs, mi, locals):
|
||||||
if mi.ondevice_col:
|
if mi.ondevice_col:
|
||||||
try:
|
|
||||||
return _('Yes')
|
return _('Yes')
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
class BuiltinFirstNonEmpty(BuiltinFormatterFunction):
|
class BuiltinFirstNonEmpty(BuiltinFormatterFunction):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user