Add the check for empty filenames
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 23 Dec 2008 10:45:36 +0000 (10:45 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 23 Dec 2008 10:45:36 +0000 (10:45 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2126 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BToolchainPage.py

index b3acb4d97622aaf567173497eeedf5d3cf1701c4..c3756261e8708d71534b7194b98b01fb3b331fd5 100644 (file)
@@ -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: