Found the clear function
authorEd Page <eopage@byu.net>
Thu, 25 Nov 2010 02:17:15 +0000 (20:17 -0600)
committerEd Page <eopage@byu.net>
Thu, 25 Nov 2010 02:17:15 +0000 (20:17 -0600)
src/dialogs.py
src/gv_views.py

index 82145f6..d5c7eac 100644 (file)
@@ -328,8 +328,7 @@ class SMSEntryWindow(object):
                        self._smsEntry.setFocus(QtCore.Qt.OtherFocusReason)
 
        def _populate_number_selector(self, selector, cid, numbers):
-               while 0 < selector.count():
-                       selector.removeItem(0)
+               selector.clear()
 
                if len(numbers) == 1:
                        numbers, defaultIndex = _get_contact_numbers(self._session, cid, numbers[0])
index ebedcf6..1482e2e 100644 (file)
@@ -604,8 +604,7 @@ class Contacts(object):
                if currentItem == "":
                        # Not loaded yet
                        currentItem = "None"
-               while 0 < self._listSelection.count():
-                       self._listSelection.removeItem(0)
+               self._listSelection.clear()
                bookNames = [book["name"] for book in self._addressBooks]
                try:
                        newIndex = bookNames.index(currentItem)