Skip to content

Commit

Permalink
ui,prefs: set db in-memory name correctly
Browse files Browse the repository at this point in the history
Instead of :memory:, use file::memory:

Related: #1030
  • Loading branch information
gustavo-iniguez-goya committed Nov 6, 2023
1 parent c35baf3 commit 6e08629
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/opensnitch/dialogs/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,18 @@ def _save_db_config(self):

if self.comboDBType.currentIndex() != Database.DB_TYPE_MEMORY:
if self.dbLabel.text() != "":
self._cfg.setSettings(Config.DEFAULT_DB_FILE_KEY, self.dbLabel.text())
db_name = self.dbLabel.text()
else:
Message.ok(
QC.translate("preferences", "Warning"),
QC.translate("preferences", "You must select a file for the database<br>or choose \"In memory\" type."),
QtWidgets.QMessageBox.Warning)
self.dbLabel.setText("")
return False
else:
db_name = Database.DB_IN_MEMORY

self._cfg.setSettings(Config.DEFAULT_DB_FILE_KEY, db_name)
self._cfg.setSettings(Config.DEFAULT_DB_TYPE_KEY, dbtype)
self._cfg.setSettings(Config.DEFAULT_DB_PURGE_OLDEST, bool(self.checkDBMaxDays.isChecked()))
self._cfg.setSettings(Config.DEFAULT_DB_MAX_DAYS, int(self.spinDBMaxDays.value()))
Expand Down

0 comments on commit 6e08629

Please sign in to comment.