Fix regression in database moving code

This commit is contained in:
Kovid Goyal 2008-03-27 02:35:19 +00:00
parent a80e06fbdb
commit 222d3fa2f3

View File

@ -849,13 +849,14 @@ class Main(MainWindow, Ui_MainWindow):
db = LibraryDatabase(newloc) db = LibraryDatabase(newloc)
db.close() db.close()
except Exception, err: except Exception, err:
traceback.print_exc()
d = error_dialog(self, _('Invalid database'), d = error_dialog(self, _('Invalid database'),
_('<p>An invalid database already exists at %s, delete it before trying to move the existing database.<br>Error: %s')%(newloc, str(err))) _('<p>An invalid database already exists at %s, delete it before trying to move the existing database.<br>Error: %s')%(newloc, str(err)))
d.exec_()
newloc = self.database_path newloc = self.database_path
self.database_path = newloc self.database_path = newloc
settings = Settings() settings = Settings()
settings.setValue("database path", QVariant(self.database_path)) settings.setValue("database path", QVariant(self.database_path))
os.unlink(src.name)
except Exception, err: except Exception, err:
traceback.print_exc() traceback.print_exc()
d = error_dialog(self, _('Could not move database'), unicode(err)) d = error_dialog(self, _('Could not move database'), unicode(err))