SQL delete needs firmware check for older Kobo firmare

Kobo driver: Fix a regression when deleting empty shelves on Kobo devices with older firmware.
Fixes #1192441 [Private bug](https://bugs.launchpad.net/calibre/+bug/1192441)

As reported here,
http://www.mobileread.com/forums/showthread.php?t=214760, if the Kobo
device is using firmware before 2.5.0, it doesn't have the Activity
table. The delete from this table when maintaining shelves needs a
version check around it.
This commit is contained in:
David Forrester 2013-06-19 14:23:43 +10:00 committed by Kovid Goyal
parent 07c935b700
commit 0e14d36438

View File

@ -1880,7 +1880,7 @@ class KOBOTOUCH(KOBO):
# Remove any entries for the Activity table - removes tile from new home page
if self.has_activity_table():
debug_print('KoboTouch:delete_via_sql: detete from Activity')
debug_print('KoboTouch:delete_via_sql: delete from Activity')
cursor.execute('delete from Activity where Id =?', t)
connection.commit()
@ -2391,7 +2391,8 @@ class KOBOTOUCH(KOBO):
cursor = connection.cursor()
cursor.execute(delete_query)
cursor.execute(update_query)
cursor.execute(delete_activity_query)
if self.has_activity_table():
cursor.execute(delete_activity_query)
connection.commit()
cursor.close()