summaryrefslogtreecommitdiff
path: root/src/gui/models/shopitems.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-06 16:58:18 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-06 16:58:18 +0300
commitd557ce63e240960746e48c678b4a08ba66f7fe40 (patch)
tree8dfa33e155d7ea2145df9056895f0c1293155349 /src/gui/models/shopitems.cpp
parent8e243bbcdae592e1c003e5d2c37c8f0e8f1304e7 (diff)
downloadplus-d557ce63e240960746e48c678b4a08ba66f7fe40.tar.gz
plus-d557ce63e240960746e48c678b4a08ba66f7fe40.tar.bz2
plus-d557ce63e240960746e48c678b4a08ba66f7fe40.tar.xz
plus-d557ce63e240960746e48c678b4a08ba66f7fe40.zip
Add custom currency also into shop items list.
Diffstat (limited to 'src/gui/models/shopitems.cpp')
-rw-r--r--src/gui/models/shopitems.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/gui/models/shopitems.cpp b/src/gui/models/shopitems.cpp
index 061da5110..94bba3be4 100644
--- a/src/gui/models/shopitems.cpp
+++ b/src/gui/models/shopitems.cpp
@@ -28,10 +28,12 @@
#include "debug.h"
-ShopItems::ShopItems(const bool mergeDuplicates) :
+ShopItems::ShopItems(const bool mergeDuplicates,
+ const std::string &currency) :
ListModel(),
mAllShopItems(),
mShopItems(),
+ mCurrency(currency),
mMergeDuplicates(mergeDuplicates)
{
}
@@ -58,7 +60,13 @@ ShopItem *ShopItems::addItem(const int id,
const int amount,
const int price)
{
- ShopItem *const item = new ShopItem(-1, id, type, color, amount, price);
+ ShopItem *const item = new ShopItem(-1,
+ id,
+ type,
+ color,
+ amount,
+ price,
+ mCurrency);
mShopItems.push_back(item);
mAllShopItems.push_back(item);
return item;
@@ -73,7 +81,13 @@ ShopItem *ShopItems::addItemNoDup(const int id,
ShopItem *item = findItem(id, color);
if (!item)
{
- item = new ShopItem(-1, id, type, color, amount, price);
+ item = new ShopItem(-1,
+ id,
+ type,
+ color,
+ amount,
+ price,
+ mCurrency);
mShopItems.push_back(item);
mAllShopItems.push_back(item);
}
@@ -97,7 +111,13 @@ ShopItem *ShopItems::addItem2(const int inventoryIndex,
}
else
{
- item = new ShopItem(inventoryIndex, id, type, color, quantity, price);
+ item = new ShopItem(inventoryIndex,
+ id,
+ type,
+ color,
+ quantity,
+ price,
+ mCurrency);
mShopItems.push_back(item);
mAllShopItems.push_back(item);
}