Commit ed3b9849 authored by hjk's avatar hjk

debugger: fix bug in new watch model that led to not re-fetching outdated information.

parent 41ec53b6
......@@ -82,16 +82,16 @@ static int generationCounter = 0;
class WatchItem : public WatchData
{
public:
WatchItem() { parent = 0; fetchedTriggered = 0; }
WatchItem() { parent = 0; fetchTriggered = false; }
WatchItem(const WatchData &data) : WatchData(data)
{ parent = 0; fetchedTriggered = 0; }
{ parent = 0; fetchTriggered = false; }
void setData(const WatchData &data)
{ static_cast<WatchData &>(*this) = data; }
WatchItem *parent;
bool fetchedTriggered; // children fetch has been triggered
bool fetchTriggered; // children fetch has been triggered
QList<WatchItem *> children; // fetched children
};
......@@ -303,7 +303,7 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
item->hasChildren = true;
item->state = 0;
item->parent = m_root;
item->fetchedTriggered = true;
item->fetchTriggered = true;
m_root->children.append(item);
}
......@@ -346,9 +346,11 @@ void WatchModel::removeOutdatedHelper(WatchItem *item)
{
if (item->generation < generationCounter)
removeItem(item);
else
else {
foreach (WatchItem *child, item->children)
removeOutdatedHelper(child);
item->fetchTriggered = false;
}
}
void WatchModel::removeItem(WatchItem *item)
......@@ -479,15 +481,15 @@ QString niceType(QString type)
bool WatchModel::canFetchMore(const QModelIndex &index) const
{
return index.isValid() && !watchItem(index)->fetchedTriggered;
return index.isValid() && !watchItem(index)->fetchTriggered;
}
void WatchModel::fetchMore(const QModelIndex &index)
{
QTC_ASSERT(index.isValid(), return);
QTC_ASSERT(!watchItem(index)->fetchedTriggered, return);
QTC_ASSERT(!watchItem(index)->fetchTriggered, return);
if (WatchItem *item = watchItem(index)) {
item->fetchedTriggered = true;
item->fetchTriggered = true;
WatchData data = *item;
data.setChildrenNeeded();
emit m_handler->watchDataUpdateNeeded(data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment