From aaa11685c8a90a6802adf903d35b8ce22dfd41bd Mon Sep 17 00:00:00 2001 From: Papoteur Date: Thu, 8 Feb 2024 19:58:35 +0100 Subject: Remove home path from path in settings --- mga-advisor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mga-advisor.py b/mga-advisor.py index c552fb0..0c3d07f 100644 --- a/mga-advisor.py +++ b/mga-advisor.py @@ -260,7 +260,7 @@ class Widget(QWidget): default_path = self.settings.value("Default/path", "/mageia-advisories/advisories") if QDir().mkpath(QDir().homePath() + default_path): if self.ui.bug_le.text() != "": - filename = os.path.join(QDir().homePath(), default_path, f"{self.ui.bug_le.text()}.adv") + filename = os.path.join(QDir().homePath()+ default_path, f"{self.ui.bug_le.text()}.adv") if os.path.exists(filename): response = QMessageBox.question(self, 'File exists', f'The file {filename} already exists. Do you want to override it ?', QMessageBox.Yes | QMessageBox.No) if response == QMessageBox.No: @@ -272,6 +272,7 @@ class Widget(QWidget): def select_path(self): filepath = QFileDialog.getExistingDirectory(self, "Select default directory for advisories repository", self.settings.value("Default/path")) if filepath: + filepath = filepath[len(QDir().homePath()):] self.settings.setValue('Default/path', filepath) def cancel(self): -- cgit v1.2.1