Skip to content

Commit

Permalink
Remove all code references to the city dialog icon
Browse files Browse the repository at this point in the history
It was no longer used, see #1039.
  • Loading branch information
lmoureaux authored and jwrober committed Jun 24, 2022
1 parent 820c566 commit 8c37590
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
4 changes: 0 additions & 4 deletions client/citydlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2226,10 +2226,6 @@ void city_dialog::update_info_label()
*/
void city_dialog::setup_ui(struct city *qcity)
{
QPixmap q_pix = *get_icon_sprite(tileset, ICON_CITYDLG);
QIcon q_icon = ::QIcon(q_pix);

setWindowIcon(q_icon);
pcity = qcity;
ui.production_combo_p->blockSignals(true);
refresh();
Expand Down
4 changes: 1 addition & 3 deletions client/gui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ void ui_main()
if (true) {
tileset_init(tileset);
tileset_load_tiles(tileset);
auto qpm = get_icon_sprite(tileset, ICON_FREECIV);
auto app_icon = QIcon(*qpm);
qApp->setWindowIcon(app_icon);
qApp->setWindowIcon(QIcon(*get_icon_sprite(tileset)));
if (gui_options.first_boot) {
/* We're using fresh defaults for this version of this client,
* so prevent any future migrations from other versions */
Expand Down
17 changes: 6 additions & 11 deletions client/tilespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct named_sprites {
*treaty_thumb[2], // 0=disagree, 1=agree
*arrow[ARROW_LAST], // 0=right arrow, 1=plus, 2=minus

*icon[ICON_COUNT],
*icon,

*events[E_COUNT],

Expand Down Expand Up @@ -2674,12 +2674,7 @@ static void tileset_lookup_sprite_tags(struct tileset *t)
}
}

for (i = 0; i < ICON_COUNT; i++) {
const char *names[ICON_COUNT] = {"freeciv", "citydlg"};

buffer = QStringLiteral("icon.%1").arg(names[i]);
SET_SPRITE(icon[i], buffer);
}
SET_SPRITE(icon, QStringLiteral("icon.freeciv"));

for (i = 0; i < E_COUNT; i++) {
const char *tag = get_event_tag(static_cast<event_type>(i));
Expand Down Expand Up @@ -5481,17 +5476,17 @@ const QPixmap *get_cursor_sprite(const struct tileset *t,
}

/**
Return a sprite for the given icon. Icons are used by the operating
system/window manager. Usually freeciv has to tell the OS what icon to
Return a sprite for the Freeciv21 icon. Icons are used by the operating
system/window manager. Usually Freeciv21 has to tell the OS what icon to
use.

Note that this function will return nullptr before the sprites are loaded.
The GUI code must be sure to call tileset_load_tiles before setting the
top-level icon.
*/
const QPixmap *get_icon_sprite(const struct tileset *t, enum icon_type icon)
const QPixmap *get_icon_sprite(const struct tileset *t)
{
return t->sprites.icon[icon];
return t->sprites.icon;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions client/tilespec.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ enum indicator_type {
INDICATOR_COUNT
};

enum icon_type { ICON_FREECIV, ICON_CITYDLG, ICON_COUNT };

enum spaceship_part {
SPACESHIP_SOLAR_PANEL,
SPACESHIP_LIFE_SUPPORT,
Expand Down Expand Up @@ -249,7 +247,7 @@ const QPixmap *get_cursor_sprite(const struct tileset *t,
int *hot_y, int frame);
const struct citybar_sprites *get_citybar_sprites(const struct tileset *t);
const struct editor_sprites *get_editor_sprites(const struct tileset *t);
const QPixmap *get_icon_sprite(const struct tileset *t, enum icon_type icon);
const QPixmap *get_icon_sprite(const struct tileset *t);
const QPixmap *get_attention_crosshair_sprite(const struct tileset *t);
const QPixmap *get_indicator_sprite(const struct tileset *t,
enum indicator_type indicator,
Expand Down

0 comments on commit 8c37590

Please sign in to comment.