History

kconfig: qconf: remove 'parent' from ConfigList::updateMenuList()

All the call-sites of this function pass 'this' to the first argument. So, 'parent' is always the 'this' pointer.

Masahiro Yamada committed 6 years ago

Commit 5b75a6c1 parent 10316852 files · +10 −10Browse files

Unified · Split

2 files
  1. scripts/kconfig/qconf.cc +9 −9
  2. scripts/kconfig/qconf.h +1 −1
scripts/kconfig/qconf.cc+9−9
@@ -446,7 +446,7 @@ void ConfigList::updateList() · 445 unmodified lines
446446 return;
447447 }
448448 update:
449− updateMenuList(this, rootEntry);
449+ updateMenuList(rootEntry);
450450 update();
451451 resizeColumnToContents(0);
452452 }
@@ -524,7 +524,7 @@ void ConfigList::setRootMenu(struct menu *menu) · 71 unmodified lines
524524 type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN;
525525 if (type != P_MENU)
526526 return;
527− updateMenuList(this, 0);
527+ updateMenuList(0);
528528 rootEntry = menu;
529529 updateListAll();
530530 if (currentItem()) {
@@ -628,7 +628,7 @@ hide: · 97 unmodified lines
628628 }
629629 }
630630
631−void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu)
631+void ConfigList::updateMenuList(struct menu *menu)
632632 {
633633 struct menu* child;
634634 ConfigItem* item;
@@ -637,19 +637,19 @@ void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu) · 2 unmodified lines
637637 enum prop_type type;
638638
639639 if (!menu) {
640− while (parent->topLevelItemCount() > 0)
640+ while (topLevelItemCount() > 0)
641641 {
642− delete parent->takeTopLevelItem(0);
642+ delete takeTopLevelItem(0);
643643 }
644644
645645 return;
646646 }
647647
648− last = (ConfigItem*)parent->topLevelItem(0);
648+ last = (ConfigItem *)topLevelItem(0);
649649 if (last && !last->goParent)
650650 last = 0;
651651 for (child = menu->list; child; child = child->next) {
652− item = last ? last->nextSibling() : (ConfigItem*)parent->topLevelItem(0);
652+ item = last ? last->nextSibling() : (ConfigItem *)topLevelItem(0);
653653 type = child->prompt ? child->prompt->type : P_UNKNOWN;
654654
655655 switch (mode) {
@@ -670,7 +670,7 @@ void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu) · 14 unmodified lines
670670 if (!child->sym && !child->list && !child->prompt)
671671 continue;
672672 if (!item || item->menu != child)
673− item = new ConfigItem(parent, last, child, visible);
673+ item = new ConfigItem(this, last, child, visible);
674674 else
675675 item->testUpdateMenu(visible);
676676
@@ -683,7 +683,7 @@ void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu) · 6 unmodified lines
683683 }
684684 hide:
685685 if (item && item->menu == child) {
686− last = (ConfigItem*)parent->topLevelItem(0);
686+ last = (ConfigItem *)topLevelItem(0);
687687 if (last == item)
688688 last = 0;
689689 else while (last->nextSibling() != item)
scripts/kconfig/qconf.h+1−1
@@ -102,7 +102,7 @@ public: · 101 unmodified lines
102102 bool menuSkip(struct menu *);
103103
104104 void updateMenuList(ConfigItem *parent, struct menu*);
105− void updateMenuList(ConfigList *parent, struct menu*);
105+ void updateMenuList(struct menu *menu);
106106
107107 bool updateAll;
108108