Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #863755

Qt client HUD prints "Gold: ... (+-2)" if player is losing gold per turn

Added by Jacob Nevins over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
gui-qt
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

It's got a hardcoded + sign rather than a %+d style construction, so it only works well while you are saving gold.

QString doesn't make it easy to fix this, but it's possible with a bit of fiddling.


Related issues

Blocks Freeciv - Task #851229: S3_0 alpha4Closed2020-04-25

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Jacob Nevins over 1 year ago

#2 Updated by Jacob Nevins over 1 year ago

  • Status changed from Resolved to Closed

#3 Updated by Marko Lindqvist over 1 year ago

I suspect this one broke msys2 build. More likely by revealing an existing bug than by having an bug in itself. More info when I have it, but 'sprintf()' might be a macro that fits badly to QString::sprintf() usage.

#4 Updated by Marko Lindqvist over 1 year ago

  • Status changed from Closed to New

Not yet sure if the msys2 issue should be resolved as adjustment to this ticket or as a separate change, but reopening this until otherwise decided.

#5 Updated by Marko Lindqvist over 1 year ago

#6 Updated by Jacob Nevins over 1 year ago

Fine to reopen from my point of view.

Can you quote the error message (or whatever) from the msys2 build?

#7 Updated by Marko Lindqvist over 1 year ago

Error message:

In file included from ../../../../../utility/fcintl.h:34,
from ../../../../../utility/specenum_gen.h:123,
from ../../../../../common/fc_types.h:145,
from ../../../../../common/movement.h:20,
from ../../../../../client/gui-qt/hudwidget.cpp:35:
../../../../../client/gui-qt/hudwidget.cpp: In function 'void show_new_turn_info()':
../../../../../client/gui-qt/hudwidget.cpp:1690:22: error: 'class QString' has no member named 'libintl_sprintf'
1690 | .arg(QString().sprintf("%+d",

with 'sprintf' in the last line colored.

#8 Updated by Marko Lindqvist over 1 year ago

In S2_6, also msys1 build is affected.

#10 Updated by Marko Lindqvist over 1 year ago

  • Status changed from Resolved to New

The patch didn't help.

#11 Updated by Marko Lindqvist over 1 year ago

New patch for testing

#12 Updated by Marko Lindqvist over 1 year ago

Marko Lindqvist wrote:

New patch for testing

It works, so pushing the commit tonight.

#13 Updated by Marko Lindqvist over 1 year ago

It's also worth noting that QString().sprintf() is deprecated in newer Qt versions.

#14 Updated by Marko Lindqvist over 1 year ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF