Skip to content

Commit

Permalink
Fix opening the MTP config dialog without a device connected broken i…
Browse files Browse the repository at this point in the history
…n calibre 5
  • Loading branch information
kovidgoyal committed Nov 6, 2020
1 parent bdb403f commit 92a692a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/calibre/gui2/device_drivers/mtp_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def ignore_device(self):

def get_pref(self, key):
p = self.device.prefs.get(self.current_device_key, {})
if not p:
if not p and self.current_device_key is not None:
self.device.prefs[self.current_device_key] = p
return self.device.get_pref(key)

Expand Down Expand Up @@ -490,7 +490,8 @@ def commit(self):
if self.current_ignored_folders != self.initial_ignored_folders:
p['ignored_folders'] = self.current_ignored_folders

self.device.prefs[self.current_device_key] = p
if self.current_device_key is not None:
self.device.prefs[self.current_device_key] = p


class SendError(QDialog):
Expand Down

0 comments on commit 92a692a

Please sign in to comment.