diff --git a/gramps/cli/grampscli.py b/gramps/cli/grampscli.py index 8466b5ec8..7c1ffa8b7 100644 --- a/gramps/cli/grampscli.py +++ b/gramps/cli/grampscli.py @@ -316,7 +316,7 @@ class CLIManager: # database is empty, then copy default researcher to DB owner if (res.is_empty() and not owner.is_empty() - and self.dbstate.db.is_empty()): + and self.dbstate.db.get_total() == 0): self.dbstate.db.set_researcher(owner) name_displayer.set_name_format(self.dbstate.db.name_formats) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 577103509..56f8d85a6 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -721,15 +721,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): def is_open(self): return self.db_is_open - def is_empty(self): - """ - Return true if there are no [primary] records in the database - """ - for table in self.get_table_func(): - if len(self.get_table_func(table, "handles_func")()) > 0: - return False - return True - def get_dbid(self): """ We use the file directory name as the unique ID for diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 2f89f116b..4c4af2451 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -1757,7 +1757,7 @@ class GedcomParser(UpdateCallback): self.number_of_errors = 0 self.maxpeople = stage_one.get_person_count() self.dbase = dbase - self.import_researcher = self.dbase.is_empty() + self.import_researcher = self.dbase.get_total() == 0 self.emapper = IdFinder(dbase.get_gramps_ids(EVENT_KEY), dbase.event_prefix) self.famc_map = stage_one.get_famc_map()