Skip to content

Commit

Permalink
handle exception if client runs Calibre 6 or greater (this major rela…
Browse files Browse the repository at this point in the history
…se switched PyQt5 -> PyQt6)
  • Loading branch information
lb803 committed Apr 6, 2023
1 parent b41533f commit 7242594
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ def __init__(self, *args, **kwargs):
super(Completer, self).__init__(*args, **kwargs)
self.setFilterMode(Qt.MatchContains)
self.setCaseSensitivity(Qt.CaseInsensitive)
self.setCompletionMode(QCompleter.PopupCompletion)
try:
self.setCompletionMode(QCompleter.PopupCompletion)
except AttributeError:
# running calibre v 6.x.x or greater
self.setCompletionMode(QCompleter.CompletionMode.PopupCompletion)


# Add texts instead of replace
Expand Down

0 comments on commit 7242594

Please sign in to comment.