CComponents: use neutrino debug mode for debug output

Origin commit data
------------------
Branch: ni/coolstream
Commit: 750691fbbf
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-03-08 (Sat, 08 Mar 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2014-03-08 22:39:23 +01:00
parent bae0f14f3f
commit ebd0111d37
8 changed files with 58 additions and 93 deletions

View File

@@ -31,7 +31,7 @@
#include "cc_frm.h"
#include <stdlib.h>
#include <algorithm>
#include <system/debug.h>
using namespace std;
//-------------------------------------------------------------------------------------------------------
@@ -79,15 +79,12 @@ void CComponentsForm::clear()
{
if (v_cc_items.empty())
return;
#ifdef DEBUG_CC
printf(" [CComponentsForm] %s... delete %d cc-item(s) \n", __func__, (int)v_cc_items.size());
#endif
for(size_t i=0; i<v_cc_items.size(); i++) {
if (v_cc_items[i]){
#ifdef DEBUG_CC
printf(" [CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\n", __func__, (int)i+1, (int)v_cc_items.size(), v_cc_items[i]->getItemType());
#endif
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\n", __func__, (int)i+1, (int)v_cc_items.size(), v_cc_items[i]->getItemType());
delete v_cc_items[i];
v_cc_items[i] = NULL;
}
@@ -99,26 +96,22 @@ void CComponentsForm::clear()
void CComponentsForm::addCCItem(CComponentsItem* cc_Item)
{
if (cc_Item){
#ifdef DEBUG_CC
printf(" [CComponentsForm] %s-%d try to add cc_Item [type %d] to form [current index=%d] \n", __func__, __LINE__, cc_Item->getItemType(), cc_item_index);
#endif
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s-%d try to add cc_Item [type %d] to form [current index=%d] \n", __func__, __LINE__, cc_Item->getItemType(), cc_item_index);
cc_Item->setParent(this);
v_cc_items.push_back(cc_Item);
#ifdef DEBUG_CC
printf(" added cc_Item [type %d] to form [current index=%d] \n", cc_Item->getItemType(), cc_item_index);
#endif
dprintf(DEBUG_DEBUG, "\tadded cc_Item [type %d] to form [current index=%d] \n", cc_Item->getItemType(), cc_item_index);
//assign item index
int new_index = genIndex();
cc_Item->setIndex(new_index);
#ifdef DEBUG_CC
printf(" %s-%d parent index = %d, assigned index ======> %d\n", __func__, __LINE__, cc_item_index, new_index);
#endif
dprintf(DEBUG_DEBUG, "\t%s-%d parent index = %d, assigned index ======> %d\n", __func__, __LINE__, cc_item_index, new_index);
}
#ifdef DEBUG_CC
else
printf(" [CComponentsForm] %s-%d tried to add an empty or invalide cc_item !!!\n", __func__, __LINE__);
#endif
dprintf(DEBUG_NORMAL, "[CComponentsForm] %s-%d tried to add an empty or invalide cc_item !!!\n", __func__, __LINE__);
}
void CComponentsForm::addCCItem(const std::vector<CComponentsItem*> &cc_Items)
@@ -167,11 +160,8 @@ void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new
v_cc_items[cc_item_id] = new_cc_Item;
}
}
#ifdef DEBUG_CC
else
printf("[CComponentsForm] %s replace cc_Item not possible, v_cc_items is empty\n", __func__);
#endif
dprintf(DEBUG_NORMAL, "[CComponentsForm] %s replace cc_Item not possible, v_cc_items is empty\n", __func__);
}
void CComponentsForm::replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item)
@@ -183,17 +173,13 @@ void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_I
{
if (cc_Item == NULL){
#ifdef DEBUG_CC
printf("[CComponentsForm] %s parameter: cc_Item = %p...\n", __func__, cc_Item);
#endif
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s parameter: cc_Item = %p...\n", __func__, cc_Item);
return;
}
if (v_cc_items.empty()){
addCCItem(cc_Item);
#ifdef DEBUG_CC
printf("[CComponentsForm] %s insert cc_Item not possible, v_cc_items is empty, cc_Item added\n", __func__);
#endif
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s insert cc_Item not possible, v_cc_items is empty, cc_Item added\n", __func__);
}else{
v_cc_items.insert(v_cc_items.begin()+cc_item_id, cc_Item);
cc_Item->setParent(this);
@@ -212,10 +198,8 @@ void CComponentsForm::removeCCItem(const uint& cc_item_id)
v_cc_items.erase(v_cc_items.begin()+cc_item_id);
}
}
#ifdef DEBUG_CC
else
printf("[CComponentsForm] %s removing cc_Item not possible, v_cc_items is empty...\n", __func__);
#endif
dprintf(DEBUG_NORMAL, "[CComponentsForm] %s removing cc_Item not possible, v_cc_items is empty...\n", __func__);
}
void CComponentsForm::removeCCItem(CComponentsItem* cc_Item)