Skip to content

Commit 711b875

Browse files
committed
kconfig: qconf: remove ConfigItem::pixmap/setPixmap
Use QTreeWidgetItem::icon/setIcon directly. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 3c73ff0 commit 711b875

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

scripts/kconfig/qconf.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void ConfigItem::updateMenu(void)
9797

9898
list = listView();
9999
if (goParent) {
100-
setPixmap(promptColIdx, list->menuBackPix);
100+
setIcon(promptColIdx, list->menuBackPix);
101101
prompt = "..";
102102
goto set_prompt;
103103
}
@@ -114,15 +114,15 @@ void ConfigItem::updateMenu(void)
114114
*/
115115
if (sym && list->rootEntry == menu)
116116
break;
117-
setPixmap(promptColIdx, list->menuPix);
117+
setIcon(promptColIdx, list->menuPix);
118118
} else {
119119
if (sym)
120120
break;
121-
setPixmap(promptColIdx, QIcon());
121+
setIcon(promptColIdx, QIcon());
122122
}
123123
goto set_prompt;
124124
case P_COMMENT:
125-
setPixmap(promptColIdx, QIcon());
125+
setIcon(promptColIdx, QIcon());
126126
goto set_prompt;
127127
default:
128128
;
@@ -139,7 +139,7 @@ void ConfigItem::updateMenu(void)
139139
char ch;
140140

141141
if (!sym_is_changeable(sym) && list->optMode == normalOpt) {
142-
setPixmap(promptColIdx, QIcon());
142+
setIcon(promptColIdx, QIcon());
143143
setText(noColIdx, QString());
144144
setText(modColIdx, QString());
145145
setText(yesColIdx, QString());
@@ -149,22 +149,22 @@ void ConfigItem::updateMenu(void)
149149
switch (expr) {
150150
case yes:
151151
if (sym_is_choice_value(sym) && type == S_BOOLEAN)
152-
setPixmap(promptColIdx, list->choiceYesPix);
152+
setIcon(promptColIdx, list->choiceYesPix);
153153
else
154-
setPixmap(promptColIdx, list->symbolYesPix);
154+
setIcon(promptColIdx, list->symbolYesPix);
155155
setText(yesColIdx, "Y");
156156
ch = 'Y';
157157
break;
158158
case mod:
159-
setPixmap(promptColIdx, list->symbolModPix);
159+
setIcon(promptColIdx, list->symbolModPix);
160160
setText(modColIdx, "M");
161161
ch = 'M';
162162
break;
163163
default:
164164
if (sym_is_choice_value(sym) && type == S_BOOLEAN)
165-
setPixmap(promptColIdx, list->choiceNoPix);
165+
setIcon(promptColIdx, list->choiceNoPix);
166166
else
167-
setPixmap(promptColIdx, list->symbolNoPix);
167+
setIcon(promptColIdx, list->symbolNoPix);
168168
setText(noColIdx, "N");
169169
ch = 'N';
170170
break;
@@ -769,7 +769,7 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e)
769769
idx = header()->logicalIndexAt(x);
770770
switch (idx) {
771771
case promptColIdx:
772-
icon = item->pixmap(promptColIdx);
772+
icon = item->icon(promptColIdx);
773773
if (!icon.isNull()) {
774774
int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly.
775775
if (x >= off && x < off + icon.availableSizes().first().width()) {

scripts/kconfig/qconf.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,6 @@ class ConfigItem : public QTreeWidgetItem {
172172
{
173173
return Parent::text(idx);
174174
}
175-
void setPixmap(colIdx idx, const QIcon &icon)
176-
{
177-
Parent::setIcon(idx, icon);
178-
}
179-
const QIcon pixmap(colIdx idx) const
180-
{
181-
return icon(idx);
182-
}
183175
// TODO: Implement paintCell
184176

185177
ConfigItem* nextItem;

0 commit comments

Comments
 (0)