TreeModel: Clean up TreeItem API

isLazy/populate was the first incarnation of the canFetchMore/
fetchMore mechanism which now can take over completely. So:

- remove isLazy/populate
- the use in VariableChooser

Change-Id: I885d492c134fb6899759e19a73156b52df7a880a
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
hjk
2015-04-22 15:56:03 +02:00
parent 2b19081cb0
commit 66fd805809
3 changed files with 12 additions and 39 deletions

View File

@@ -127,9 +127,8 @@ class VariableGroupItem : public TreeItem
{
public:
VariableGroupItem()
: m_chooser(0)
: m_chooser(0), m_populated(false)
{
setLazy(true);
}
QVariant data(int column, int role) const
@@ -143,16 +142,23 @@ public:
return QVariant();
}
void populate()
bool canFetchMore() const
{
return !m_populated;
}
void fetchMore()
{
if (MacroExpander *expander = m_provider())
populateGroup(expander);
m_populated = true;
}
void populateGroup(MacroExpander *expander);
public:
VariableChooserPrivate *m_chooser; // Not owned.
bool m_populated;
MacroExpanderProvider m_provider;
};