Commit 10fbbe1f authored by Boudewijn Rempt's avatar Boudewijn Rempt

Use categorized debugging

parent aa4ca553
......@@ -328,7 +328,7 @@ public:
qint32 *groupMapPtr = reinterpret_cast<qint32*>(m_groupMapIt->rawData());
if (*groupMapPtr != 0) {
qDebug() << ppVar(*groupMapPtr) << ppVar(m_groupIndex);
dbgImage << ppVar(*groupMapPtr) << ppVar(m_groupIndex);
}
KIS_SAFE_ASSERT_RECOVER_NOOP(*groupMapPtr == 0);
......
......@@ -52,7 +52,7 @@
#ifdef DEBUG_MERGER
#define DEBUG_NODE_ACTION(message, type, leaf, rect) \
qDebug() << message << type << ":" << leaf->node()->name() << rect
dbgImage << message << type << ":" << leaf->node()->name() << rect
#else
#define DEBUG_NODE_ACTION(message, type, leaf, rect)
#endif
......
......@@ -220,7 +220,7 @@ KisGaussianKernel::createLoGMatrix(qreal radius, qreal coeff)
sideSum *= scale;
quarterSum *= scale;
//qDebug() << ppVar(positiveSum) << ppVar(sideSum) << ppVar(quarterSum);
//dbgImage << ppVar(positiveSum) << ppVar(sideSum) << ppVar(quarterSum);
return matrix;
}
......
......@@ -1055,7 +1055,7 @@ namespace KisLayerUtils {
while (it != nodes.end()) {
if ((!allowMasks && !qobject_cast<KisLayer*>(it->data())) ||
checkIsChildOf(*it, nodes)) {
//qDebug() << "Skipping node" << ppVar((*it)->name());
//dbgImage << "Skipping node" << ppVar((*it)->name());
it = nodes.erase(it);
} else {
++it;
......
......@@ -41,6 +41,6 @@ void kis_debug_save_device_incremental(KisPaintDeviceSP device,
saveRect = device->exactBounds();
}
qDebug() << "Dumping:" << filename;
dbgImage << "Dumping:" << filename;
device->convertToQImage(0, saveRect).save(filename);
}
......@@ -316,7 +316,7 @@ void KisPropertiesConfiguration::dump() const
{
QMap<QString, QVariant>::Iterator it;
for (it = d->properties.begin(); it != d->properties.end(); ++it) {
qDebug() << it.key() << " = " << it.value() << it.value().typeName();
dbgImage << it.key() << " = " << it.value() << it.value().typeName();
}
}
......
......@@ -641,11 +641,11 @@ void KisStrokesQueue::debugDumpAllStrokes()
{
QMutexLocker locker(&m_d->mutex);
qDebug() <<"===";
dbgImage <<"===";
Q_FOREACH (KisStrokeSP stroke, m_d->strokesQueue) {
qDebug() << ppVar(stroke->name()) << ppVar(stroke->type()) << ppVar(stroke->numJobs()) << ppVar(stroke->isInitialized()) << ppVar(stroke->isCancelled());
dbgImage << ppVar(stroke->name()) << ppVar(stroke->type()) << ppVar(stroke->numJobs()) << ppVar(stroke->isInitialized()) << ppVar(stroke->isCancelled());
}
qDebug() <<"===";
dbgImage <<"===";
}
void KisStrokesQueue::setLod0ToNStrokeStrategyFactory(const KisLodSyncStrokeStrategyFactory &factory)
......
......@@ -253,7 +253,7 @@ QRect KisTransformMask::decorateRect(KisPaintDeviceSP &src,
KisPainter::copyAreaOptimized(updatedRect.topLeft(), m_d->staticCacheDevice, dst, updatedRect);
#ifdef DEBUG_RENDERING
qDebug() << "Recalculate" << name() << ppVar(src->exactBounds()) << ppVar(dst->exactBounds()) << ppVar(rc);
dbgImage << "Recalculate" << name() << ppVar(src->exactBounds()) << ppVar(dst->exactBounds()) << ppVar(rc);
KIS_DUMP_DEVICE_2(src, DUMP_RECT, "recalc_src", "dd");
KIS_DUMP_DEVICE_2(dst, DUMP_RECT, "recalc_dst", "dd");
#endif /* DEBUG_RENDERING */
......@@ -262,7 +262,7 @@ QRect KisTransformMask::decorateRect(KisPaintDeviceSP &src,
m_d->worker.runPartialDst(src, dst, rc);
#ifdef DEBUG_RENDERING
qDebug() << "Partial" << name() << ppVar(src->exactBounds()) << ppVar(src->extent()) << ppVar(dst->exactBounds()) << ppVar(dst->extent()) << ppVar(rc);
dbgImage << "Partial" << name() << ppVar(src->exactBounds()) << ppVar(src->extent()) << ppVar(dst->exactBounds()) << ppVar(dst->extent()) << ppVar(rc);
KIS_DUMP_DEVICE_2(src, DUMP_RECT, "partial_src", "dd");
KIS_DUMP_DEVICE_2(dst, DUMP_RECT, "partial_dst", "dd");
#endif /* DEBUG_RENDERING */
......@@ -271,7 +271,7 @@ QRect KisTransformMask::decorateRect(KisPaintDeviceSP &src,
KisPainter::copyAreaOptimized(rc.topLeft(), m_d->staticCacheDevice, dst, rc);
#ifdef DEBUG_RENDERING
qDebug() << "Fetch" << name() << ppVar(src->exactBounds()) << ppVar(dst->exactBounds()) << ppVar(rc);
dbgImage << "Fetch" << name() << ppVar(src->exactBounds()) << ppVar(dst->exactBounds()) << ppVar(rc);
KIS_DUMP_DEVICE_2(src, DUMP_RECT, "fetch_src", "dd");
KIS_DUMP_DEVICE_2(dst, DUMP_RECT, "fetch_dst", "dd");
#endif /* DEBUG_RENDERING */
......
......@@ -851,7 +851,7 @@ void KisWatershedWorker::Private::cleanupForeignEdgeGroups(qreal cleanUpAmount)
const qreal minMetric = min(lengthStats) / qreal(thisLength);
const qreal meanMetric = mean(lengthStats) / qreal(thisLength);
// qDebug() << "G" << groupIndex
// dbgImage << "G" << groupIndex
// << "L" << levelIndex
// << "con" << level.conflictWithGroup.size()
// << "FRP" << thisForeignPortion
......@@ -865,7 +865,7 @@ void KisWatershedWorker::Private::cleanupForeignEdgeGroups(qreal cleanUpAmount)
if (!(thisForeignPortion > foreignEdgePortionThreshold)) continue;
if (minMetric > 1.0 && meanMetric > 1.2) {
// qDebug() << " * removing...";
// dbgImage << " * removing...";
QVector<TaskPoint> taskPoints =
tryRemoveConflictingPlane(groupIndex, levelIndex);
......@@ -987,16 +987,16 @@ void KisWatershedWorker::Private::dumpGroupInfo(qint32 groupIndex, quint8 levelI
{
FillGroup::LevelData &level = groups[groupIndex].levels[levelIndex];
qDebug() << "G" << groupIndex << "L" << levelIndex << "CI" << this->groups[groupIndex].colorIndex;
qDebug() << " P" << level.positiveEdgeSize;
qDebug() << " N" << level.negativeEdgeSize;
qDebug() << " F" << level.foreignEdgeSize;
qDebug() << " A" << level.allyEdgeSize;
qDebug() << " (S)" << level.numFilledPixels;
dbgImage << "G" << groupIndex << "L" << levelIndex << "CI" << this->groups[groupIndex].colorIndex;
dbgImage << " P" << level.positiveEdgeSize;
dbgImage << " N" << level.negativeEdgeSize;
dbgImage << " F" << level.foreignEdgeSize;
dbgImage << " A" << level.allyEdgeSize;
dbgImage << " (S)" << level.numFilledPixels;
auto &c = level.conflictWithGroup;
for (auto cIt = c.begin(); cIt != c.end(); ++cIt) {
qDebug() << " C" << cIt.key() << cIt.value().size();
dbgImage << " C" << cIt.key() << cIt.value().size();
}
}
......@@ -767,7 +767,7 @@ public:
} else if (m_bLabelArea.contains(pt) && findInRects(m_bLabelRects, pt) && !out_edge_index--) {
dst_vertex = vertex_descriptor(0, 0, vertex_descriptor::LABEL_B);
} else {
qDebug() << ppVar(vertex) << ppVar(out_edge_index) << ppVar(out_degree(vertex));
dbgImage << ppVar(vertex) << ppVar(out_edge_index) << ppVar(out_degree(vertex));
qFatal("Wrong edge sub-index");
}
break;
......
......@@ -89,7 +89,7 @@ public:
public:
inline uint metaDataCount()
{
qDebug() << "number of layers with metadata" << m_metaDataObjectsEncountered;
dbgImage << "number of layers with metadata" << m_metaDataObjectsEncountered;
return m_metaDataObjectsEncountered;
}
......
......@@ -24,7 +24,6 @@
#include <QApplication>
#include <QBuffer>
#include <QComboBox>
#include <QDebug>
#include <QDialogButtonBox>
#include <QDoubleSpinBox>
#include <QFontComboBox>
......@@ -223,20 +222,6 @@ void SvgTextEditor::switchTextEditorTab()
if (m_shape) {
// Convert the svg text to html XXX: Fix resolution! Also, the rect should be the image rect, not the shape rect.
/**
if (!converter.convertFromSvg(m_textEditorWidget.svgTextEdit->document()->toPlainText(), m_textEditorWidget.svgStylesEdit->document()->toPlainText(),
m_shape->boundingRect(), 72.0)) {
qDebug() << "Eeek 3";
}
QString html;
if (!converter.convertToHtml(&html)) {
qDebug() << "Eeek 4";
}
m_textEditorWidget.richTextEdit->document()->setHtml(html);
*/
QTextDocument *doc = m_textEditorWidget.richTextEdit->document();
if (!converter.convertSvgToDocument(m_textEditorWidget.svgTextEdit->document()->toPlainText(), doc)) {
qWarning()<<"new converter svgToDoc doesn't work!";
......@@ -607,7 +592,6 @@ void SvgTextEditor::increaseTextSize()
if (pointSize<0) {
pointSize = m_textEditorWidget.richTextEdit->textCursor().charFormat().font().pixelSize();
}
qDebug()<<pointSize;
format.setFontPointSize(pointSize+1.0);
m_textEditorWidget.richTextEdit->mergeCurrentCharFormat(format);
}
......@@ -722,7 +706,6 @@ void SvgTextEditor::setSettings()
settingsDialog.setButtons(KoDialog::Ok | KoDialog::Cancel);
if (settingsDialog.exec() == QDialog::Accepted) {
qDebug() << "saving settings";
// save and set the settings
QStringList writingSystems;
for (int i = 0; i < writingSystemsModel->rowCount(); i++) {
......
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