Make debug messages conditional.

You can swich it on/off via defining ADS_DEBUG_PRINT
By default massages wouldn't be printed.
This commit is contained in:
Jak Erdy - SBI
2019-07-21 14:53:24 +07:00
parent bf27207dd9
commit 10fbb6f302
10 changed files with 79 additions and 69 deletions

View File

@@ -356,7 +356,7 @@ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget
//============================================================================
CDockAreaWidget::~CDockAreaWidget()
{
qDebug() << "~CDockAreaWidget()";
ADS_PRINT("~CDockAreaWidget()");
delete d->ContentsLayout;
delete d;
}
@@ -409,7 +409,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
//============================================================================
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
{
qDebug() << "CDockAreaWidget::removeDockWidget";
ADS_PRINT("CDockAreaWidget::removeDockWidget");
auto NextOpenDockWidget = nextOpenDockWidget(DockWidget);
d->ContentsLayout->removeWidget(DockWidget);
@@ -423,7 +423,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
}
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() > 1)
{
qDebug() << "Dock Area empty";
ADS_PRINT("Dock Area empty");
DockContainer->removeDockArea(this);
this->deleteLater();
}
@@ -483,7 +483,7 @@ void CDockAreaWidget::hideAreaWithNoVisibleContent()
//============================================================================
void CDockAreaWidget::onTabCloseRequested(int Index)
{
qDebug() << "CDockAreaWidget::onTabCloseRequested " << Index;
ADS_PRINT("CDockAreaWidget::onTabCloseRequested " << Index);
dockWidget(Index)->toggleView(false);
}
@@ -646,11 +646,11 @@ CDockWidget* CDockAreaWidget::dockWidget(int Index) const
//============================================================================
void CDockAreaWidget::reorderDockWidget(int fromIndex, int toIndex)
{
qDebug() << "CDockAreaWidget::reorderDockWidget";
ADS_PRINT("CDockAreaWidget::reorderDockWidget");
if (fromIndex >= d->ContentsLayout->count() || fromIndex < 0
|| toIndex >= d->ContentsLayout->count() || toIndex < 0 || fromIndex == toIndex)
{
qDebug() << "Invalid index for tab movement" << fromIndex << toIndex;
ADS_PRINT("Invalid index for tab movement" << fromIndex << toIndex);
return;
}
@@ -705,8 +705,8 @@ void CDockAreaWidget::saveState(QXmlStreamWriter& s) const
auto CurrentDockWidget = currentDockWidget();
QString Name = CurrentDockWidget ? CurrentDockWidget->objectName() : "";
s.writeAttribute("Current", Name);
qDebug() << "CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
<< " Current: " << Name;
ADS_PRINT("CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
<< " Current: " << Name);
for (int i = 0; i < d->ContentsLayout->count(); ++i)
{
dockWidget(i)->saveState(s);