some optimizations

This commit is contained in:
arcan1s
2015-09-08 00:07:47 +03:00
parent f5e40d084d
commit ab0ab0d40f
4 changed files with 99 additions and 105 deletions

View File

@ -50,7 +50,15 @@ public:
qCDebug(LOG_LIB);
m_items.clear();
}
m_activeItems.clear();
};
QList<T *> activeItems()
{
qCDebug(LOG_LIB);
return m_activeItems;
};
void editItems()
{
@ -61,14 +69,6 @@ public:
qCInfo(LOG_LIB) << "Dialog returns" << ret;
};
void initItems()
{
qCDebug(LOG_LIB);
m_items.clear();
m_items = getItems();
};
T *itemByTag(const QString _tag) const
{
qCDebug(LOG_LIB);
@ -84,7 +84,7 @@ public:
qCWarning(LOG_LIB) << "Could not find item by tag" << _tag;
return found;
}
};
T *itemByTagNumber(const int _number) const
{
@ -101,7 +101,7 @@ public:
qCWarning(LOG_LIB) << "Could not find item by number" << _number;
return found;
}
};
T *itemFromWidget() const
{
@ -143,6 +143,7 @@ public:
private:
QList<T *> m_items;
QList<T *> m_activeItems;
QString m_type;
// init method
@ -181,6 +182,18 @@ private:
return items;
};
void initItems()
{
qCDebug(LOG_LIB);
m_items.clear();
m_activeItems.clear();
m_items = getItems();
foreach(T *item, m_items)
if (item->isActive()) m_activeItems.append(item);
};
void repaint()
{
qCDebug(LOG_LIB);