From: duplo Date: Tue, 23 Dec 2008 10:45:36 +0000 (+0000) Subject: Add the check for empty filenames X-Git-Tag: 2.1.0~556 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=f84a93605a71e983cc4f84cae1241a6306cb58a3;p=bertos.git Add the check for empty filenames git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2126 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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: