When choosing new library location, if no location is selected and OK is clicked, don't try to use the home directory as the location

This commit is contained in:
Kovid Goyal 2010-08-03 10:01:51 -06:00
parent 551a1ca272
commit 99e238f90e

View File

@ -75,7 +75,11 @@ class ChooseLibrary(QDialog, Ui_Dialog):
action = 'existing'
elif self.empty_library.isChecked():
action = 'new'
loc = os.path.abspath(unicode(self.location.text()).strip())
text = unicode(self.location.text()).strip()
if not text:
return error_dialog(self, _('No location'), _('No location selected'),
show=True)
loc = os.path.abspath()
if not loc or not os.path.exists(loc) or not self.check_action(action,
loc):
return