diff --git a/gramps/cli/grampscli.py b/gramps/cli/grampscli.py index 5b75004df..0caec8cb6 100644 --- a/gramps/cli/grampscli.py +++ b/gramps/cli/grampscli.py @@ -174,7 +174,6 @@ class CLIDbLoader: try: self.dbstate.db.load(filename, self._pulse_progress, mode) - self.dbstate.db.set_save_path(filename) except DbEnvironmentError as msg: self.dbstate.no_database() self._errordialog(_("Cannot open database"), str(msg)) @@ -307,11 +306,6 @@ class CLIManager: if title: name = title - # This method is for UI stuff when the database has changed. - # Window title, recent files, etc related to new file. - - self.dbstate.db.set_save_path(filename) - # apply preferred researcher if loaded file has none res = self.dbstate.db.get_researcher() owner = get_researcher() diff --git a/gramps/gen/db/base.py b/gramps/gen/db/base.py index 77e1f6b6c..d4940a757 100644 --- a/gramps/gen/db/base.py +++ b/gramps/gen/db/base.py @@ -1404,12 +1404,6 @@ class DbReadBase: """ raise NotImplementedError - def set_save_path(self, path): - """ - Set the save path for the database. - """ - raise NotImplementedError - def get_dbid(self): """ A unique ID for this database on this computer. diff --git a/gramps/gen/db/dummydb.py b/gramps/gen/db/dummydb.py index 884cbff91..7e16f2698 100644 --- a/gramps/gen/db/dummydb.py +++ b/gramps/gen/db/dummydb.py @@ -1630,13 +1630,6 @@ class DummyDb(M_A_M_B("NewBaseClass", (DbReadBase, Callback, object,), {})): if not self.db_is_open: LOG.warning("database is closed") - def set_save_path(self, path): - """ - Set the save path for the database. - """ - if not self.db_is_open: - LOG.warning("database is closed") - def get_dbid(self): """ A unique ID for this database on this computer. diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index f8a0464bb..b2f8234ef 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -528,7 +528,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): "del_func": self.remove_tag, } } - self.set_save_path(directory) self.readonly = False self.db_is_open = False self.name_formats = [] @@ -636,7 +635,8 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): # surname list self.surname_list = self.get_surname_list() - self.set_save_path(directory) + self._set_save_path(directory) + if self._directory: self.undolog = os.path.join(self._directory, DBUNDOFN) else: @@ -2371,7 +2371,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): def get_save_path(self): return self._directory - def set_save_path(self, directory): + def _set_save_path(self, directory): self._directory = directory if directory: self.full_name = os.path.abspath(self._directory) diff --git a/gramps/gui/dbloader.py b/gramps/gui/dbloader.py index 243acdbe4..040895f08 100644 --- a/gramps/gui/dbloader.py +++ b/gramps/gui/dbloader.py @@ -195,7 +195,6 @@ class DbLoader(CLIDbLoader): force_bsddb_upgrade, force_bsddb_downgrade, force_python_upgrade) - db.set_save_path(filename) if self.dbstate.is_open(): self.dbstate.db.close( user=User(callback=self._pulse_progress, diff --git a/gramps/gui/dbman.py b/gramps/gui/dbman.py index 541026ecf..879362f3a 100644 --- a/gramps/gui/dbman.py +++ b/gramps/gui/dbman.py @@ -933,7 +933,6 @@ class DbManager(CLIDbManager, ManagedWindow): newdb.write_version(dirname) dbase = make_database("bsddb") - dbase.set_save_path(dirname) dbase.load(dirname, None) self.__start_cursor(_("Rebuilding database from backup files")) diff --git a/gramps/plugins/db/bsddb/read.py b/gramps/plugins/db/bsddb/read.py index 19729b3e3..714cf26df 100644 --- a/gramps/plugins/db/bsddb/read.py +++ b/gramps/plugins/db/bsddb/read.py @@ -1411,10 +1411,6 @@ class DbBsddbRead(DbReadBase, Callback): """Return the save path of the file, or "" if one does not exist.""" return self.path - def set_save_path(self, path): - """Set the save path for the database.""" - self.path = path - def get_event_attribute_types(self): """ Return a list of all Attribute types assocated with Event instances diff --git a/gramps/plugins/db/bsddb/test/db_test.py b/gramps/plugins/db/bsddb/test/db_test.py index bbcfa790f..0c2780428 100644 --- a/gramps/plugins/db/bsddb/test/db_test.py +++ b/gramps/plugins/db/bsddb/test/db_test.py @@ -168,7 +168,6 @@ class DbTest(unittest.TestCase): # Other set methods: "set_mediapath", "set_researcher", - "set_save_path", "version_supported", ]