96 if ext and lexer: |
96 if ext and lexer: |
97 itmList = self.editorLexerList.findItems( |
97 itmList = self.editorLexerList.findItems( |
98 ext, Qt.MatchFlags(Qt.MatchExactly), 0) |
98 ext, Qt.MatchFlags(Qt.MatchExactly), 0) |
99 if itmList: |
99 if itmList: |
100 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
100 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
101 itm = self.editorLexerList.takeTopLevelItem(index) # __IGNORE_WARNING__ |
101 itm = self.editorLexerList.takeTopLevelItem(index) |
|
102 # __IGNORE_WARNING__ |
102 del itm |
103 del itm |
103 QTreeWidgetItem(self.editorLexerList, [ext, lexer]) |
104 QTreeWidgetItem(self.editorLexerList, [ext, lexer]) |
104 self.editorFileExtEdit.clear() |
105 self.editorFileExtEdit.clear() |
105 self.editorLexerCombo.setCurrentIndex(0) |
106 self.editorLexerCombo.setCurrentIndex(0) |
106 self.pygmentsLexerCombo.setCurrentIndex(0) |
107 self.pygmentsLexerCombo.setCurrentIndex(0) |
115 list. |
116 list. |
116 """ |
117 """ |
117 itmList = self.editorLexerList.selectedItems() |
118 itmList = self.editorLexerList.selectedItems() |
118 if itmList: |
119 if itmList: |
119 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
120 index = self.editorLexerList.indexOfTopLevelItem(itmList[0]) |
120 itm = self.editorLexerList.takeTopLevelItem(index) # __IGNORE_WARNING__ |
121 itm = self.editorLexerList.takeTopLevelItem(index) |
|
122 # __IGNORE_WARNING__ |
121 del itm |
123 del itm |
122 |
124 |
123 self.editorLexerList.clearSelection() |
125 self.editorLexerList.clearSelection() |
124 self.editorFileExtEdit.clear() |
126 self.editorFileExtEdit.clear() |
125 self.editorLexerCombo.setCurrentIndex(0) |
127 self.editorLexerCombo.setCurrentIndex(0) |