Skip to content

Commit

Permalink
Remove unused parameter for get_science_target_text
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoureaux authored and jwrober committed Jul 23, 2023
1 parent df547e0 commit 178f7b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
11 changes: 2 additions & 9 deletions client/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ const QString science_dialog_text()
The "percent" value, if given, will be set to the completion percentage
of the research target (actually it's a [0,1] scale not a percent).
*/
const QString get_science_target_text(double *percent)
const QString get_science_target_text()
{
struct research *research = research_get(client_player());
QString str;
Expand All @@ -882,9 +882,6 @@ const QString get_science_target_text(double *percent)
if (research->researching == A_UNSET) {
str = QString(_("%1/- (never)"))
.arg(QString::number(research->bulbs_researched));
if (percent) {
*percent = 0.0;
}
} else {
int total = research->client.researching_cost;
int done = research->bulbs_researched;
Expand All @@ -905,10 +902,6 @@ const QString get_science_target_text(double *percent)
str = QString(_("%1/%2 (never)"))
.arg(QString::number(done), QString::number(total));
}
if (percent) {
*percent = static_cast<double>(done) / static_cast<double>(total);
*percent = CLIP(0.0, *percent, 1.0);
}
}

return str.trimmed();
Expand Down Expand Up @@ -1047,7 +1040,7 @@ const QString get_info_label_text_popup()
str += QString(_("Researching %1: %2"))
.arg(research_advance_name_translation(
presearch, presearch->researching),
get_science_target_text(nullptr))
get_science_target_text())
+ qendl();
// perturn is defined as: (bulbs produced) - upkeep
if (game.info.tech_upkeep_style != TECH_UPKEEP_NONE) {
Expand Down
2 changes: 1 addition & 1 deletion client/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const QString unit_description(struct unit *punit);
const QString get_airlift_text(const std::vector<unit *> &units,
const struct city *pdest);
const QString science_dialog_text();
const QString get_science_target_text(double *percent);
const QString get_science_target_text();
const QString get_science_goal_text(Tech_type_id goal);
const QString get_info_label_text(bool moreinfo);
const QString get_info_label_text_popup();
Expand Down
5 changes: 1 addition & 4 deletions client/views/view_research.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,6 @@ void science_report::update_report()
int total;
int done = research->bulbs_researched;
QVariant qvar, qres;
double not_used;
QString str;
qlist_item item;

if (research->researching != A_UNSET) {
Expand All @@ -389,8 +387,7 @@ void science_report::update_report()
progress_label->setAlignment(Qt::AlignHCenter);
info_label->setAlignment(Qt::AlignHCenter);
info_label->setText(get_science_goal_text(research->tech_goal));
str = get_science_target_text(&not_used);
progress->setFormat(str);
progress->setFormat(get_science_target_text());
progress->setMinimum(0);
progress->setMaximum(total);
progress->set_pixmap(static_cast<int>(research->researching));
Expand Down

0 comments on commit 178f7b8

Please sign in to comment.