Commit 711b875b authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: qconf: remove ConfigItem::pixmap/setPixmap

Use QTreeWidgetItem::icon/setIcon directly.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 3c73ff04
...@@ -97,7 +97,7 @@ void ConfigItem::updateMenu(void) ...@@ -97,7 +97,7 @@ void ConfigItem::updateMenu(void)
list = listView(); list = listView();
if (goParent) { if (goParent) {
setPixmap(promptColIdx, list->menuBackPix); setIcon(promptColIdx, list->menuBackPix);
prompt = ".."; prompt = "..";
goto set_prompt; goto set_prompt;
} }
...@@ -114,15 +114,15 @@ void ConfigItem::updateMenu(void) ...@@ -114,15 +114,15 @@ void ConfigItem::updateMenu(void)
*/ */
if (sym && list->rootEntry == menu) if (sym && list->rootEntry == menu)
break; break;
setPixmap(promptColIdx, list->menuPix); setIcon(promptColIdx, list->menuPix);
} else { } else {
if (sym) if (sym)
break; break;
setPixmap(promptColIdx, QIcon()); setIcon(promptColIdx, QIcon());
} }
goto set_prompt; goto set_prompt;
case P_COMMENT: case P_COMMENT:
setPixmap(promptColIdx, QIcon()); setIcon(promptColIdx, QIcon());
goto set_prompt; goto set_prompt;
default: default:
; ;
...@@ -139,7 +139,7 @@ void ConfigItem::updateMenu(void) ...@@ -139,7 +139,7 @@ void ConfigItem::updateMenu(void)
char ch; char ch;
if (!sym_is_changeable(sym) && list->optMode == normalOpt) { if (!sym_is_changeable(sym) && list->optMode == normalOpt) {
setPixmap(promptColIdx, QIcon()); setIcon(promptColIdx, QIcon());
setText(noColIdx, QString()); setText(noColIdx, QString());
setText(modColIdx, QString()); setText(modColIdx, QString());
setText(yesColIdx, QString()); setText(yesColIdx, QString());
...@@ -149,22 +149,22 @@ void ConfigItem::updateMenu(void) ...@@ -149,22 +149,22 @@ void ConfigItem::updateMenu(void)
switch (expr) { switch (expr) {
case yes: case yes:
if (sym_is_choice_value(sym) && type == S_BOOLEAN) if (sym_is_choice_value(sym) && type == S_BOOLEAN)
setPixmap(promptColIdx, list->choiceYesPix); setIcon(promptColIdx, list->choiceYesPix);
else else
setPixmap(promptColIdx, list->symbolYesPix); setIcon(promptColIdx, list->symbolYesPix);
setText(yesColIdx, "Y"); setText(yesColIdx, "Y");
ch = 'Y'; ch = 'Y';
break; break;
case mod: case mod:
setPixmap(promptColIdx, list->symbolModPix); setIcon(promptColIdx, list->symbolModPix);
setText(modColIdx, "M"); setText(modColIdx, "M");
ch = 'M'; ch = 'M';
break; break;
default: default:
if (sym_is_choice_value(sym) && type == S_BOOLEAN) if (sym_is_choice_value(sym) && type == S_BOOLEAN)
setPixmap(promptColIdx, list->choiceNoPix); setIcon(promptColIdx, list->choiceNoPix);
else else
setPixmap(promptColIdx, list->symbolNoPix); setIcon(promptColIdx, list->symbolNoPix);
setText(noColIdx, "N"); setText(noColIdx, "N");
ch = 'N'; ch = 'N';
break; break;
...@@ -769,7 +769,7 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e) ...@@ -769,7 +769,7 @@ void ConfigList::mouseReleaseEvent(QMouseEvent* e)
idx = header()->logicalIndexAt(x); idx = header()->logicalIndexAt(x);
switch (idx) { switch (idx) {
case promptColIdx: case promptColIdx:
icon = item->pixmap(promptColIdx); icon = item->icon(promptColIdx);
if (!icon.isNull()) { if (!icon.isNull()) {
int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly. int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly.
if (x >= off && x < off + icon.availableSizes().first().width()) { if (x >= off && x < off + icon.availableSizes().first().width()) {
......
...@@ -172,14 +172,6 @@ class ConfigItem : public QTreeWidgetItem { ...@@ -172,14 +172,6 @@ class ConfigItem : public QTreeWidgetItem {
{ {
return Parent::text(idx); return Parent::text(idx);
} }
void setPixmap(colIdx idx, const QIcon &icon)
{
Parent::setIcon(idx, icon);
}
const QIcon pixmap(colIdx idx) const
{
return icon(idx);
}
// TODO: Implement paintCell // TODO: Implement paintCell
ConfigItem* nextItem; ConfigItem* nextItem;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment