X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=src%2Fvogleditor%2Fvogleditor_apicalltreeitem.cpp;h=e616f0fb0bc50c8b002529e3c6527ca06cc6741c;hb=0953010bf1fc3f912eec9978458003768a5d7735;hp=32ff10ac4f57a8987177218f83d820bf8b8904c1;hpb=16fc4b597a57c1a1ba5972843587f2b620e8c2ff;p=vogl diff --git a/src/vogleditor/vogleditor_apicalltreeitem.cpp b/src/vogleditor/vogleditor_apicalltreeitem.cpp index 32ff10a..e616f0f 100644 --- a/src/vogleditor/vogleditor_apicalltreeitem.cpp +++ b/src/vogleditor/vogleditor_apicalltreeitem.cpp @@ -35,7 +35,8 @@ vogleditor_apiCallTreeItem::vogleditor_apiCallTreeItem(vogleditor_QApiCallTreeMo : m_parentItem(NULL), m_pApiCallItem(NULL), m_pFrameItem(NULL), - m_pModel(pModel) + m_pModel(pModel), + m_localRowIndex(0) { m_columnData[VOGL_ACTC_APICALL] = "API Call"; m_columnData[VOGL_ACTC_INDEX] = "Index"; @@ -51,7 +52,8 @@ vogleditor_apiCallTreeItem::vogleditor_apiCallTreeItem(vogleditor_frameItem* fra : m_parentItem(parent), m_pApiCallItem(NULL), m_pFrameItem(frameItem), - m_pModel(NULL) + m_pModel(NULL), + m_localRowIndex(0) { if (frameItem != NULL) { @@ -71,7 +73,8 @@ vogleditor_apiCallTreeItem::vogleditor_apiCallTreeItem(QString nodeText, vogledi : m_parentItem(parent), m_pApiCallItem(apiCallItem), m_pFrameItem(NULL), - m_pModel(NULL) + m_pModel(NULL), + m_localRowIndex(0) { m_columnData[VOGL_ACTC_APICALL] = nodeText; @@ -96,19 +99,19 @@ vogleditor_apiCallTreeItem::~vogleditor_apiCallTreeItem() { if (m_pFrameItem != NULL) { - delete m_pFrameItem; + vogl_delete(m_pFrameItem); m_pFrameItem = NULL; } if (m_pApiCallItem != NULL) { - delete m_pApiCallItem; + vogl_delete(m_pApiCallItem); m_pApiCallItem = NULL; } for (int i = 0; i < m_childItems.size(); i++) { - delete m_childItems[i]; + vogl_delete(m_childItems[i]); m_childItems[i] = NULL; } @@ -122,7 +125,8 @@ vogleditor_apiCallTreeItem* vogleditor_apiCallTreeItem::parent() const void vogleditor_apiCallTreeItem::appendChild(vogleditor_apiCallTreeItem* pChild) { - m_childItems.append(pChild); + pChild->m_localRowIndex = m_childItems.size(); + m_childItems.append(pChild); } int vogleditor_apiCallTreeItem::childCount() const @@ -252,8 +256,5 @@ QVariant vogleditor_apiCallTreeItem::columnData(int column, int role) const int vogleditor_apiCallTreeItem::row() const { // note, this is just the row within the current level of the hierarchy - if (m_parentItem) - return m_parentItem->m_childItems.indexOf(const_cast(this)); - - return 0; + return m_localRowIndex; }