summaryrefslogtreecommitdiff
path: root/src/gui/shortcut
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/shortcut')
-rw-r--r--src/gui/shortcut/shortcutbase.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/shortcut/shortcutbase.cpp b/src/gui/shortcut/shortcutbase.cpp
index 7bb11a8df..489805517 100644
--- a/src/gui/shortcut/shortcutbase.cpp
+++ b/src/gui/shortcut/shortcutbase.cpp
@@ -57,9 +57,10 @@ void ShortcutBase::load()
for (size_t i = 0; i < mMaxSize; i++)
{
- const int itemId = cfg->getValue(mItemName + toString(i), -1);
+ const std::string num = toString(CAST_S32(i));
+ const int itemId = cfg->getValue(mItemName + num, -1);
const ItemColor itemColor = fromInt(
- cfg->getValue(mColorName + toString(i), -1),
+ cfg->getValue(mColorName + num, -1),
ItemColor);
if (itemId != -1)
@@ -77,15 +78,16 @@ void ShortcutBase::save() const
const int itemId = mItems[i] != 0 ? mItems[i] : -1;
const int itemColor = (mItemColors[i] != ItemColor_zero)
? toInt(mItemColors[i], int) : 1;
+ const std::string num = toString(CAST_S32(i));
if (itemId != -1)
{
- serverConfig.setValue(mItemName + toString(i), itemId);
- serverConfig.setValue(mColorName + toString(i), itemColor);
+ serverConfig.setValue(mItemName + num, itemId);
+ serverConfig.setValue(mColorName + num, itemColor);
}
else
{
- serverConfig.deleteKey(mItemName + toString(i));
- serverConfig.deleteKey(mColorName + toString(i));
+ serverConfig.deleteKey(mItemName + num);
+ serverConfig.deleteKey(mColorName + num);
}
}
}