rename QWB_ASSERT into QTC_ASSERT

This commit is contained in:
hjk
2008-12-09 12:08:56 +01:00
parent 3b315ed4d4
commit 9cdbb1527b
10 changed files with 62 additions and 62 deletions

View File

@@ -426,7 +426,7 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const
int node = idx.internalId();
if (node < 0)
return QVariant();
QWB_ASSERT(node < m_displaySet.size(), return QVariant());
QTC_ASSERT(node < m_displaySet.size(), return QVariant());
const WatchData &data = m_displaySet.at(node);
@@ -702,10 +702,10 @@ void WatchHandler::rebuildModel()
// Possibly append dummy items to prevent empty views
bool ok = true;
QWB_ASSERT(m_displaySet.size() >= 2, ok = false);
QWB_ASSERT(m_displaySet.at(1).iname == "local", ok = false);
QWB_ASSERT(m_displaySet.at(2).iname == "tooltip", ok = false);
QWB_ASSERT(m_displaySet.at(3).iname == "watch", ok = false);
QTC_ASSERT(m_displaySet.size() >= 2, ok = false);
QTC_ASSERT(m_displaySet.at(1).iname == "local", ok = false);
QTC_ASSERT(m_displaySet.at(2).iname == "tooltip", ok = false);
QTC_ASSERT(m_displaySet.at(3).iname == "watch", ok = false);
if (ok) {
for (int i = 1; i <= 3; ++i) {
WatchData &data = m_displaySet[i];
@@ -777,7 +777,7 @@ void WatchHandler::collapseChildren(const QModelIndex &idx)
qDebug() << "WATCHHANDLER: COLLAPSE IGNORED" << idx;
return;
}
QWB_ASSERT(checkIndex(idx.internalId()), return);
QTC_ASSERT(checkIndex(idx.internalId()), return);
#if 0
QString iname0 = m_displaySet.at(idx.internalId()).iname;
MODEL_DEBUG("COLLAPSE NODE" << iname0);
@@ -806,11 +806,11 @@ void WatchHandler::expandChildren(const QModelIndex &idx)
int index = idx.internalId();
if (index == 0)
return;
QWB_ASSERT(index >= 0, qDebug() << toString() << index; return);
QWB_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
QTC_ASSERT(index >= 0, qDebug() << toString() << index; return);
QTC_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
const WatchData &display = m_displaySet.at(index);
QWB_ASSERT(index >= 0, qDebug() << toString() << index; return);
QWB_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
QTC_ASSERT(index >= 0, qDebug() << toString() << index; return);
QTC_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
const WatchData &complete = m_completeSet.at(index);
MODEL_DEBUG("\n\nEXPAND" << display.iname);
if (display.iname.isEmpty()) {
@@ -848,7 +848,7 @@ void WatchHandler::expandChildren(const QModelIndex &idx)
void WatchHandler::insertData(const WatchData &data)
{
//MODEL_DEBUG("INSERTDATA: " << data.toString());
QWB_ASSERT(data.isValid(), return);
QTC_ASSERT(data.isValid(), return);
if (data.isSomethingNeeded())
insertDataHelper(m_incompleteSet, data);
else
@@ -977,7 +977,7 @@ bool WatchHandler::canFetchMore(const QModelIndex &parent) const
// needs to be made synchronous to be useful. Busy loop is no good.
if (!parent.isValid())
return false;
QWB_ASSERT(checkIndex(parent.internalId()), return false);
QTC_ASSERT(checkIndex(parent.internalId()), return false);
const WatchData &data = m_displaySet.at(parent.internalId());
MODEL_DEBUG("CAN FETCH MORE: " << parent << " children: " << data.childCount
<< data.iname);
@@ -990,7 +990,7 @@ void WatchHandler::fetchMore(const QModelIndex &parent)
MODEL_DEBUG("FETCH MORE: " << parent);
return;
QWB_ASSERT(checkIndex(parent.internalId()), return);
QTC_ASSERT(checkIndex(parent.internalId()), return);
QString iname = m_displaySet.at(parent.internalId()).iname;
if (m_inFetchMore) {
@@ -1049,15 +1049,15 @@ QModelIndex WatchHandler::index(int row, int col, const QModelIndex &parent) con
MODEL_DEBUG(" -> " << QModelIndex() << " (2) ");
return QModelIndex();
}
QWB_ASSERT(checkIndex(parentIndex), return QModelIndex());
QTC_ASSERT(checkIndex(parentIndex), return QModelIndex());
const WatchData &data = m_displaySet.at(parentIndex);
QWB_ASSERT(row >= 0, qDebug() << "ROW: " << row << "PARENT: " << parent
QTC_ASSERT(row >= 0, qDebug() << "ROW: " << row << "PARENT: " << parent
<< data.toString() << toString(); return QModelIndex());
QWB_ASSERT(row < data.childIndex.size(),
QTC_ASSERT(row < data.childIndex.size(),
MODEL_DEBUG("ROW: " << row << data.toString() << toString());
return QModelIndex());
QModelIndex idx = createIndex(row, col, data.childIndex.at(row));
QWB_ASSERT(idx.row() == m_displaySet.at(idx.internalId()).row,
QTC_ASSERT(idx.row() == m_displaySet.at(idx.internalId()).row,
return QModelIndex());
MODEL_DEBUG(" -> " << idx << " (A) ");
return idx;
@@ -1071,15 +1071,15 @@ QModelIndex WatchHandler::parent(const QModelIndex &idx) const
}
MODEL_DEBUG("PARENT " << idx);
int currentIndex = idx.internalId();
QWB_ASSERT(checkIndex(currentIndex), return QModelIndex());
QWB_ASSERT(idx.row() == m_displaySet.at(currentIndex).row,
QTC_ASSERT(checkIndex(currentIndex), return QModelIndex());
QTC_ASSERT(idx.row() == m_displaySet.at(currentIndex).row,
MODEL_DEBUG("IDX: " << idx << toString(); return QModelIndex()));
int parentIndex = m_displaySet.at(currentIndex).parentIndex;
if (parentIndex < 0) {
MODEL_DEBUG(" -> " << QModelIndex() << " (2) ");
return QModelIndex();
}
QWB_ASSERT(checkIndex(parentIndex), return QModelIndex());
QTC_ASSERT(checkIndex(parentIndex), return QModelIndex());
QModelIndex parent =
createIndex(m_displaySet.at(parentIndex).row, 0, parentIndex);
MODEL_DEBUG(" -> " << parent);
@@ -1094,7 +1094,7 @@ int WatchHandler::rowCount(const QModelIndex &idx) const
return 0;
}
int thisIndex = idx.internalId();
QWB_ASSERT(checkIndex(thisIndex), return 0);
QTC_ASSERT(checkIndex(thisIndex), return 0);
if (idx.row() == -1 && idx.column() == -1) {
MODEL_DEBUG(" -> " << 3 << " (B) ");
return 1;
@@ -1129,7 +1129,7 @@ int WatchHandler::columnCount(const QModelIndex &idx) const
return 0;
}
MODEL_DEBUG(" -> " << 3 << " (B) ");
QWB_ASSERT(checkIndex(idx.internalId()), return 3);
QTC_ASSERT(checkIndex(idx.internalId()), return 3);
return 3;
}
@@ -1139,7 +1139,7 @@ bool WatchHandler::hasChildren(const QModelIndex &idx) const
bool base = rowCount(idx) > 0 && columnCount(idx) > 0;
MODEL_DEBUG("HAS CHILDREN: " << idx << base);
return base;
QWB_ASSERT(checkIndex(idx.internalId()), return false);
QTC_ASSERT(checkIndex(idx.internalId()), return false);
const WatchData &data = m_displaySet.at(idx.internalId());
MODEL_DEBUG("HAS CHILDREN: " << idx << data.toString());
return data.childCount > 0; // || data.childIndex.size() > 0;