4 * @author Olavi Pulkkinen <olavi.pulkkinena@fudeco.com>
5 * @copyright (c) 2010 Speed Freak team
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 #include "categorylist.h"
13 *Constructor of this class.
15 CategoryList::CategoryList()
21 *Destructor of this class. Should be used to release all allocated resources.
23 CategoryList::~CategoryList()
28 *This is return function.
29 *@return QStringList categoryList
31 QStringList CategoryList::getCategoryList()
33 qDebug() << "_getCategoryList" ;
38 *Append an item in the end of the categorylist.
41 void CategoryList::appendCategoryList(QString item)
43 categoryList.append(item);
47 *Input an item into the categorylist.
49 *@param Item to be appended.
51 void CategoryList::fillCategoryList(int index, QString item)
53 categoryList.insert(index, item);
57 *Show an item of the categorylist.
60 QString CategoryList::itemOfCategoryList(int index)
62 return categoryList.at(index);
68 void CategoryList::clearCategoryList()
74 *Read size of categorylist.
76 int CategoryList::sizeOfCategoryList()
78 return categoryList.size();
82 *Append an item in the end of the categoryelementable.
84 *@param Description of category.
88 void CategoryList::appendCats(int ind, QString des, QString uni, QString cat)
90 cats[ind].description = des;
92 cats[ind].category = cat;
98 QString CategoryList::desOfCats(int ind)
100 return cats[ind].description;
106 void CategoryList::clearCats()
108 for(int i = 0; i < 10; i++)
110 cats[i].description.clear();
111 cats[i].unit.clear();
112 cats[i].category.clear();
117 *This function is used to get items to top list of the category that is chosen from combobox.
118 *@param QString category
121 QString CategoryList::getTopList( QString category, int size)
123 qDebug() << "_getTopList";
125 if(!(top10List.isEmpty()))
131 QString emptyStr("");
132 qDebug() << "_getTopList: Category not found";