Skip to content

Commit

Permalink
clean SetItem
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-p committed Apr 12, 2022
1 parent efd8ebf commit ad2877f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ctl_adm.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def ClearAll(self):


def GetToolTipText(self, tid):
return self.GetItemText(tid, self.getToolTipCol)
if self.getToolTipCol:
return self.GetItemText(tid, self.getToolTipCol)
return None

def GetSelection(self):
lst=[]
Expand Down Expand Up @@ -215,8 +217,7 @@ def UpdateRow(self, row, values, icon=-1):
vals=[]
for colInfo in self.colInfos:
vals.append(colInfo.GetVal(values))
for col in range(1, self.GetColumnCount()):
self.SetStringItem(row, col, vals[col])
self.SetItemRow(row, vals)
self.SetItemImage(row, icon)


Expand Down Expand Up @@ -287,12 +288,11 @@ def GetValue(self):
l.append(self.GetItemTuple(i))
return l

def SetItem(self, row, val, image=None):
def SetItemRow(self, row, val, image=None):
if isinstance(val, tuple):
val=list(val)

for col in range(len(val)):
self.SetStringItem(row, col, str(val[col]))
self.SetItem(row, col, str(val[col]))
if image != None:
self.SetItemImage(row, image)

Expand Down
2 changes: 1 addition & 1 deletion modImap/Mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def editAcl(self, index=-1):
acl=dlg.GetAcl()
if index >= 0:
if acl:
lbAcl.SetStringItem(index, 1, acl)
lbAcl.SetItem(index, 1, acl)
else:
lbAcl.DeleteItem(index)
elif acl:
Expand Down
2 changes: 1 addition & 1 deletion modLdap/Group.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def OnAddMember(self, evt):
cr=candidates[i].split()
uid=cr[0]
row=lv.AppendItem(-1, uid)
lv.SetStringItem(row, 1, " ".join(cr[1:]))
lv.SetItem(row, 1, " ".join(cr[1:]))
lv.SetItemData(row, -1)
uids.append(uid)

Expand Down

0 comments on commit ad2877f

Please sign in to comment.