mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1887536 [Automatic book adding indexerror](https://bugs.launchpad.net/calibre/+bug/1887536)
This commit is contained in:
parent
06f69ee170
commit
6fe1a1dd91
@ -151,6 +151,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
if path != gprefs['auto_add_path']:
|
if path != gprefs['auto_add_path']:
|
||||||
if path:
|
if path:
|
||||||
path = os.path.abspath(path)
|
path = os.path.abspath(path)
|
||||||
|
bname = os.path.basename(path)
|
||||||
self.opt_auto_add_path.setText(path)
|
self.opt_auto_add_path.setText(path)
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
error_dialog(self, _('Invalid folder'),
|
error_dialog(self, _('Invalid folder'),
|
||||||
@ -163,7 +164,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
_('You do not have read/write permissions for '
|
_('You do not have read/write permissions for '
|
||||||
'the folder: %s')%path, show=True)
|
'the folder: %s')%path, show=True)
|
||||||
raise AbortCommit('invalid auto-add folder')
|
raise AbortCommit('invalid auto-add folder')
|
||||||
if os.path.basename(path)[0] in '._':
|
if bname and bname[0] in '._':
|
||||||
error_dialog(self, _('Invalid folder'),
|
error_dialog(self, _('Invalid folder'),
|
||||||
_('Cannot use folders whose names start with a '
|
_('Cannot use folders whose names start with a '
|
||||||
'period or underscore: %s')%os.path.basename(path), show=True)
|
'period or underscore: %s')%os.path.basename(path), show=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user