Commit 2dc59c06 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Comment out some qDebug calls

Given that attica is a library, we don't want to flood the user's
stdout/stderr with library debug data.

Comment out the qDebug's, I pondered some of them might be useful in
runtime to display the state is not correct. In those cases I changed
to qWarning.

REVIEW: 105358
parent 6395eff5
......@@ -87,7 +87,7 @@ void BaseJob::dataFinished()
// handle redirections automatically
QUrl newUrl;
if (d->redirection(newUrl)) {
qDebug() << "BaseJob::dataFinished" << newUrl;
//qDebug() << "BaseJob::dataFinished" << newUrl;
QNetworkRequest request = d->m_reply->request();
QNetworkAccessManager::Operation operation = d->m_reply->operation();
if (newUrl.isValid() && operation == QNetworkAccessManager::GetOperation) {
......
......@@ -77,7 +77,7 @@ QString PostFileData::randomString(int length)
void PostFileData::addArgument(const QString& key, const QString& value)
{
if (d->finished) {
qDebug() << "PostFileData::addFile: should not add data after calling request() or data()";
qWarning() << "PostFileData::addFile: should not add data after calling request() or data()";
}
QByteArray data(
"--" + d->boundary + "\r\n"
......@@ -101,7 +101,7 @@ void PostFileData::addFile(const QString& fileName, QIODevice* file, const QStri
void PostFileData::addFile(const QString& fileName, const QByteArray& file, const QString& mimeType, const QString& fieldName)
{
if (d->finished) {
qDebug() << "PostFileData::addFile: should not add data after calling request() or data()";
qWarning() << "PostFileData::addFile: should not add data after calling request() or data()";
}
QByteArray data(
......
......@@ -71,7 +71,7 @@ QNetworkReply* PostJob::executeRequest()
void PostJob::parse(const QString& xmlString)
{
qDebug() << "PostJob::parse" << xmlString;
//qDebug() << "PostJob::parse" << xmlString;
QXmlStreamReader xml( xmlString );
Metadata data;
while (!xml.atEnd()) {
......
......@@ -520,7 +520,7 @@ ListJob<Activity>* Provider::requestActivities()
return 0;
}
qDebug() << "request activity";
//qDebug() << "request activity";
QUrl url = createUrl( QLatin1String( "activity" ) );
return doRequestActivityList( url );
}
......@@ -532,7 +532,7 @@ ListJob<Project>* Provider::requestProjects()
return 0;
}
qDebug() << "request projects";
//qDebug() << "request projects";
QUrl url = createUrl( QLatin1String("buildservice/project/list") );
return new ListJob<Project>(d->m_internals, createRequest(url));
}
......@@ -544,7 +544,7 @@ ItemJob<Project>* Provider::requestProject(const QString& id)
}
QUrl url = createUrl( QLatin1String("buildservice/project/get/") + id );
qDebug() << url;
//qDebug() << url;
return new ItemJob<Project>(d->m_internals, createRequest(url));
}
......@@ -676,7 +676,7 @@ ItemJob<BuildServiceJobOutput>* Provider::requestBuildServiceJobOutput(const QSt
}
QUrl url = createUrl( QLatin1String("buildservice/jobs/getoutput/") + id );
qDebug() << url;
//qDebug() << url;
return new ItemJob<BuildServiceJobOutput>(d->m_internals, createRequest(url));
}
......@@ -687,7 +687,7 @@ ItemJob<BuildServiceJob>* Provider::requestBuildServiceJob(const QString &id)
}
QUrl url = createUrl( QLatin1String("buildservice/jobs/get/") + id );
qDebug() << url;
//qDebug() << url;
return new ItemJob<BuildServiceJob>(d->m_internals, createRequest(url));
}
......@@ -719,7 +719,7 @@ PostJob* Provider::cancelBuildServiceJob(const BuildServiceJob& job)
StringMap postParameters;
postParameters.insert(QLatin1String("dummyparameter"), QLatin1String("dummyvalue"));
qDebug() << "b....................b";
//qDebug() << "b....................b";
return new PostJob(d->m_internals, createRequest(
QLatin1String("buildservice/jobs/cancel/") + job.id()), postParameters);
}
......@@ -735,7 +735,7 @@ PostJob* Provider::createBuildServiceJob(const BuildServiceJob& job)
// 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();
//qDebug() << "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()),
......@@ -748,7 +748,7 @@ ListJob<BuildService>* Provider::requestBuildServices()
return 0;
}
qDebug() << "request projects";
//qDebug() << "request projects";
QUrl url = createUrl( QLatin1String("buildservice/buildservices/list") );
return new ListJob<BuildService>(d->m_internals, createRequest(url));
}
......@@ -801,7 +801,7 @@ PostJob* Provider::createRemoteAccount(const RemoteAccount& account)
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();
//qDebug() << "Creating new Remoteaccount" << account.id() << account.login() << account.password();
return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/add")),
postParameters);
}
......@@ -821,7 +821,7 @@ PostJob* Provider::editRemoteAccount(const RemoteAccount& account)
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();
//qDebug() << "Creating new Remoteaccount" << account.id() << account.login() << account.password();
return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/edit/") + account.id()),
postParameters);
}
......@@ -833,7 +833,7 @@ ItemJob<RemoteAccount>* Provider::requestRemoteAccount(const QString &id)
}
QUrl url = createUrl( QLatin1String("buildservice/remoteaccounts/get/") + id );
qDebug() << url;
//qDebug() << url;
return new ItemJob<RemoteAccount>(d->m_internals, createRequest(url));
}
......@@ -856,7 +856,7 @@ PostJob* Provider::uploadTarballToBuildService(const QString& projectId, const Q
}
QUrl url = createUrl(QLatin1String( "buildservice/project/uploadsource/" ) + projectId);
qDebug() << "Up'ing tarball" << url << projectId << fileName << payload;
//qDebug() << "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());
......@@ -1120,7 +1120,7 @@ ItemPostJob<Content>* Provider::addNewContent(const Category& category, const Co
pars.insert(QLatin1String( "type" ), category.id());
pars.insert(QLatin1String( "name" ), cont.name());
qDebug() << "Parameter map: " << pars;
//qDebug() << "Parameter map: " << pars;
return new ItemPostJob<Content>(d->m_internals, createRequest(url), pars);
}
......@@ -1139,7 +1139,7 @@ ItemPostJob<Content>* Provider::editContent(const Category& updatedCategory, con
pars.insert(QLatin1String( "type" ), updatedCategory.id());
pars.insert(QLatin1String( "name" ), updatedContent.name());
qDebug() << "Parameter map: " << pars;
//qDebug() << "Parameter map: " << pars;
return new ItemPostJob<Content>(d->m_internals, createRequest(url), pars);
}
......@@ -1232,7 +1232,7 @@ PostJob* Provider::voteForContent(const QString& contentId, bool positiveVote)
StringMap postParameters;
postParameters.insert(QLatin1String( "vote" ), positiveVote ? QLatin1String( "good" ) : QLatin1String( "bad" ));
qDebug() << "vote: " << positiveVote;
//qDebug() << "vote: " << positiveVote;
return new PostJob(d->m_internals, createRequest(QLatin1String( "content/vote/" ) + contentId), postParameters);
}
......@@ -1250,7 +1250,7 @@ PostJob* Provider::voteForContent(const QString& contentId, uint rating)
StringMap postParameters;
postParameters.insert(QLatin1String( "vote" ), QString::number(rating));
qDebug() << "vote: " << QString::number(rating);
//qDebug() << "vote: " << QString::number(rating);
return new PostJob(d->m_internals, createRequest(QLatin1String( "content/vote/" ) + contentId), postParameters);
}
......@@ -1542,7 +1542,7 @@ QUrl Provider::createUrl(const QString& path)
QNetworkRequest Provider::createRequest(const QUrl& url)
{
QNetworkRequest request(url);
qDebug() << "OCS Request:" << url;
//qDebug() << "OCS Request:" << url;
if (!d->m_credentialsUserName.isEmpty()) {
QString concatenated = d->m_credentialsUserName + QLatin1Char( ':' ) + d->m_credentialsPassword;
QByteArray data = concatenated.toLocal8Bit().toBase64();
......
......@@ -87,7 +87,7 @@ PlatformDependent* ProviderManager::loadPlatformDependent(const ProviderFlags& f
if (flags & ProviderManager::DisablePlugins)
{
qDebug() << "Disabling provider plugins per application request";
//qDebug() << "Disabling provider plugins per application request";
return new QtPlatformDependent;
}
......@@ -106,26 +106,26 @@ PlatformDependent* ProviderManager::loadPlatformDependent(const ProviderFlags& f
/* Try to find the KDE plugin. This can be extended to include other platform specific plugins. */
paths.append(QString(QLatin1String( process.readAllStandardOutput() )).trimmed().split(QLatin1Char( PATH_SEPARATOR )));
qDebug() << "Plugin paths: " << paths;
//qDebug() << "Plugin paths: " << paths;
QString pluginName(QLatin1String( "attica_kde" ));
foreach(const QString& path, paths) {
QString libraryPath(path + QLatin1Char( '/' ) + pluginName + QLatin1Char( '.' ) + QLatin1String( LIB_EXTENSION ));
qDebug() << "Trying to load Attica plugin: " << libraryPath;
//qDebug() << "Trying to load Attica plugin: " << libraryPath;
if (QFile::exists(libraryPath)) {
d->m_pluginLoader.setFileName(libraryPath);
QObject* plugin = d->m_pluginLoader.instance();
if (plugin) {
PlatformDependent* platformDependent = qobject_cast<PlatformDependent*>(plugin);
if (platformDependent) {
qDebug() << "Using Attica with KDE support";
//qDebug() << "Using Attica with KDE support";
return platformDependent;
}
}
}
}
qDebug() << "Using Attica without KDE support";
//qDebug() << "Using Attica without KDE support";
return new QtPlatformDependent;
}
......@@ -274,7 +274,7 @@ void ProviderManager::parseProviderFile(const QString& xmlString, const QString&
}
}
if (!baseUrl.isEmpty()) {
qDebug() << "Adding provider" << baseUrl;
//qDebug() << "Adding provider" << baseUrl;
d->m_providers.insert(baseUrl, Provider(d->m_internals, QUrl(baseUrl), name, icon,
person, friendV, message, achievement, activity, content, fan, forum, knowledgebase, event, comment));
emit providerAdded(d->m_providers.value(baseUrl));
......@@ -317,14 +317,14 @@ void ProviderManager::authenticate(QNetworkReply* reply, QAuthenticator* auth)
}
}
qDebug() << "ProviderManager::authenticate" << baseUrl;
//qDebug() << "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";
//qDebug() << "ProviderManager::authenticate: loading authentication";
auth->setUser(user);
auth->setPassword(password);
return;
......@@ -333,13 +333,13 @@ void ProviderManager::authenticate(QNetworkReply* reply, QAuthenticator* auth)
}
if (!d->m_authenticationSuppressed && d->m_internals->askForCredentials(baseUrl, user, password)) {
qDebug() << "ProviderManager::authenticate: asking internals for new credentials";
//qDebug() << "ProviderManager::authenticate: asking internals for new credentials";
//auth->setUser(user);
//auth->setPassword(password);
return;
}
qDebug() << "ProviderManager::authenticate: No authentication credentials provided, aborting." << reply->url().toString();
qWarning() << "ProviderManager::authenticate: No authentication credentials provided, aborting." << reply->url().toString();
emit authenticationCredentialsMissing(d->m_providers.value(baseUrl));
reply->abort();
}
......
......@@ -75,7 +75,7 @@ QNetworkReply* PutJob::executeRequest()
void PutJob::parse(const QString& xmlString)
{
qDebug() << "PutJob::parse" << xmlString;
//qDebug() << "PutJob::parse" << xmlString;
QXmlStreamReader xml( xmlString );
Metadata data;
while (!xml.atEnd()) {
......
......@@ -98,7 +98,7 @@ QList<QUrl> Attica::QtPlatformDependent::getDefaultProviderFiles() const
void QtPlatformDependent::addDefaultProviderFile(const QUrl&)
{
qDebug() << "attica-qt does not support default providers yet";
qWarning() << "attica-qt does not support default providers yet";
}
void QtPlatformDependent::removeDefaultProviderFile(const QUrl&)
......@@ -107,7 +107,7 @@ void QtPlatformDependent::removeDefaultProviderFile(const QUrl&)
void QtPlatformDependent::enableProvider(const QUrl& baseUrl, bool enabled) const
{
qDebug() << "attica-qt does not support disabling of providers yet";
qWarning() << "attica-qt does not support disabling of providers yet";
}
bool QtPlatformDependent::isEnabled(const QUrl& baseUrl) const
......
Supports Markdown
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