Development/Tutorials/Collaboration/Attica/Tips: Difference between revisions

From KDE TechBase
m (Text replace - "</code>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
Simply add the qDebug() to the dataFinished function:
Simply add the qDebug() to the dataFinished function:


<code>
<syntaxhighlight lang="text">
void BaseJob::dataFinished()
void BaseJob::dataFinished()
{
{
Line 11: Line 11:
         qDebug() << data; // ADD THIS LINE
         qDebug() << data; // ADD THIS LINE
         ...
         ...
</code>
</syntaxhighlight>


and you will see lots of XML in your debug shell.
and you will see lots of XML in your debug shell.

Latest revision as of 20:50, 29 June 2011

Debugging Attica

In attica/lib/atticabasejob.cpp you can enable the debug output of all XML the server sends. Simply add the qDebug() to the dataFinished function:

void BaseJob::dataFinished()
{
    if (d->m_reply->error() == QNetworkReply::NoError) {
        QByteArray data = d->m_reply->readAll();
        qDebug() << data; // ADD THIS LINE
        ...

and you will see lots of XML in your debug shell.