From 99e238f90ed976de2a423929aa57b361476dab82 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Aug 2010 10:01:51 -0600 Subject: [PATCH] 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 --- src/calibre/gui2/dialogs/choose_library.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/choose_library.py b/src/calibre/gui2/dialogs/choose_library.py index f53f617448..c3d5a1d26d 100644 --- a/src/calibre/gui2/dialogs/choose_library.py +++ b/src/calibre/gui2/dialogs/choose_library.py @@ -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