Fix bugs in database migration logic

This commit is contained in:
Kovid Goyal 2008-02-08 00:59:54 +00:00
parent df8f2d88d0
commit 50c484fc35

View File

@ -688,7 +688,11 @@ class Main(MainWindow, Ui_MainWindow):
try:
newloc = os.path.join(d.database_location, os.path.basename(self.database_path))
if not os.path.exists(newloc):
dirname = os.path.dirname(newloc)
if not os.path.isdir(dirname):
os.makedirs(dirname)
dest = open(newloc, 'wb')
if os.access(self.database_path, os.R_OK):
self.status_bar.showMessage('Copying database to '+newloc)
self.setCursor(Qt.BusyCursor)
self.library_view.setEnabled(False)