closes #1: Favorite buttons has been extended with category buttons.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#include "commodityservice.h"
|
||||
|
||||
QList<QSharedPointer<IShopItem> > CommodityService::shopItems()
|
||||
QList<QSharedPointer<IShopItem> > CommodityService::shopItems(const QString& category/* = ""*/)
|
||||
{
|
||||
QList<QSharedPointer<IShopItem> > ret;
|
||||
|
||||
foreach (QSharedPointer<CommodityData> data, all()) {
|
||||
ret.append(qSharedPointerDynamicCast<IShopItem, CommodityData>(data));
|
||||
if (category.isEmpty() || (data->favorite() && data->category() == category)) {
|
||||
ret.append(qSharedPointerDynamicCast<IShopItem, CommodityData>(data));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user