forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user