diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-17 21:16:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-17 21:17:12 +0300 |
commit | 1e80a56b8444373997f3f7458bf0547c298c7abd (patch) | |
tree | d6007f8e1570ce82935d101e3658cbcee5e52084 /src/gui/widgets/characterviewsmall.cpp | |
parent | 2d78c7477a7289f63a9709a616c2f49e4b795fa5 (diff) | |
download | manaplus-1e80a56b8444373997f3f7458bf0547c298c7abd.tar.gz manaplus-1e80a56b8444373997f3f7458bf0547c298c7abd.tar.bz2 manaplus-1e80a56b8444373997f3f7458bf0547c298c7abd.tar.xz manaplus-1e80a56b8444373997f3f7458bf0547c298c7abd.zip |
dont call virtual functions in characterview constructor.
Diffstat (limited to 'src/gui/widgets/characterviewsmall.cpp')
-rw-r--r-- | src/gui/widgets/characterviewsmall.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/widgets/characterviewsmall.cpp b/src/gui/widgets/characterviewsmall.cpp index 6cdb01c7e..010bb3bba 100644 --- a/src/gui/widgets/characterviewsmall.cpp +++ b/src/gui/widgets/characterviewsmall.cpp @@ -45,7 +45,12 @@ CharacterViewSmall::CharacterViewSmall(CharSelectDialog *const widget, { add(*it); } - show(0); + const int sz = static_cast<signed>(mCharacterEntries->size()); + mSelected = 0; + mSelectedEntry = (*mCharacterEntries)[mSelected]; + mSelectedEntry->setVisible(true); + mNumber->setCaption(strprintf("%d / %d", mSelected + 1, sz)); + mNumber->adjustSize(); } add(mPrevious); add(mNext); |