Fix the bug related to the empty version list
author(no author) <(no author)@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 13 Jul 2009 12:27:33 +0000 (12:27 +0000)
committer(no author) <(no author)@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 13 Jul 2009 12:27:33 +0000 (12:27 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2755 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BVersionPage.py

index 98c73885dfc43230e068599506cbd4139f8bb3da..8ce6940399f94ed0cb77cd782c0d3495f1daeaad 100644 (file)
@@ -192,7 +192,9 @@ class BVersionPage(BWizardPage):
             if selected and selected == directory:
                 self.setCurrentItem(item)
         if not selected:
-            self.setCurrentItem(self.latestVersionItem())
+            latest_version_item = self.latestVersionItem()
+            if latest_version_item:
+                self.setCurrentItem(latest_version_item)
     
     def disableRemoveButton(self):
         """
@@ -210,7 +212,7 @@ class BVersionPage(BWizardPage):
         """
         Returns the latest BeRTOS version founded.
         """
-        latest_version_item = QTableWidgetItem("")
+        latest_version_item = None
         for index in range(self.pageContent.versionList.count()):
             item = self.pageContent.versionList.item(index)
             version = item.text().split(" (")[0]