Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4fa86a75 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Port away from kdebug to qcdebug

The approach taken is a bit different from what's in the porting
scripts or in pigment: I've moved kis_debug to libglobal and adapted
the dbgKrita etc. defines to use qcDebug etc. I've kept the old
category numbers for now. I've also ported all places where we
used kDebug() etc. directly, and not a few places where qDebug() etc
were used directly.
parent 721a5d06
......@@ -46,6 +46,8 @@
// for posix_memalign()
#include <stdlib.h>
#include <kis_debug.h>
const int alpha_pos = 3;
enum AlphaRange {
......@@ -173,14 +175,14 @@ void generateDataLine(uint seed, int numPixels, quint8 *srcPixels, quint8 *dstPi
void printData(int numPixels, quint8 *srcPixels, quint8 *dstPixels, quint8 *mask)
{
for (int i = 0; i < numPixels; i++) {
qDebug() << "Src: "
dbgKrita << "Src: "
<< srcPixels[i*4] << "\t"
<< srcPixels[i*4+1] << "\t"
<< srcPixels[i*4+2] << "\t"
<< srcPixels[i*4+3] << "\t"
<< "Msk:" << mask[i];
qDebug() << "Dst: "
dbgKrita << "Dst: "
<< dstPixels[i*4] << "\t"
<< dstPixels[i*4+1] << "\t"
<< dstPixels[i*4+2] << "\t"
......@@ -284,19 +286,19 @@ bool compareTwoOpsPixels(QVector<Tile> &tiles, channel_type prec) {
for (int i = 0; i < numPixels; i++) {
if (!comparePixels<channel_type>(dst1, dst2, prec)) {
qDebug() << "Wrong result:" << i;
qDebug() << "Act: " << dst1[0] << dst1[1] << dst1[2] << dst1[3];
qDebug() << "Exp: " << dst2[0] << dst2[1] << dst2[2] << dst2[3];
qDebug() << "Dif: " << dst1[0] - dst2[0] << dst1[1] - dst2[1] << dst1[2] - dst2[2] << dst1[3] - dst2[3];
dbgKrita << "Wrong result:" << i;
dbgKrita << "Act: " << dst1[0] << dst1[1] << dst1[2] << dst1[3];
dbgKrita << "Exp: " << dst2[0] << dst2[1] << dst2[2] << dst2[3];
dbgKrita << "Dif: " << dst1[0] - dst2[0] << dst1[1] - dst2[1] << dst1[2] - dst2[2] << dst1[3] - dst2[3];
channel_type *s1 = src1 + 4 * i;
channel_type *s2 = src2 + 4 * i;
qDebug() << "SrcA:" << s1[0] << s1[1] << s1[2] << s1[3];
qDebug() << "SrcE:" << s2[0] << s2[1] << s2[2] << s2[3];
dbgKrita << "SrcA:" << s1[0] << s1[1] << s1[2] << s1[3];
dbgKrita << "SrcE:" << s2[0] << s2[1] << s2[2] << s2[3];
qDebug() << "MskA:" << tiles[0].mask[i];
qDebug() << "MskE:" << tiles[1].mask[i];
dbgKrita << "MskA:" << tiles[0].mask[i];
dbgKrita << "MskE:" << tiles[1].mask[i];
return false;
}
......@@ -415,14 +417,14 @@ void benchmarkCompositeOp(const KoCompositeOp *op,
op->composite(params);
}
qDebug() << testName << "RESULT:" << timer.elapsed() << "msec";
dbgKrita << testName << "RESULT:" << timer.elapsed() << "msec";
freeTiles(tiles, srcAlignmentShift, dstAlignmentShift);
}
void benchmarkCompositeOp(const KoCompositeOp *op, const QString &postfix)
{
qDebug() << "Testing Composite Op:" << op->id() << "(" << postfix << ")";
dbgKrita << "Testing Composite Op:" << op->id() << "(" << postfix << ")";
benchmarkCompositeOp(op, true, 0.5, 0.3, 0, 0, ALPHA_RANDOM, ALPHA_RANDOM);
benchmarkCompositeOp(op, true, 0.5, 0.3, 8, 0, ALPHA_RANDOM, ALPHA_RANDOM);
......@@ -487,9 +489,9 @@ void checkRounding(qreal opacity, qreal flow, qreal averageOpacity = -1, quint32
for (int j = 0; j < vecSize; j++) {
//if (8 * i + j == 7080) {
// qDebug() << "src: " << src2[0] << src2[1] << src2[2] << src2[3];
// qDebug() << "dst: " << dst2[0] << dst2[1] << dst2[2] << dst2[3];
// qDebug() << "msk:" << msk2[0];
// dbgKrita << "src: " << src2[0] << src2[1] << src2[2] << src2[3];
// dbgKrita << "dst: " << dst2[0] << dst2[1] << dst2[2] << dst2[3];
// dbgKrita << "msk:" << msk2[0];
//}
Compositor::template compositeOnePixelScalar<true, VC_IMPL>(src2, dst2, msk2, params.opacity, optionalParams);
......@@ -513,12 +515,12 @@ void checkRounding(qreal opacity, qreal flow, qreal averageOpacity = -1, quint32
}
if(!compareResult || errorcount > 1) {
qDebug() << "Wrong rounding in pixel:" << 8 * i + j;
qDebug() << "Vector version: " << dst1[0] << dst1[1] << dst1[2] << dst1[3];
qDebug() << "Scalar version: " << dst2[0] << dst2[1] << dst2[2] << dst2[3];
dbgKrita << "Wrong rounding in pixel:" << 8 * i + j;
dbgKrita << "Vector version: " << dst1[0] << dst1[1] << dst1[2] << dst1[3];
dbgKrita << "Scalar version: " << dst2[0] << dst2[1] << dst2[2] << dst2[3];
qDebug() << "src:" << src1[0] << src1[1] << src1[2] << src1[3];
qDebug() << "msk:" << msk1[0];
dbgKrita << "src:" << src1[0] << src1[1] << src1[2] << src1[3];
dbgKrita << "msk:" << msk1[0];
QFAIL("Wrong rounding");
}
......
......@@ -80,7 +80,7 @@ void KisFilterSelectionsBenchmark::initSelection()
//67.2% deselected
qDebug() << "Deselected: 67.2%";
dbgKrita << "Deselected: 67.2%";
pixelSelection->dataManager()->clear(75, 75, 500, 320, 255);
pixelSelection->dataManager()->clear(100, 100, 50, 50, quint8(0));
pixelSelection->dataManager()->clear(150, 150, 50, 50, quint8(0));
......@@ -94,7 +94,7 @@ void KisFilterSelectionsBenchmark::initSelection()
pixelSelection->dataManager()->clear(205, 105, 50, 50, quint8(128));
// 94.9% deselected
// qDebug() << "Deselected: 94.9%";
// dbgKrita << "Deselected: 94.9%";
// pixelSelection->dataManager()->clear(75,75,500,320,255);
// pixelSelection->dataManager()->clear(80,80,490,310,quint8(0));
......@@ -109,7 +109,7 @@ void KisFilterSelectionsBenchmark::initFilter(const QString &name)
Q_ASSERT(m_filter);
m_configuration = m_filter->defaultConfiguration(0);
qDebug() << "Filter initialized:" << name;
dbgKrita << "Filter initialized:" << name;
}
void KisFilterSelectionsBenchmark::testFilter(const QString &name)
......@@ -172,7 +172,7 @@ void KisFilterSelectionsBenchmark::testUsualSelections(int num)
projection->convertToQImage(0).save("TFS__USUAL_SELECTIONS.png");
if (num > WARMUP_CYCLES || SHOW_WARMUPS)
qDebug() << "Selections inside filter:\t\t" << avTime;
dbgKrita << "Selections inside filter:\t\t" << avTime;
}
void KisFilterSelectionsBenchmark::testNoSelections(int num)
......@@ -195,7 +195,7 @@ void KisFilterSelectionsBenchmark::testNoSelections(int num)
projection->convertToQImage(0).save("TFS__NO_SELECTIONS.png");
if (num > WARMUP_CYCLES || SHOW_WARMUPS)
qDebug() << "No Selections:\t\t\t\t" << avTime;
dbgKrita << "No Selections:\t\t\t\t" << avTime;
}
void KisFilterSelectionsBenchmark::testGoodSelections(int num)
......@@ -221,10 +221,10 @@ void KisFilterSelectionsBenchmark::testGoodSelections(int num)
projection->convertToQImage(0).save("TFS__GOOD_SELECTIONS.png");
if (num > WARMUP_CYCLES || SHOW_WARMUPS)
qDebug() << "Selections with alpha (filter):\t" << avTime;
dbgKrita << "Selections with alpha (filter):\t" << avTime;
#else /* if (USE_GOOD_SELECTIONS!=1) */
if (num > WARMUP_CYCLES || SHOW_WARMUPS)
qDebug() << "Selections with alpha (filter):\t [Disabled]";
dbgKrita << "Selections with alpha (filter):\t [Disabled]";
#endif
}
......@@ -256,7 +256,7 @@ void KisFilterSelectionsBenchmark::testBitBltWOSelections(int num)
projection->convertToQImage(0).save("TFS__BITBLT_WO_SELECTIONS.png");
if (num > WARMUP_CYCLES || SHOW_WARMUPS)
qDebug() << "bitBlt w/o sel:\t\t\t" << avTime;
dbgKrita << "bitBlt w/o sel:\t\t\t" << avTime;
}
void KisFilterSelectionsBenchmark::testBitBltSelections(int num)
......@@ -288,7 +288,7 @@ void KisFilterSelectionsBenchmark::testBitBltSelections(int num)
projection->convertToQImage(0).save("TFS__BITBLT_WITH_SELECTIONS.png");
if (num > WARMUP_CYCLES || SHOW_WARMUPS)
qDebug() << "bitBlt with sel:\t\t\t" << avTime;
dbgKrita << "bitBlt with sel:\t\t\t" << avTime;
}
QTEST_KDEMAIN(KisFilterSelectionsBenchmark, GUI)
......@@ -40,8 +40,8 @@
#include "kis_surrogate_undo_adapter.h"
#include "kis_image_config.h"
#define LOAD_PRESET_OR_RETURN(preset, fileName) \
if(!preset->load()) { qDebug() << "Preset" << fileName << "was NOT loaded properly. Done."; return; } \
else qDebug() << "Loaded preset:" << fileName
if(!preset->load()) { dbgKrita << "Preset" << fileName << "was NOT loaded properly. Done."; return; } \
else dbgKrita << "Loaded preset:" << fileName
#define HUGE_IMAGE_SIZE 8000
......
......@@ -28,7 +28,7 @@ inline double drand48()
#include <qtest_kde.h>
#include <QImage>
#include <QDebug>
#include <kis_debug.h>
#include "kis_painter_benchmark.h"
#include "kis_benchmark_values.h"
......
......@@ -193,7 +193,7 @@ void KisRandomIteratorBenchmark::benchmarkTileByTileWrite()
int yUnprocessed = int(TEST_IMAGE_HEIGHT) % int(TEST_AREA_HEIGHT);
if ((xUnprocessed) != 0 || (yUnprocessed) != 0)
{
kWarning() << "There will be some unprocessed pixels! Test area differs from the image size";
dbgKrita << "There will be some unprocessed pixels! Test area differs from the image size";
}
KisRandomAccessorSP it = m_device->createRandomAccessorNG(0,0);
......
......@@ -384,11 +384,11 @@ inline void KisStrokeBenchmark::benchmarkLine(QString presetFileName)
void KisStrokeBenchmark::benchmarkCircle(QString presetFileName)
{
qDebug() << "(circle)preset : " << presetFileName;
dbgKrita << "(circle)preset : " << presetFileName;
KisPaintOpPresetSP preset = new KisPaintOpPreset(m_dataPath + presetFileName);
if (!preset->load()){
qDebug() << "Preset was not loaded";
dbgKrita << "Preset was not loaded";
return;
}
......@@ -440,10 +440,10 @@ void KisStrokeBenchmark::benchmarkRandomLines(QString presetFileName)
KisPaintOpPresetSP preset = new KisPaintOpPreset(m_dataPath + presetFileName);
bool loadedOk = preset->load();
if (!loadedOk){
qDebug() << "The preset was not loaded correctly. Done.";
dbgKrita << "The preset was not loaded correctly. Done.";
return;
}else{
qDebug() << "preset : " << presetFileName;
dbgKrita << "preset : " << presetFileName;
}
m_painter->setPaintOpPreset(preset, m_layer, m_image);
......@@ -467,10 +467,10 @@ void KisStrokeBenchmark::benchmarkStroke(QString presetFileName)
KisPaintOpPresetSP preset = new KisPaintOpPreset(m_dataPath + presetFileName);
bool loadedOk = preset->load();
if (!loadedOk){
qDebug() << "The preset was not loaded correctly. Done.";
dbgKrita << "The preset was not loaded correctly. Done.";
return;
} else {
qDebug() << "preset : " << presetFileName;
dbgKrita << "preset : " << presetFileName;
}
m_painter->setPaintOpPreset(preset, m_layer, m_image);
......@@ -482,7 +482,7 @@ void KisStrokeBenchmark::benchmarkStroke(QString presetFileName)
}
#ifdef SAVE_OUTPUT
qDebug() << "Saving output " << m_outputPath + presetFileName + ".png";
dbgKrita << "Saving output " << m_outputPath + presetFileName + ".png";
m_layer->paintDevice()->convertToQImage(0).save(m_outputPath + presetFileName + OUTPUT_FORMAT);
#endif
}
......
......@@ -24,7 +24,7 @@
#include <klocale.h>
#include <kglobal.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kis_debug.h>
#include <calligraversion.h>
#include <calligragitversion.h>
......
......@@ -127,7 +127,7 @@ void doRestart(MainWindow* mainWindow, bool resetConfig)
restartCommand = "sh -c \"" + qApp->applicationDirPath().replace(' ', "\\ ") + "/krita \"";
#endif
qDebug() << "restartCommand" << restartCommand;
dbgKrita << "restartCommand" << restartCommand;
QProcess restartProcess;
if (!restartProcess.startDetached(restartCommand)) {
QMessageBox::warning(mainWindow, i18nc("@title:window", "Krita"),
......@@ -321,7 +321,7 @@ void MainWindow::startUpload()
#endif
QFile f(QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/krita-opengl.txt");
qDebug() << KGlobal::dirs()->saveLocation("config") + "/krita-opengl.txt" << f.exists();
dbgKrita << KGlobal::dirs()->saveLocation("config") + "/krita-opengl.txt" << f.exists();
if (f.exists()) {
f.open(QFile::ReadOnly);
......@@ -338,7 +338,7 @@ void MainWindow::startUpload()
// add minidump file
QString dumpfile = m_d->dumpPath + "/" + m_d->id + ".dmp";
qDebug() << "dumpfile" << dumpfile;
dbgKrita << "dumpfile" << dumpfile;
body += "Content-Disposition: form-data; name=\"upload_file_minidump\"; filename=\""
+ QFileInfo(dumpfile).fileName().toLatin1() + "\"\r\n";
body += "Content-Type: application/octet-stream\r\n\r\n";
......@@ -372,9 +372,9 @@ void MainWindow::startUpload()
void MainWindow::uploadDone(QNetworkReply *reply)
{
qDebug() << "updloadDone";
dbgKrita << "updloadDone";
if (reply && reply->error() != QNetworkReply::NoError) {
qCritical() << "uploadDone: Error uploading crash report: " << reply->errorString();
errKrita << "uploadDone: Error uploading crash report: " << reply->errorString();
}
if (m_d->doRestart) {
doRestart(this, chkRemoveSettings->isChecked());
......@@ -385,18 +385,18 @@ void MainWindow::uploadDone(QNetworkReply *reply)
void MainWindow::uploadProgress(qint64 received, qint64 total)
{
qDebug() << "updloadProgress";
dbgKrita << "updloadProgress";
progressBar->setMaximum(total);
progressBar->setValue(received);
}
void MainWindow::uploadError(QNetworkReply::NetworkError error)
{
qDebug() << "updloadError" << error;
dbgKrita << "updloadError" << error;
// Fake success...
progressBar->setRange(0, 100);
progressBar->setValue(100);
qCritical() << "UploadError: Error uploading crash report: " << error;
errKrita << "UploadError: Error uploading crash report: " << error;
uploadDone(0);
}
......@@ -182,7 +182,7 @@ public:
if (sketchView->errors().count() > 0) {
foreach(const QDeclarativeError &error, sketchView->errors()) {
qDebug() << error.toString();
dbgKrita << error.toString();
}
}
......@@ -746,7 +746,7 @@ void MainWindow::Private::notifySlateModeChange()
{
q->switchToDesktop();
}
//qDebug() << "Slate mode is now" << slateMode;
//dbgKrita << "Slate mode is now" << slateMode;
}
#endif
}
......@@ -759,7 +759,7 @@ void MainWindow::Private::notifyDockingModeChange()
if (docked != bDocked)
{
docked = bDocked;
//qDebug() << "Docking mode is now" << docked;
//dbgKrita << "Docking mode is now" << docked;
}
#endif
}
......
......@@ -57,7 +57,6 @@ endif()
set(kritaimage_LIB_SRCS
${libkritatile_SRCS}
kis_debug.cpp
kis_distance_information.cpp
kis_painter.cc
kis_progress_updater.cpp
......@@ -357,7 +356,6 @@ install( FILES
kis_convolution_painter.h
kis_convolution_worker.h
kis_cubic_curve.h
kis_debug.h
kis_default_bounds.h
kis_distance_information.h
filter/kis_filter.h
......
......@@ -336,7 +336,7 @@ qreal KisPaintInformation::drawingAngle() const
if (d->drawingAngleOverride) return *d->drawingAngleOverride;
if (!d->currentDistanceInfo || !d->currentDistanceInfo->hasLastDabInformation()) {
qWarning() << "KisPaintInformation::drawingAngle()" << "Cannot access Distance Info last dab data";
warnKrita << "KisPaintInformation::drawingAngle()" << "Cannot access Distance Info last dab data";
return 0.0;
}
......@@ -352,7 +352,7 @@ QPointF KisPaintInformation::drawingDirectionVector() const
}
if (!d->currentDistanceInfo || !d->currentDistanceInfo->hasLastDabInformation()) {
qWarning() << "KisPaintInformation::drawingDirectionVector()" << "Cannot access Distance Info last dab data";
warnKrita << "KisPaintInformation::drawingDirectionVector()" << "Cannot access Distance Info last dab data";
return QPointF(1.0, 0.0);
}
......@@ -363,7 +363,7 @@ QPointF KisPaintInformation::drawingDirectionVector() const
qreal KisPaintInformation::drawingDistance() const
{
if (!d->currentDistanceInfo || !d->currentDistanceInfo->hasLastDabInformation()) {
qWarning() << "KisPaintInformation::drawingDistance()" << "Cannot access Distance Info last dab data";
warnKrita << "KisPaintInformation::drawingDistance()" << "Cannot access Distance Info last dab data";
return 1.0;
}
......
......@@ -19,7 +19,7 @@
#ifndef _KIS_PAINT_INFORMATION_
#define _KIS_PAINT_INFORMATION_
#include <QDebug>
#include <kis_debug.h>
#include <QTime>
#include "kis_global.h"
......
......@@ -23,7 +23,7 @@
#include "kis_config_widget.h"
#include "kis_image.h"
#include <kdebug.h>
#include <kis_debug.h>
/**
* Base class for widgets that are used to edit and display paintop settings.
......
......@@ -148,7 +148,7 @@ bool KisPaintOpPreset::load()
QByteArray ba;
if (filename().startsWith("bundle://")) {
qDebug() << "bundle";
dbgKrita << "bundle";
QString bn = filename().mid(9);
int pos = bn.lastIndexOf(":");
QString fn = bn.right(bn.size() - pos - 1);
......@@ -156,14 +156,14 @@ bool KisPaintOpPreset::load()
QScopedPointer<KoStore> resourceStore(KoStore::createStore(bn, KoStore::Read, "application/x-krita-resourcebundle", KoStore::Zip));
if (!resourceStore || resourceStore->bad()) {
qWarning() << "Could not open store on bundle" << bn;
warnKrita << "Could not open store on bundle" << bn;
return false;
}
if (resourceStore->isOpen()) resourceStore->close();
if (!resourceStore->open(fn)) {
qWarning() << "Could not open preset" << fn << "in bundle" << bn;
warnKrita << "Could not open preset" << fn << "in bundle" << bn;
return false;
}
......@@ -298,7 +298,7 @@ void KisPaintOpPreset::fromXML(const QDomElement& presetElt)
KisPaintOpSettingsSP settings = KisPaintOpRegistry::instance()->settings(id);
if (!settings) {
setValid(false);
qWarning() << "Could not load settings for preset" << paintopid;
warnKrita << "Could not load settings for preset" << paintopid;
return;
}
......
......@@ -99,7 +99,7 @@ KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSet
return op;
}
}
qWarning() << "Could not create paintop for factory" << id << "with settings" << settings;
warnKrita << "Could not create paintop for factory" << id << "with settings" << settings;
return 0;
}
......
......@@ -62,7 +62,7 @@ public:
int row;
};
#include <QDebug>
#include <kis_debug.h>
inline QDebug operator<<(QDebug dbg, const KisFillInterval& i)
{
#ifndef NODEBUG
......
......@@ -58,15 +58,15 @@ void adjustIfOnPolygonBoundary(const QPolygonF &poly, int polygonDirection, QPoi
#ifdef SANITY_CHECKS
if (kisDistanceToLine(adjustedPoint, QLineF(p0, p1)) < 1e-4) {
qDebug() << ppVar(*pt);
qDebug() << ppVar(adjustedPoint);
qDebug() << ppVar(QLineF(p0, p1));
qDebug() << ppVar(salt);
dbgKrita << ppVar(*pt);
dbgKrita << ppVar(adjustedPoint);
dbgKrita << ppVar(QLineF(p0, p1));
dbgKrita << ppVar(salt);
qDebug() << ppVar(poly.containsPoint(*pt, Qt::OddEvenFill));
dbgKrita << ppVar(poly.containsPoint(*pt, Qt::OddEvenFill));
qDebug() << ppVar(kisDistanceToLine(*pt, QLineF(p0, p1)));
qDebug() << ppVar(kisDistanceToLine(adjustedPoint, QLineF(p0, p1)));
dbgKrita << ppVar(kisDistanceToLine(*pt, QLineF(p0, p1)));
dbgKrita << ppVar(kisDistanceToLine(adjustedPoint, QLineF(p0, p1)));
}
*pt = adjustedPoint;
......
......@@ -19,7 +19,7 @@
#include "kis_async_merger.h"
#include <QDebug>
#include <kis_debug.h>
#include <QBitArray>
#include <KoChannelInfo.h>
......@@ -53,7 +53,7 @@
#ifdef DEBUG_MERGER
#define DEBUG_NODE_ACTION(message, type, leaf, rect) \
qDebug() << message << type << ":" << leaf->node()->name() << rect
dbgKrita << message << type << ":" << leaf->node()->name() << rect
#else
#define DEBUG_NODE_ACTION(message, type, leaf, rect)
#endif
......
......@@ -403,7 +403,7 @@ protected:
tempRect.getRect(&x, &y, &w, &h);
checksum += -x - y + w + h;
// qCritical() << leaf << requestedRect << "-->" << checksum;
// errKrita << leaf << requestedRect << "-->" << checksum;