diff --git a/src/libs/utils/markdownbrowser.cpp b/src/libs/utils/markdownbrowser.cpp index f26c45830c6..44937dfa2c3 100644 --- a/src/libs/utils/markdownbrowser.cpp +++ b/src/libs/utils/markdownbrowser.cpp @@ -291,6 +291,9 @@ public: if (m_basePath.isEmpty()) localUrls.clear(); + if (!m_loadRemoteImages) + remoteUrls.clear(); + const LoopList remoteIterator(remoteUrls); const LoopList localIterator(localUrls); @@ -360,11 +363,13 @@ public: } void setBasePath(const FilePath &filePath) { m_basePath = filePath; } + void setAllowRemoteImages(bool allow) { m_loadRemoteImages = allow; } private: AnimatedImageHandler m_imageHandler; QList m_urlsToLoad; bool m_needsToRestartLoading = false; + bool m_loadRemoteImages = false; Tasking::TaskTreeRunner m_imageLoaderTree; FilePath m_basePath; }; @@ -375,6 +380,11 @@ MarkdownBrowser::MarkdownBrowser(QWidget *parent) setDocument(new AnimatedDocument(this)); } +void MarkdownBrowser::setAllowRemoteImages(bool allow) +{ + static_cast(document())->setAllowRemoteImages(allow); +} + void MarkdownBrowser::setBasePath(const FilePath &filePath) { static_cast(document())->setBasePath(filePath); diff --git a/src/libs/utils/markdownbrowser.h b/src/libs/utils/markdownbrowser.h index ccd48712b63..9ac2c3f2cb3 100644 --- a/src/libs/utils/markdownbrowser.h +++ b/src/libs/utils/markdownbrowser.h @@ -20,6 +20,7 @@ public: void setMarkdown(const QString &markdown); void setBasePath(const FilePath &filePath); + void setAllowRemoteImages(bool allow); }; } // namespace Utils diff --git a/src/plugins/extensionmanager/extensionmanagerwidget.cpp b/src/plugins/extensionmanager/extensionmanagerwidget.cpp index d5730005cd7..0239907c5c8 100644 --- a/src/plugins/extensionmanager/extensionmanagerwidget.cpp +++ b/src/plugins/extensionmanager/extensionmanagerwidget.cpp @@ -442,6 +442,7 @@ ExtensionManagerWidget::ExtensionManagerWidget() m_headingWidget = new HeadingWidget; m_description = new MarkdownBrowser; + m_description->setAllowRemoteImages(true); m_description->setFrameStyle(QFrame::NoFrame); m_description->setOpenExternalLinks(true); QPalette browserPal = m_description->palette();