mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix opening the MTP config dialog without a device connected broken in calibre 5
This commit is contained in:
parent
bdb403fc1c
commit
92a692af2d
@ -446,7 +446,7 @@ class MTPConfig(QTabWidget):
|
|||||||
|
|
||||||
def get_pref(self, key):
|
def get_pref(self, key):
|
||||||
p = self.device.prefs.get(self.current_device_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
|
self.device.prefs[self.current_device_key] = p
|
||||||
return self.device.get_pref(key)
|
return self.device.get_pref(key)
|
||||||
|
|
||||||
@ -490,7 +490,8 @@ class MTPConfig(QTabWidget):
|
|||||||
if self.current_ignored_folders != self.initial_ignored_folders:
|
if self.current_ignored_folders != self.initial_ignored_folders:
|
||||||
p['ignored_folders'] = self.current_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):
|
class SendError(QDialog):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user