From 663c79891eb2d9c8584928b4c872bd301a3092d3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 17 Aug 2022 17:10:29 +0300 Subject: [PATCH 19/19] Qt: Drop unused 'raise' parameter from science_report::init() See osdn #45113 Signed-off-by: Marko Lindqvist --- client/gui-qt/repodlgs.cpp | 14 ++++++-------- client/gui-qt/repodlgs.h | 12 ++++++------ client/gui-qt/sidebar.cpp | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/client/gui-qt/repodlgs.cpp b/client/gui-qt/repodlgs.cpp index 697c6246ba..9c840f4fa3 100644 --- a/client/gui-qt/repodlgs.cpp +++ b/client/gui-qt/repodlgs.cpp @@ -924,7 +924,7 @@ science_report::~science_report() It has to be called soon after constructor. It could be in constructor but compiler will yell about not used variable ****************************************************************************/ -void science_report::init(bool raise) +void science_report::init() { gui()->gimme_place(this, "SCI"); index = gui()->add_game_tab(this); @@ -1641,12 +1641,11 @@ void endgame_report::update_report(const struct packet_endgame_player *packet) } /************************************************************************** - Display the science report. Optionally raise it. + Display the science report. Optionally raise it. Typically triggered by F6. **************************************************************************/ void science_report_dialog_popup(bool raise) { - science_report *sci_rep; int i; QWidget *w; @@ -1656,7 +1655,7 @@ void science_report_dialog_popup(bool raise) } if (!gui()->is_repo_dlg_open("SCI")) { sci_rep = new science_report; - sci_rep->init(raise); + sci_rep->init(); } else { i = gui()->gimme_index_of("SCI"); w = gui()->game_tab_widget->widget(i); @@ -1690,14 +1689,14 @@ void real_economy_report_dialog_update(void *unused) } /************************************************************************** - Display the economy report. Optionally raise it. - Typically triggered by F5. + Display the economy report. Typically triggered by F5. **************************************************************************/ void economy_report_dialog_popup(bool raise) { int i; eco_report *eco_rep; QWidget *w; + if (!gui()->is_repo_dlg_open("ECO")) { eco_rep = new eco_report; eco_rep->init(); @@ -1727,8 +1726,7 @@ void real_units_report_dialog_update(void *unused) } /************************************************************************** - Display the units report. Optionally raise it. - Typically triggered by F2. + Display the units report. Typically triggered by F2. **************************************************************************/ void units_report_dialog_popup(bool raise) { diff --git a/client/gui-qt/repodlgs.h b/client/gui-qt/repodlgs.h index ab3493a54a..22a6f5f6de 100644 --- a/client/gui-qt/repodlgs.h +++ b/client/gui-qt/repodlgs.h @@ -22,6 +22,11 @@ extern "C" { #include "repodlgs_g.h" } +// Qt +#include +#include +#include + // client #include "climisc.h" @@ -29,11 +34,6 @@ extern "C" { #include "fonts.h" #include "mapview.h" -// Qt -#include -#include -#include - class progress_bar; class QComboBox; class QGridLayout; @@ -184,7 +184,7 @@ public: science_report(); ~science_report(); void update_report(); - void init(bool raise); + void init(); void redraw(); void reset_tree(); diff --git a/client/gui-qt/sidebar.cpp b/client/gui-qt/sidebar.cpp index ba2414d918..48c86d9632 100644 --- a/client/gui-qt/sidebar.cpp +++ b/client/gui-qt/sidebar.cpp @@ -762,7 +762,7 @@ void side_left_click_science(bool nothing) } if (!gui()->is_repo_dlg_open("SCI")) { sci_rep = new science_report; - sci_rep->init(true); + sci_rep->init(); } else { i = gui()->gimme_index_of("SCI"); w = gui()->game_tab_widget->widget(i); -- 2.35.1