Commit e00a7abc authored by Laurent Montel's avatar Laurent Montel 😁

Minor

parent 020a7e79
......@@ -35,7 +35,7 @@ set(tomboynotesresource_SRCS
ecm_qt_declare_logging_category(tomboynotesresource_SRCS
HEADER debug.h
IDENTIFIER log_tomboynotesresource
IDENTIFIER TOMBOYNOTESRESOURCE_LOG
CATEGORY_NAME log_tomboynotesresource
)
......
......@@ -42,12 +42,12 @@ void TomboyCollectionsDownloadJob::start()
mReply = mRequestor->get(request, QList<O0RequestParameter>());
connect(mReply, &QNetworkReply::finished, this, &TomboyCollectionsDownloadJob::onRequestFinished);
qCDebug(log_tomboynotesresource) << "TomboyCollectionsDownloadJob: Start network request";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyCollectionsDownloadJob: Start network request";
}
void TomboyCollectionsDownloadJob::onRequestFinished()
{
qCDebug(log_tomboynotesresource) << "TomboyCollectionsDownloadJob: Network request finished";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyCollectionsDownloadJob: Network request finished";
checkReplyError();
if (error() != TomboyJobError::NoError) {
setErrorText(mReply->errorString());
......@@ -59,16 +59,16 @@ void TomboyCollectionsDownloadJob::onRequestFinished()
const QJsonDocument document = QJsonDocument::fromJson(mReply->readAll(), Q_NULLPTR);
const QJsonObject jo = document.object();
qCDebug(log_tomboynotesresource) << "TomboyCollectionsDownloadJob: " << jo;
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyCollectionsDownloadJob: " << jo;
const QJsonValue collectionRevision = jo[QLatin1String("latest-sync-revision")];
qCDebug(log_tomboynotesresource) << "TomboyCollectionsDownloadJob: " << collectionRevision;
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyCollectionsDownloadJob: " << collectionRevision;
Akonadi::Collection c;
c.setParentCollection(Akonadi::Collection::root());
c.setRemoteId(mContentURL);
c.setName(mCollectionName);
c.setRemoteRevision(QString::number(collectionRevision.toInt()));
qCDebug(log_tomboynotesresource) << "TomboyCollectionsDownloadJob: Sync revision " << collectionRevision.toString();
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyCollectionsDownloadJob: Sync revision " << collectionRevision.toString();
c.setContentMimeTypes({ Akonadi::NoteUtils::noteMimeType() });
......
......@@ -43,7 +43,7 @@ void TomboyItemDownloadJob::start()
mReply = mRequestor->get(request, QList<O0RequestParameter>());
connect(mReply, &QNetworkReply::finished, this, &TomboyItemDownloadJob::onRequestFinished);
qCDebug(log_tomboynotesresource) << "TomboyItemDownloadJob: Start network request";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemDownloadJob: Start network request";
}
void TomboyItemDownloadJob::onRequestFinished()
......@@ -54,17 +54,17 @@ void TomboyItemDownloadJob::onRequestFinished()
emitResult();
return;
}
qCDebug(log_tomboynotesresource) << "TomboyItemDownloadJob: Network request finished. No error occured";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemDownloadJob: Network request finished. No error occured";
// Parse received data as JSON
const QJsonDocument document = QJsonDocument::fromJson(mReply->readAll(), Q_NULLPTR);
const QJsonObject jsonNote = document.object();
qCDebug(log_tomboynotesresource) << "TomboyItemDownloadJob: JSON note: " << jsonNote;
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemDownloadJob: JSON note: " << jsonNote;
mResultItem.setRemoteRevision(QString::number(jsonNote[QLatin1String("last-sync-revision")].toInt()));
qCDebug(log_tomboynotesresource) << "TomboyItemDownloadJob: Sync revision " << mResultItem.remoteRevision();
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemDownloadJob: Sync revision " << mResultItem.remoteRevision();
// Set timestamp
const QString timeStampJson = jsonNote[QLatin1String("last-change-date")].toString();
......
......@@ -42,12 +42,12 @@ void TomboyItemsDownloadJob::start()
mReply = mRequestor->get(request, QList<O0RequestParameter>());
connect(mReply, &QNetworkReply::finished, this, &TomboyItemsDownloadJob::onRequestFinished);
qCDebug(log_tomboynotesresource) << "TomboyItemsDownloadJob: Start network request";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemsDownloadJob: Start network request";
}
void TomboyItemsDownloadJob::onRequestFinished()
{
qCDebug(log_tomboynotesresource) << "TomboyItemsDownloadJob: Network request finished";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemsDownloadJob: Network request finished";
checkReplyError();
if (error() != TomboyJobError::NoError) {
setErrorText(mReply->errorString());
......@@ -65,7 +65,7 @@ void TomboyItemsDownloadJob::onRequestFinished()
Akonadi::Item item(Akonadi::NoteUtils::noteMimeType());
item.setRemoteId(note.toObject()[QLatin1String("guid")].toString());
mResultItems << item;
qCDebug(log_tomboynotesresource) << "TomboyItemsDownloadJob: Retriving note with id" << item.remoteId();
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemsDownloadJob: Retriving note with id" << item.remoteId();
}
setError(TomboyJobError::NoError);
......
......@@ -87,7 +87,7 @@ void TomboyItemUploadJob::start()
request.setHeader(QNetworkRequest::ContentLengthHeader, postData.toJson().length());
mReply = mRequestor->put(request, QList<O0RequestParameter>(), postData.toJson());
connect(mReply, &QNetworkReply::finished, this, &TomboyItemUploadJob::onRequestFinished);
qCDebug(log_tomboynotesresource) << "TomboyItemUploadJob: Start network request";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemUploadJob: Start network request";
}
void TomboyItemUploadJob::onRequestFinished()
......@@ -98,7 +98,7 @@ void TomboyItemUploadJob::onRequestFinished()
emitResult();
return;
}
qCDebug(log_tomboynotesresource) << "TomboyItemUploadJob: Network request finished. No error occured";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyItemUploadJob: Network request finished. No error occured";
// Parse received data as JSON
const QJsonDocument document = QJsonDocument::fromJson(mReply->readAll(), Q_NULLPTR);
......
......@@ -61,7 +61,7 @@ TomboyNotesResource::TomboyNotesResource(const QString &id)
mManager = new KIO::AccessManager(this);
connect(mManager, &KIO::AccessManager::sslErrors, this, &TomboyNotesResource::onSslError);
qCDebug(log_tomboynotesresource) << "Resource started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Resource started";
}
TomboyNotesResource::~TomboyNotesResource()
......@@ -70,7 +70,7 @@ TomboyNotesResource::~TomboyNotesResource()
void TomboyNotesResource::retrieveCollections()
{
qCDebug(log_tomboynotesresource) << "Retrieving collections started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Retrieving collections started";
if (configurationNotValid()) {
cancelTask(i18n("Resource configuration is not valid"));
......@@ -83,7 +83,7 @@ void TomboyNotesResource::retrieveCollections()
// connect to its result() signal
connect(job, &KJob::result, this, &TomboyNotesResource::onCollectionsRetrieved);
job->start();
qCDebug(log_tomboynotesresource) << "Retriving collections job started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Retriving collections job started";
}
void TomboyNotesResource::retrieveItems(const Akonadi::Collection &collection)
......@@ -100,7 +100,7 @@ void TomboyNotesResource::retrieveItems(const Akonadi::Collection &collection)
// connect to its result() signal
connect(job, &KJob::result, this, &TomboyNotesResource::onItemsRetrieved);
job->start();
qCDebug(log_tomboynotesresource) << "Retriving items job started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Retriving items job started";
}
bool TomboyNotesResource::retrieveItem(const Akonadi::Item &item, const QSet<QByteArray> &parts)
......@@ -119,7 +119,7 @@ bool TomboyNotesResource::retrieveItem(const Akonadi::Item &item, const QSet<QBy
// connect to its result() signal
connect(job, &KJob::result, this, &TomboyNotesResource::onItemRetrieved);
job->start();
qCDebug(log_tomboynotesresource) << "Retriving item data job started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Retriving item data job started";
return true;
}
......@@ -127,7 +127,7 @@ bool TomboyNotesResource::retrieveItem(const Akonadi::Item &item, const QSet<QBy
void TomboyNotesResource::onAuthorizationFinished(KJob *kjob)
{
// Saves the received client authentication data in the settings
qCDebug(log_tomboynotesresource) << "Authorization job finished";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Authorization job finished";
auto job = qobject_cast<TomboyServerAuthenticateJob*>(kjob);
if (job->error() == TomboyJobError::NoError) {
Settings::setRequestToken(job->getRequestToken());
......@@ -185,7 +185,7 @@ void TomboyNotesResource::onItemRetrieved(KJob *kjob)
}
itemRetrieved(job->item());
qCDebug(log_tomboynotesresource) << "Retriving item data job with remoteId " << job->item().remoteId() << " finished";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Retriving item data job with remoteId " << job->item().remoteId() << " finished";
}
void TomboyNotesResource::onItemsRetrieved(KJob *kjob)
......@@ -198,7 +198,7 @@ void TomboyNotesResource::onItemsRetrieved(KJob *kjob)
}
itemsRetrieved(job->items());
qCDebug(log_tomboynotesresource) << "Retriving items job finished";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Retriving items job finished";
}
void TomboyNotesResource::onSslError(QNetworkReply *reply, const QList<QSslError> &errors)
......@@ -217,7 +217,7 @@ void TomboyNotesResource::aboutToQuit()
void TomboyNotesResource::configure(WId windowId)
{
qCDebug(log_tomboynotesresource) << "Resource configuration started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Resource configuration started";
ConfigDialog dialog(Settings::self());
......@@ -238,7 +238,7 @@ void TomboyNotesResource::configure(WId windowId)
job->setServerURL(Settings::serverURL(), QString());
connect(job, &KJob::result, this, &TomboyNotesResource::onAuthorizationFinished);
job->start();
qCDebug(log_tomboynotesresource) << "Authorization job started";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "Authorization job started";
} else {
synchronize();
}
......
......@@ -78,7 +78,7 @@ void TomboyServerAuthenticateJob::onLinkingSucceeded()
mReply = mRequestor->get(request, QList<O0RequestParameter>());
connect(mReply, &QNetworkReply::finished, this, &TomboyServerAuthenticateJob::onApiRequestFinished);
qCDebug(log_tomboynotesresource) << "TomboyServerAuthenticateJob: Start network request";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyServerAuthenticateJob: Start network request";
}
void TomboyServerAuthenticateJob::onOpenBrowser(const QUrl &url)
......@@ -105,7 +105,7 @@ void TomboyServerAuthenticateJob::onApiRequestFinished()
mReply = mRequestor->get(request, QList<O0RequestParameter>());
connect(mReply, &QNetworkReply::finished, this, &TomboyServerAuthenticateJob::onUserRequestFinished);
qCDebug(log_tomboynotesresource) << "TomboyServerAuthenticateJob: Start network request";
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "TomboyServerAuthenticateJob: Start network request";
}
void TomboyServerAuthenticateJob::onUserRequestFinished()
......
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