Skip to content

Commit

Permalink
Fixed directory finding in Add books dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
brookite committed Sep 6, 2022
1 parent 4e6f5a7 commit d196102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/appinfo.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION_NAME = "1.0 RC1"
BUILD_NUMBER = 1143
BUILD_NUMBER = 1144
7 changes: 6 additions & 1 deletion app/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@ def import_backup(self):
self.close()

def add_books(self):
default_dir = "" if len(self.settings.book_paths) == 0 else self.settings.book_paths[0]
default_dir = ""
for directory in self.settings.book_paths:
if os.path.isdir(directory):
default_dir = directory
break

filenames = QFileDialog.getOpenFileNames(
self, tr("Adding books"), default_dir,
SUPPORTED_FORMATS_NAMES
Expand Down

0 comments on commit d196102

Please sign in to comment.