*/
CategoryList::CategoryList()
{
-
+ qDebug() << "__CategoryList";
}
/**
*/
CategoryList::~CategoryList()
{
+ qDebug() << "__~CategoryList";
}
/**
*/
QStringList CategoryList::getCategoryList()
{
- qDebug() << "_getCategoryList" ;
+ qDebug() << "__getCategoryList" << realSizeOfCats;
+
+ if(sizeOfCategoryList() != 0) {
+ clearCategoryList();
+ }
+
+ for(int i = 0; i < realSizeOfCats; i++)
+ {
+ categoryList.append(cats[i].description);
+ }
+
return categoryList;
}
}
/**
- *Clear categs.
+ *Search description for an index af cats table.
+ *@param Index.
*/
-QString CategoryList::desOfCats(int ind)
+QString CategoryList::getRecentDescription(int ind)
{
return cats[ind].description;
}
/**
+ *Search category for an index af cats table.
+ *@param Index.
+ */
+QString CategoryList::getRecentCategory(int ind)
+{
+ return cats[ind].category;
+}
+
+/**
*Clear cats.
*/
void CategoryList::clearCats()
{
- for(int i = 0; i < 10; i++)
+ for(int i = 0; i < 20; i++)
{
cats[i].description.clear();
cats[i].unit.clear();
*This function is used to get items to top list of the category that is chosen from combobox.
*@param QString category
*@param int size
+ *@todo Now there is only one (the latest top10List). Later picking up the requested category.
*/
QString CategoryList::getTopList( QString category, int size)
{