637 return |
637 return |
638 |
638 |
639 keys = list(dictionary.keys()) |
639 keys = list(dictionary.keys()) |
640 if len(keys) > 0: |
640 if len(keys) > 0: |
641 if repopulate: |
641 if repopulate: |
|
642 last = len(keys) - 1 |
|
643 if ( |
|
644 "@@Coding@@" in keys and |
|
645 not Preferences.getUI("BrowserShowCoding") |
|
646 ): |
|
647 last -= 1 |
642 self.beginInsertRows( |
648 self.beginInsertRows( |
643 self.createIndex(parentItem.row(), 0, parentItem), |
649 self.createIndex(parentItem.row(), 0, parentItem), |
644 0, len(keys) - 1) |
650 0, last) |
|
651 |
645 for key in keys: |
652 for key in keys: |
646 if key.startswith("@@"): |
653 if key.startswith("@@"): |
647 # special treatment done later |
654 # special treatment done later |
648 continue |
655 continue |
649 cl = dictionary[key] |
656 cl = dictionary[key] |
651 if cl.module == moduleName: |
658 if cl.module == moduleName: |
652 node = BrowserClassItem(parentItem, cl, fileName) |
659 node = BrowserClassItem(parentItem, cl, fileName) |
653 self._addItem(node, parentItem) |
660 self._addItem(node, parentItem) |
654 except AttributeError: |
661 except AttributeError: |
655 pass |
662 pass |
656 if "@@Coding@@" in keys: |
663 if "@@Coding@@" in keys and Preferences.getUI("BrowserShowCoding"): |
657 node = BrowserCodingItem( |
664 node = BrowserCodingItem( |
658 parentItem, |
665 parentItem, |
659 QCoreApplication.translate("BrowserModel", "Coding: {0}") |
666 QCoreApplication.translate("BrowserModel", "Coding: {0}") |
660 .format(dictionary["@@Coding@@"].coding), |
667 .format(dictionary["@@Coding@@"].coding), |
661 dictionary["@@Coding@@"].linenumber) |
668 dictionary["@@Coding@@"].linenumber) |