Skip to content

Commit

Permalink
Qt: Avoid asprintf() to fix msys2 conpile
Browse files Browse the repository at this point in the history
See RM #771

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
  • Loading branch information
cazfi committed Aug 4, 2024
1 parent b3d4820 commit 5e8b454
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions client/gui-qt/citydlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3035,19 +3035,20 @@ void city_dialog::update_counters_table()
qDeleteAll(counterss_frame->findChildren<QWidget*>("", Qt::FindDirectChildrenOnly));
city_counters_iterate(pcount) {
QString helptext;
QString concatStr;
QLabel *name,*value,*activated,*help;
char buf[1024];
QLabel *name, *value, *activated, *help;

name = new QLabel(name_translation_get(&pcount->name));
concatStr=QString::asprintf("%s%d", _("Current value is: "),
dlgcity->counter_values[counter_index(pcount)]);
value = new QLabel(concatStr);
concatStr=QString::asprintf("%s%d",_("Activated once value equal "
"or higher than: "),
pcount->checkpoint);
activated = new QLabel(concatStr);
if (NULL!=pcount->helptext) {
fc_snprintf(buf, sizeof(buf), _("Current value is: %d"),
dlgcity->counter_values[counter_index(pcount)]);
value = new QLabel(buf);
fc_snprintf(buf, sizeof(buf), _("Activated once value equal "
"or higher than: %d"),
pcount->checkpoint);
activated = new QLabel(buf);
if (pcount->helptext != nullptr) {
strvec_iterate(pcount->helptext, text_) {
helptext+=text_;
helptext += text_;
} strvec_iterate_end;
}
help = new QLabel(helptext);
Expand Down

0 comments on commit 5e8b454

Please sign in to comment.