forked from qt-creator/qt-creator
ExtensionManager: Add logging for the fetching of images
Change-Id: I87e96ba5ea65d2bf5639b5edc2c82c128d358a26 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -53,6 +53,8 @@ using namespace WelcomePageHelpers;
|
|||||||
|
|
||||||
namespace ExtensionManager::Internal {
|
namespace ExtensionManager::Internal {
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(widgetLog, "qtc.extensionmanager.widget", QtWarningMsg)
|
||||||
|
|
||||||
constexpr TextFormat h5TF
|
constexpr TextFormat h5TF
|
||||||
{Theme::Token_Text_Default, UiElement::UiElementH5};
|
{Theme::Token_Text_Default, UiElement::UiElementH5};
|
||||||
constexpr TextFormat h6TF
|
constexpr TextFormat h6TF
|
||||||
@@ -735,8 +737,10 @@ void ExtensionManagerWidget::fetchAndDisplayImage(const QUrl &url)
|
|||||||
storage->url = url;
|
storage->url = url;
|
||||||
query.setRequest(QNetworkRequest(url));
|
query.setRequest(QNetworkRequest(url));
|
||||||
query.setNetworkAccessManager(NetworkAccessManager::instance());
|
query.setNetworkAccessManager(NetworkAccessManager::instance());
|
||||||
|
qCDebug(widgetLog).noquote() << "Sending image request:" << url.toDisplayString();
|
||||||
};
|
};
|
||||||
const auto onFetchDone = [storage](const NetworkQuery &query, DoneWith result) {
|
const auto onFetchDone = [storage](const NetworkQuery &query, DoneWith result) {
|
||||||
|
qCDebug(widgetLog) << "Got image QNetworkReply:" << query.reply()->error();
|
||||||
if (result == DoneWith::Success)
|
if (result == DoneWith::Success)
|
||||||
storage->imageData = query.reply()->readAll();
|
storage->imageData = query.reply()->readAll();
|
||||||
};
|
};
|
||||||
@@ -745,6 +749,9 @@ void ExtensionManagerWidget::fetchAndDisplayImage(const QUrl &url)
|
|||||||
if (storage->imageData.isEmpty())
|
if (storage->imageData.isEmpty())
|
||||||
return;
|
return;
|
||||||
m_imageDataBuffer.setData(storage->imageData);
|
m_imageDataBuffer.setData(storage->imageData);
|
||||||
|
qCDebug(widgetLog).noquote() << "Image reponse size:"
|
||||||
|
<< QLocale::system().formattedDataSize(
|
||||||
|
m_imageDataBuffer.size());
|
||||||
if (!m_imageDataBuffer.open(QIODevice::ReadOnly))
|
if (!m_imageDataBuffer.open(QIODevice::ReadOnly))
|
||||||
return;
|
return;
|
||||||
QImageReader reader(&m_imageDataBuffer);
|
QImageReader reader(&m_imageDataBuffer);
|
||||||
@@ -756,6 +763,8 @@ void ExtensionManagerWidget::fetchAndDisplayImage(const QUrl &url)
|
|||||||
const QPixmap pixmap = QPixmap::fromImage(reader.read());
|
const QPixmap pixmap = QPixmap::fromImage(reader.read());
|
||||||
m_image->setPixmap(pixmap);
|
m_image->setPixmap(pixmap);
|
||||||
}
|
}
|
||||||
|
qCDebug(widgetLog) << "Image dimensions:" << reader.size();
|
||||||
|
qCDebug(widgetLog) << "Image is animated:" << animated;
|
||||||
};
|
};
|
||||||
|
|
||||||
Group group{
|
Group group{
|
||||||
|
Reference in New Issue
Block a user