mirror of
https://github.com/gryf/wmaker.git
synced 2026-11-24 08:36:55 +01:00
bag tree finished.. updated code to new bags
This commit is contained in:
1 parent
8219011758
commit
9e45e85dc6
16 files changed
+691
-283
No files matched your search
+3
-5
@@ -104,19 +104,17 @@ closestListItem(WMList *list, char *text, Bool exact)
|
||||
{
|
||||
WMListItem *item;
|
||||
WMBag *items = WMGetListItems(list);
|
||||
int i;
|
||||
WMBagIterator i;
|
||||
int len = strlen(text);
|
||||
|
||||
if (len==0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < WMGetBagItemCount(items); i++) {
|
||||
item = WMGetFromBag(items, i);
|
||||
|
||||
WM_ITERATE_BAG(items, item, i) {
|
||||
if (strlen(item->text) >= len &&
|
||||
((exact && strcmp(item->text, text)==0) ||
|
||||
(!exact && strncmp(item->text, text, len)==0))) {
|
||||
return i;
|
||||
return WMBagIndexForIterator(items, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user