diff options
Diffstat (limited to 'launcher/ui/widgets/VariableSizedImageObject.h')
-rw-r--r-- | launcher/ui/widgets/VariableSizedImageObject.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/launcher/ui/widgets/VariableSizedImageObject.h b/launcher/ui/widgets/VariableSizedImageObject.h index 11563a37..137487ee 100644 --- a/launcher/ui/widgets/VariableSizedImageObject.h +++ b/launcher/ui/widgets/VariableSizedImageObject.h @@ -28,7 +28,7 @@ * Why? Because we want to re-scale images dynamically based on the document's size, in order to * not have images being weirdly cropped out in different resolutions. */ -class VariableSizedImageObject : public QObject, public QTextObjectInterface { +class VariableSizedImageObject final : public QObject, public QTextObjectInterface { Q_OBJECT Q_INTERFACES(QTextObjectInterface) @@ -38,7 +38,15 @@ class VariableSizedImageObject : public QObject, public QTextObjectInterface { void setMetaEntry(QString meta_entry) { m_meta_entry = meta_entry; } - protected: + public slots: + /** Stops all currently loading images from modifying the document. + * + * This does not stop the ongoing network tasks, it only prevents their result + * from impacting the document any further. + */ + void flush(); + + private: /** Adds the image to the document, in the given position. */ void parseImage(QTextDocument* doc, QImage image, int posInDocument); @@ -49,7 +57,8 @@ class VariableSizedImageObject : public QObject, public QTextObjectInterface { */ void loadImage(QTextDocument* doc, const QUrl& source, int posInDocument); + private: QString m_meta_entry; - QList<QUrl> m_fetching_images; + QSet<QUrl> m_fetching_images; }; |