Re-add: Bug fix: stop first run segfault
This commit is contained in:
parent
1e8ae7d03e
commit
339cf975ae
1 changed files with 14 additions and 0 deletions
|
@ -743,6 +743,20 @@ class chumArea(RightClickTree):
|
|||
def addItem(self, chumLabel):
|
||||
if hasattr(self, 'groups'):
|
||||
if chumLabel.chum.group not in self.groups:
|
||||
if self.topLevelItemCount() == 0:
|
||||
child_1 = QtGui.QTreeWidgetItem(["Chums"])
|
||||
self.addTopLevelItem(child_1)
|
||||
if self.mainwindow.config.openDefaultGroup():
|
||||
child_1.setExpanded(True)
|
||||
else:
|
||||
text = str(self.topLevelItem(0).text(0))
|
||||
if text.find(" ") != -1:
|
||||
text = text[0:text.rfind(" ")]
|
||||
if text != "Chums":
|
||||
child_1 = QtGui.QTreeWidgetItem(["Chums"])
|
||||
self.insertTopLevelItems(0, [child_1])
|
||||
if self.mainwindow.config.openDefaultGroup():
|
||||
child_1.setExpanded(True)
|
||||
self.topLevelItem(0).addChild(chumLabel)
|
||||
self.topLevelItem(0).sortChildren(0, QtCore.Qt.AscendingOrder)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue