Skip to content

Commit b1185eb

Browse files
committed
Issue #77 toIcon returns a simple enum instead of a full object
1 parent 59bbac9 commit b1185eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+160
-174
lines changed

src/blackgui/components/atcbuttoncomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace BlackGui
7676

7777
QPushButton *button = new QPushButton(this);
7878
button->setText(station.getCallsignAsString());
79-
if (m_withIcons) { button->setIcon(station.toPixmap()); }
79+
if (m_withIcons) { button->setIcon(CIcon(station.toIcon()).toQIcon()); }
8080
QObject::connect(button, &QPushButton::released, this, &CAtcButtonComponent::onButtonClicked);
8181
const CVariant atcv = CVariant::fromValue(station);
8282
layout->addWidget(button, row, col++);

src/blackgui/components/colorselector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace BlackGui
7272
else
7373
{
7474
ui->le_Color->setText(color.hex());
75-
ui->lbl_ColorIcon->setPixmap(color.toPixmap());
75+
ui->lbl_ColorIcon->setPixmap(CIcon(color.toIcon()));
7676
m_lastColor = color;
7777
}
7878
emit colorChanged(color);
@@ -176,7 +176,7 @@ namespace BlackGui
176176

177177
mimeData->setColorData(QVariant::fromValue(c.toQColor()));
178178
drag->setMimeData(mimeData);
179-
drag->setPixmap(c.toPixmap());
179+
drag->setPixmap(CIcon(c.toIcon()));
180180

181181
Qt::DropAction dropAction = drag->exec(Qt::CopyAction);
182182
Q_UNUSED(dropAction);

src/blackgui/components/dbcountryselectorcomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace BlackGui
6262
{
6363
ui->le_CountryIso->setText(country.getIsoCode());
6464
ui->le_CountryName->setText(country.getName());
65-
ui->lbl_CountryIcon->setPixmap(country.toPixmap());
65+
ui->lbl_CountryIcon->setPixmap(CIcon(country.toIcon()));
6666
if (country != m_currentCountry)
6767
{
6868
m_currentCountry = country;

src/blackgui/components/serverlistselector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace BlackGui
9999
}
100100
else
101101
{
102-
this->addItem(country.toPixmap(), d);
102+
this->addItem(CIcon(country.toIcon()).toPixmap(), d);
103103
}
104104
}
105105
else

src/blackgui/components/statusmessageform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace BlackGui
4040
void CStatusMessageForm::setValue(const CStatusMessage &message)
4141
{
4242
ui->te_Message->setPlainText(message.getMessage());
43-
ui->lbl_SeverityIcon->setPixmap(message.toPixmap());
43+
ui->lbl_SeverityIcon->setPixmap(CIcon(message.toIcon()));
4444
const QString hrc(message.getHumanReadablePattern());
4545
if (hrc.isEmpty())
4646
{

src/blackgui/components/statusmessageformsmall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace BlackGui
3838
void CStatusMessageFormSmall::setValue(const CStatusMessage &message)
3939
{
4040
ui->te_Message->setPlainText(message.getMessage());
41-
ui->lbl_SeverityIcon->setPixmap(message.toPixmap());
41+
ui->lbl_SeverityIcon->setPixmap(CIcon(message.toIcon()));
4242
ui->le_Categories->setText(message.getHumanOrTechnicalCategoriesAsString());
4343
ui->le_Severity->setText(message.getSeverityAsString());
4444
ui->le_Timestamp->setText(message.getFormattedUtcTimestampYmdhms());

src/blackgui/components/textmessagecomponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ namespace BlackGui
491491
if (supervisor)
492492
{
493493
//! \fixme hardcoded stylesheet color
494-
bar->setTabIcon(index, callsign.toPixmap());
494+
bar->setTabIcon(index, CIcon(callsign.toIcon()).toQIcon());
495495
bar->setTabTextColor(index, QColor(Qt::yellow));
496496
}
497497
ui->tw_TextMessages->setCurrentIndex(index);

src/blackgui/components/updateinfocomponent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace BlackGui
106106
ui->cb_Platforms->clear();
107107
for (const CPlatform &platform : platforms)
108108
{
109-
ui->cb_Platforms->insertItem(i++, platform.toPixmap(), platform.getPlatformName());
109+
ui->cb_Platforms->insertItem(i++, CIcon(platform.toIcon()).toPixmap(), platform.getPlatformName());
110110
}
111111
if (platforms.contains(settings.last())) { ui->cb_Platforms->setCurrentText(settings.last()); }
112112
else if (platforms.contains(CPlatform::currentPlatform().getPlatformName())) { ui->cb_Platforms->setCurrentText(CPlatform::currentPlatform().getPlatformName()); }
@@ -116,7 +116,7 @@ namespace BlackGui
116116
ui->cb_Channels->clear();
117117
for (const CDistribution &distribution : distributions)
118118
{
119-
ui->cb_Channels->insertItem(i++, distribution.getRestrictionIcon().toPixmap(), distribution.getChannel());
119+
ui->cb_Channels->insertItem(i++, CIcon(distribution.getRestrictionIcon()).toPixmap(), distribution.getChannel());
120120
}
121121
if (distributions.containsChannel(settings.front())) { ui->cb_Channels->setCurrentText(settings.front()); }
122122

src/blackgui/ecosystemcombobox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace BlackGui
4949
this->clear();
5050
for (const CEcosystem &e : m_systems)
5151
{
52-
this->addItem(e.toIcon().toPixmap(), e.getSystemString());
52+
this->addItem(BlackMisc::CIcon(e.toIcon()).toPixmap(), e.getSystemString());
5353
}
5454
}
5555
} // ns

src/blackgui/editors/airlineicaoform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace BlackGui
7474
ui->cb_Military->setChecked(icao.isMilitary());
7575
ui->country_Selector->setCountry(icao.getCountry());
7676

77-
const QPixmap pm = icao.toPixmap();
77+
const QPixmap pm = CIcon(icao.toIcon());
7878
if (pm.width() < 125)
7979
{
8080
ui->lbl_AirlineIcon->setPixmap(pm);

0 commit comments

Comments
 (0)