diff --git a/src/atticabasejob.cpp b/src/atticabasejob.cpp --- a/src/atticabasejob.cpp +++ b/src/atticabasejob.cpp @@ -95,7 +95,7 @@ // handle redirections automatically QUrl newUrl; if (d->redirection(newUrl)) { - //qDebug() << "BaseJob::dataFinished" << newUrl; + //qCDebug(ATTICA) << "BaseJob::dataFinished" << newUrl; QNetworkRequest request = d->m_reply->request(); QNetworkAccessManager::Operation operation = d->m_reply->operation(); if (newUrl.isValid() && operation == QNetworkAccessManager::GetOperation) { @@ -112,7 +112,7 @@ if (!error) { QByteArray data = d->m_reply->readAll(); - //qDebug() << "XML Returned:\n" << data; + //qCDebug(ATTICA) << "XML Returned:\n" << data; parse(QString::fromUtf8(data.constData())); if (d->m_metadata.statusCode() == 100) { d->m_metadata.setError(Metadata::NoError); diff --git a/src/buildservicejobparser.cpp b/src/buildservicejobparser.cpp --- a/src/buildservicejobparser.cpp +++ b/src/buildservicejobparser.cpp @@ -33,7 +33,7 @@ // For specs about the XML provided, see here: // http://www.freedesktop.org/wiki/Specifications/open-collaboration-services-draft#BuildServiceJobs while (!xml.atEnd()) { - //qDebug() << "XML returned:" << xml.text().toString(); + //qCDebug(ATTICA) << "XML returned:" << xml.text().toString(); xml.readNext(); if (xml.isStartElement()) { diff --git a/src/parser.cpp b/src/parser.cpp --- a/src/parser.cpp +++ b/src/parser.cpp @@ -108,7 +108,7 @@ \ "); - qDebug() << "parsing list:" << xmlString; + qCDebug(ATTICA) << "parsing list:" << xmlString; */ QStringList elements = xmlElement(); typename T::List items; @@ -118,7 +118,7 @@ while (!xml.atEnd()) { xml.readNext(); - //qDebug() << "parseList():: Looking for:" << xml.name().toString(); + //qCDebug(ATTICA) << "parseList():: Looking for:" << xml.name().toString(); if (xml.isStartElement()) { if (xml.name() == QLatin1String("data")) { while (!xml.atEnd()) { @@ -129,7 +129,7 @@ } if (xml.isStartElement() && elements.contains(xml.name().toString())) { - //qDebug() << "xxxxxxxxx New Item!" << xml.name().toString(); + //qCDebug(ATTICA) << "xxxxxxxxx New Item!" << xml.name().toString(); items.append(parseXml(xml)); } } diff --git a/src/postfiledata.cpp b/src/postfiledata.cpp --- a/src/postfiledata.cpp +++ b/src/postfiledata.cpp @@ -97,7 +97,7 @@ void PostFileData::addFile(const QString& fileName, QIODevice* file, const QString& mimeType) { if (d->finished) { - qDebug() << "PostFileData::addFile: should not add data after calling request() or data()"; + qCDebug(ATTICA) << "PostFileData::addFile: should not add data after calling request() or data()"; } QByteArray data = file->readAll(); addFile(fileName, data, mimeType); diff --git a/src/postjob.cpp b/src/postjob.cpp --- a/src/postjob.cpp +++ b/src/postjob.cpp @@ -68,7 +68,7 @@ void PostJob::parse(const QString &xmlString) { - //qDebug() << "PostJob::parse" << xmlString; + //qCDebug(ATTICA) << "PostJob::parse" << xmlString; QXmlStreamReader xml(xmlString); Metadata data; while (!xml.atEnd()) { diff --git a/src/projectparser.cpp b/src/projectparser.cpp --- a/src/projectparser.cpp +++ b/src/projectparser.cpp @@ -33,7 +33,7 @@ // For specs about the XML provided, see here: // http://www.freedesktop.org/wiki/Specifications/open-collaboration-services-draft#Projects while (!xml.atEnd()) { - //qDebug() << "XML returned:" << xml.text().toString(); + //qCDebug(ATTICA) << "XML returned:" << xml.text().toString(); xml.readNext(); if (xml.isStartElement()) { diff --git a/src/provider.cpp b/src/provider.cpp --- a/src/provider.cpp +++ b/src/provider.cpp @@ -571,7 +571,7 @@ return nullptr; } - //qDebug() << "request activity"; + //qCDebug(ATTICA) << "request activity"; QUrl url = createUrl(QLatin1String("activity")); return doRequestActivityList(url); } @@ -582,7 +582,7 @@ return nullptr; } - //qDebug() << "request projects"; + //qCDebug(ATTICA) << "request projects"; QUrl url = createUrl(QLatin1String("buildservice/project/list")); return new ListJob(d->m_internals, createRequest(url)); } @@ -594,7 +594,7 @@ } QUrl url = createUrl(QLatin1String("buildservice/project/get/") + id); - //qDebug() << url; + //qCDebug(ATTICA) << url; return new ItemJob(d->m_internals, createRequest(url)); } @@ -682,7 +682,7 @@ return nullptr; } - //qDebug() << "request publisher" << id; + //qCDebug(ATTICA) << "request publisher" << id; QUrl url = createUrl(QLatin1String("buildservice/publishing/getpublisher/") + id); return new ItemJob(d->m_internals, createRequest(url)); } @@ -699,7 +699,7 @@ postParameters.insert(QLatin1String("fields[0][data]"), field.data()); QString url = QLatin1String("buildservice/publishing/savefields/") + project.id(); - //qDebug() << "saving field values..."; + //qCDebug(ATTICA) << "saving field values..."; return new PostJob(d->m_internals, createRequest(url), postParameters); } @@ -714,7 +714,7 @@ QString url = QLatin1String("buildservice/publishing/publishtargetresult/") + buildjob.id() + QLatin1Char('/') + publisher.id(); - //qDebug() << "pub'ing"; + //qCDebug(ATTICA) << "pub'ing"; return new PostJob(d->m_internals, createRequest(url), postParameters); } @@ -726,7 +726,7 @@ } QUrl url = createUrl(QLatin1String("buildservice/jobs/getoutput/") + id); - //qDebug() << url; + //qCDebug(ATTICA) << url; return new ItemJob(d->m_internals, createRequest(url)); } @@ -737,7 +737,7 @@ } QUrl url = createUrl(QLatin1String("buildservice/jobs/get/") + id); - //qDebug() << url; + //qCDebug(ATTICA) << url; return new ItemJob(d->m_internals, createRequest(url)); } @@ -769,7 +769,7 @@ StringMap postParameters; postParameters.insert(QLatin1String("dummyparameter"), QLatin1String("dummyvalue")); - //qDebug() << "b....................b"; + //qCDebug(ATTICA) << "b....................b"; return new PostJob(d->m_internals, createRequest( QLatin1String("buildservice/jobs/cancel/") + job.id()), postParameters); } @@ -785,7 +785,7 @@ // so even while we don't need any in this case, // we add dummy data to the request postParameters.insert(QLatin1String("dummyparameter"), QLatin1String("dummyvalue")); - //qDebug() << "Creating new BSJ on" << job.buildServiceId(); + //qCDebug(ATTICA) << "Creating new BSJ on" << job.buildServiceId(); return new PostJob(d->m_internals, createRequest( QLatin1String("buildservice/jobs/create/") + job.projectId() + QLatin1Char('/') + job.buildServiceId() + QLatin1Char('/') + job.target()), @@ -798,7 +798,7 @@ return nullptr; } - //qDebug() << "request projects"; + //qCDebug(ATTICA) << "request projects"; QUrl url = createUrl(QLatin1String("buildservice/buildservices/list")); return new ListJob(d->m_internals, createRequest(url)); } @@ -810,7 +810,7 @@ } QUrl url = createUrl(QLatin1String("buildservice/publishing/getpublishingcapabilities")); - //qDebug() << "request publishers" << url; + //qCDebug(ATTICA) << "request publishers" << url; return new ListJob(d->m_internals, createRequest(url)); } @@ -820,7 +820,7 @@ return nullptr; } - //qDebug() << "request projects"; + //qCDebug(ATTICA) << "request projects"; QUrl url = createUrl(QLatin1String("buildservice/jobs/list/") + project.id()); return new ListJob(d->m_internals, createRequest(url)); } @@ -831,7 +831,7 @@ return nullptr; } - //qDebug() << "request remoteaccounts"; + //qCDebug(ATTICA) << "request remoteaccounts"; QUrl url = createUrl(QLatin1String("buildservice/remoteaccounts/list/")); return new ListJob(d->m_internals, createRequest(url)); } @@ -851,7 +851,7 @@ postParameters.insert(QLatin1String("type"), account.type()); postParameters.insert(QLatin1String("typeid"), account.remoteServiceId()); // FIXME: remoteserviceid? postParameters.insert(QLatin1String("data"), account.data()); - //qDebug() << "Creating new Remoteaccount" << account.id() << account.login() << account.password(); + //qCDebug(ATTICA) << "Creating new Remoteaccount" << account.id() << account.login() << account.password(); return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/add")), postParameters); } @@ -871,7 +871,7 @@ postParameters.insert(QLatin1String("type"), account.type()); postParameters.insert(QLatin1String("typeid"), account.remoteServiceId()); // FIXME: remoteserviceid? postParameters.insert(QLatin1String("data"), account.data()); - //qDebug() << "Creating new Remoteaccount" << account.id() << account.login() << account.password(); + //qCDebug(ATTICA) << "Creating new Remoteaccount" << account.id() << account.login() << account.password(); return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/edit/") + account.id()), postParameters); } @@ -883,7 +883,7 @@ } QUrl url = createUrl(QLatin1String("buildservice/remoteaccounts/get/") + id); - //qDebug() << url; + //qCDebug(ATTICA) << url; return new ItemJob(d->m_internals, createRequest(url)); } @@ -906,7 +906,7 @@ } QUrl url = createUrl(QLatin1String("buildservice/project/uploadsource/") + projectId); - //qDebug() << "Up'ing tarball" << url << projectId << fileName << payload; + //qCDebug(ATTICA) << "Up'ing tarball" << url << projectId << fileName << payload; PostFileData postRequest(url); postRequest.addFile(fileName, payload, QLatin1String("application/octet-stream"), QLatin1String("source")); return new PostJob(d->m_internals, postRequest.request(), postRequest.data()); @@ -1166,7 +1166,7 @@ pars.insert(QLatin1String("type"), category.id()); pars.insert(QLatin1String("name"), cont.name()); - //qDebug() << "Parameter map: " << pars; + //qCDebug(ATTICA) << "Parameter map: " << pars; return new ItemPostJob(d->m_internals, createRequest(url), pars); } @@ -1184,7 +1184,7 @@ pars.insert(QLatin1String("type"), updatedCategory.id()); pars.insert(QLatin1String("name"), updatedContent.name()); - //qDebug() << "Parameter map: " << pars; + //qCDebug(ATTICA) << "Parameter map: " << pars; return new ItemPostJob(d->m_internals, createRequest(url), pars); } @@ -1277,7 +1277,7 @@ StringMap postParameters; postParameters.insert(QLatin1String("vote"), positiveVote ? QLatin1String("good") : QLatin1String("bad")); - //qDebug() << "vote: " << positiveVote; + //qCDebug(ATTICA) << "vote: " << positiveVote; return new PostJob(d->m_internals, createRequest(QLatin1String("content/vote/") + contentId), postParameters); } @@ -1295,7 +1295,7 @@ StringMap postParameters; postParameters.insert(QLatin1String("vote"), QString::number(rating)); - //qDebug() << "vote: " << QString::number(rating); + //qCDebug(ATTICA) << "vote: " << QString::number(rating); return new PostJob(d->m_internals, createRequest(QLatin1String("content/vote/") + contentId), postParameters); } diff --git a/src/providermanager.cpp b/src/providermanager.cpp --- a/src/providermanager.cpp +++ b/src/providermanager.cpp @@ -24,6 +24,7 @@ #include "providermanager.h" +#include "attica_debug.h" #include "atticautils.h" #include @@ -147,7 +148,7 @@ QNetworkRequest req(url); req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); QNetworkReply *reply = d->m_internals->get(req); - qDebug() << "executing" << Utils::toString(reply->operation()) << "for" << reply->url(); + qCDebug(ATTICA) << "executing" << Utils::toString(reply->operation()) << "for" << reply->url(); connect(reply, SIGNAL(finished()), &d->m_downloadMapping, SLOT(map())); d->m_downloadMapping.setMapping(reply, url.toString()); d->m_downloads.insert(url.toString(), reply); @@ -226,7 +227,7 @@ } } if (!baseUrl.isEmpty()) { - //qDebug() << "Adding provider" << baseUrl; + //qCDebug(ATTICA) << "Adding provider" << baseUrl; d->m_providers.insert(baseUrl, Provider(d->m_internals, baseUrl, name, icon, person, friendV, message, achievement, activity, content, fan, forum, knowledgebase, event, comment, registerUrl)); @@ -237,7 +238,7 @@ } if (xml.error() != QXmlStreamReader::NoError) { - qDebug() << "error:" << xml.errorString() << "in" << url; + qCDebug(ATTICA) << "error:" << xml.errorString() << "in" << url; } if (d->m_downloads.isEmpty()) { @@ -281,23 +282,23 @@ } } - //qDebug() << "ProviderManager::authenticate" << baseUrl; + //qCDebug(ATTICA) << "ProviderManager::authenticate" << baseUrl; QString user; QString password; if (auth->user().isEmpty() && auth->password().isEmpty()) { if (d->m_internals->hasCredentials(baseUrl)) { if (d->m_internals->loadCredentials(baseUrl, user, password)) { - //qDebug() << "ProviderManager::authenticate: loading authentication"; + //qCDebug(ATTICA) << "ProviderManager::authenticate: loading authentication"; auth->setUser(user); auth->setPassword(password); return; } } } if (!d->m_authenticationSuppressed && d->m_internals->askForCredentials(baseUrl, user, password)) { - //qDebug() << "ProviderManager::authenticate: asking internals for new credentials"; + //qCDebug(ATTICA) << "ProviderManager::authenticate: asking internals for new credentials"; //auth->setUser(user); //auth->setPassword(password); return; diff --git a/src/publisherparser.cpp b/src/publisherparser.cpp --- a/src/publisherparser.cpp +++ b/src/publisherparser.cpp @@ -35,7 +35,7 @@ QStringList fields; while (!xml.atEnd()) { - //qDebug() << "XML returned:" << xml.text().toString(); + //qCDebug(ATTICA) << "XML returned:" << xml.text().toString(); xml.readNext(); if (xml.isStartElement()) { diff --git a/src/putjob.cpp b/src/putjob.cpp --- a/src/putjob.cpp +++ b/src/putjob.cpp @@ -73,7 +73,7 @@ void PutJob::parse(const QString &xmlString) { - //qDebug() << "PutJob::parse" << xmlString; + //qCDebug(ATTICA) << "PutJob::parse" << xmlString; QXmlStreamReader xml(xmlString); Metadata data; while (!xml.atEnd()) { diff --git a/src/remoteaccountparser.cpp b/src/remoteaccountparser.cpp --- a/src/remoteaccountparser.cpp +++ b/src/remoteaccountparser.cpp @@ -33,7 +33,7 @@ // For specs about the XML provided, see here: // http://www.freedesktop.org/wiki/Specifications/open-collaboration-services-draft#RemoteAccounts while (!xml.atEnd()) { - //qDebug() << "XML returned:" << xml.text().toString(); + //qCDebug(ATTICA) << "XML returned:" << xml.text().toString(); xml.readNext(); if (xml.isStartElement()) {