diff --git a/src/feed.cpp b/src/feed.cpp index 1c73b4e1..48d9e28e 100644 --- a/src/feed.cpp +++ b/src/feed.cpp @@ -82,6 +82,10 @@ Feed::Feed(int index) setRefreshing(false); } }); + connect(&Fetcher::instance(), &Fetcher::imageDownloadFinished, this, [this](QString url) { + if(url == m_image) + Q_EMIT imageChanged(url); + }); } Feed::~Feed() diff --git a/src/fetcher.cpp b/src/fetcher.cpp index a93628ad..2dc4359b 100644 --- a/src/fetcher.cpp +++ b/src/fetcher.cpp @@ -195,6 +195,7 @@ void Fetcher::download(QString url) file.write(data); file.close(); + Q_EMIT imageDownloadFinished(url); delete reply; }); } diff --git a/src/fetcher.h b/src/fetcher.h index 08591a1e..2459e5e7 100644 --- a/src/fetcher.h +++ b/src/fetcher.h @@ -57,4 +57,5 @@ Q_SIGNALS: void feedUpdated(QString url); void feedDetailsUpdated(QString url, QString name, QString image, QString link, QString description, QDateTime lastUpdated); void error(QString url, int errorId, QString errorString); + void imageDownloadFinished(QString url); };