From 6427cab58297ed6ea07419b90b04c7b6618b5b08 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 17 Aug 2022 17:07:10 +0300 Subject: [PATCH 30/30] Qt: Drop unused 'raise' parameter from science_report::init() See osdn #45113 Signed-off-by: Marko Lindqvist --- client/gui-qt/repodlgs.cpp | 13 ++++++------- client/gui-qt/repodlgs.h | 12 ++++++------ client/gui-qt/sidebar.cpp | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/client/gui-qt/repodlgs.cpp b/client/gui-qt/repodlgs.cpp index 8c1cf1e245..337e80f35a 100644 --- a/client/gui-qt/repodlgs.cpp +++ b/client/gui-qt/repodlgs.cpp @@ -927,7 +927,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); @@ -1647,7 +1647,7 @@ 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) @@ -1661,7 +1661,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); @@ -1695,14 +1695,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(); @@ -1732,8 +1732,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 c94efd79da..e3d0cce360 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; @@ -189,7 +189,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 26ea82d6a3..2f1858d1bd 100644 --- a/client/gui-qt/sidebar.cpp +++ b/client/gui-qt/sidebar.cpp @@ -797,7 +797,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