History

put networking library into its own QLoggingCategory

Seth Alves committed 11 years ago

Commit cb7ff861 parent d5832f016 files · +178 −128Browse files

Showing the changes to libraries/networking/src/ResourceCache.cpp (1 of 16 files). Show all

Unified · Split

libraries/networking/src/ResourceCache.cpp+6−4
@@ -21,6 +21,8 @@ · 20 unmodified lines
21#include <assert.h>21#include <assert.h>
22 22
23#include "NetworkAccessManager.h"23#include "NetworkAccessManager.h"
24#include "NetworkLogging.h"
25
24#include "ResourceCache.h"26#include "ResourceCache.h"
25 27
26#define clamp(x, min, max) (((x) < (min)) ? (min) :\28#define clamp(x, min, max) (((x) < (min)) ? (min) :\
@@ -50,7 +52,7 @@ void ResourceCache::refresh(const QUrl& url) { · 23 unmodified lines
50}52}
51 53
52void ResourceCache::getResourceAsynchronously(const QUrl& url) {54void ResourceCache::getResourceAsynchronously(const QUrl& url) {
53 qDebug() << "ResourceCache::getResourceAsynchronously" << url.toString();55 qCDebug(networking) << "ResourceCache::getResourceAsynchronously" << url.toString();
54 _resourcesToBeGottenLock.lockForWrite();56 _resourcesToBeGottenLock.lockForWrite();
55 _resourcesToBeGotten.enqueue(QUrl(url));57 _resourcesToBeGotten.enqueue(QUrl(url));
56 _resourcesToBeGottenLock.unlock();58 _resourcesToBeGottenLock.unlock();
@@ -354,10 +356,10 @@ void Resource::maybeRefresh() { · 297 unmodified lines
354 }356 }
355 } else if (!variant.isValid() || !variant.canConvert<QDateTime>() ||357 } else if (!variant.isValid() || !variant.canConvert<QDateTime>() ||
356 !variant.value<QDateTime>().isValid() || variant.value<QDateTime>().isNull()) {358 !variant.value<QDateTime>().isValid() || variant.value<QDateTime>().isNull()) {
357 qDebug() << "Cannot determine when" << _url.fileName() << "was modified last, cached version might be outdated";359 qCDebug(networking) << "Cannot determine when" << _url.fileName() << "was modified last, cached version might be outdated";
358 return;360 return;
359 }361 }
360 qDebug() << "Loaded" << _url.fileName() << "from the disk cache but the network version is newer, refreshing.";362 qCDebug(networking) << "Loaded" << _url.fileName() << "from the disk cache but the network version is newer, refreshing.";
361 refresh();363 refresh();
362 }364 }
363}365}
@@ -441,7 +443,7 @@ void Resource::handleReplyError(QNetworkReply::NetworkError error, QDebug debug) · 77 unmodified lines
441}443}
442 444
443void Resource::handleReplyFinished() {445void Resource::handleReplyFinished() {
444 qDebug() << "Got finished without download progress/error?" << _url;446 qCDebug(networking) << "Got finished without download progress/error?" << _url;
445 handleDownloadProgress(0, 0);447 handleDownloadProgress(0, 0);
446}448}
447 449

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t