From f84a93605a71e983cc4f84cae1241a6306cb58a3 Mon Sep 17 00:00:00 2001 From: duplo Date: Tue, 23 Dec 2008 10:45:36 +0000 Subject: [PATCH] Add the check for empty filenames git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2126 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BToolchainPage.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index b3acb4d9..c3756261 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -115,12 +115,13 @@ class BToolchainPage(BWizardPage): def addToolchain(self): sel_toolchain = QFileDialog.getOpenFileName(self, self.tr("Choose the toolchain"), "") - item = QListWidgetItem(sel_toolchain) - item.setData(Qt.UserRole, QVariant(sel_toolchain)) - self.pageContent.toolchainList.addItem(item) - toolchains = self._settingsRetrieve("toolchains").toList() - toolchains = set([toolchain.toString() for toolchain in toolchains] + [sel_toolchain]) - self._settingsStore("toolchains", list(toolchains)) + if not sel_toolchain.isEmpty(): + item = QListWidgetItem(sel_toolchain) + item.setData(Qt.UserRole, QVariant(sel_toolchain)) + self.pageContent.toolchainList.addItem(item) + toolchains = self._settingsRetrieve("toolchains").toList() + toolchains = set([toolchain.toString() for toolchain in toolchains] + [sel_toolchain]) + self._settingsStore("toolchains", list(toolchains)) def removeToolchain(self): if self.pageContent.toolchainList.currentRow() != -1: -- 2.25.1