mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix image loader scrollbar crash (#129)
* fix image loader scrollbar crash
This commit is contained in:
parent
0ef6fdfef9
commit
bdee9fff70
|
@ -43,6 +43,8 @@ void ImageLoaderManager::queue(chatterino::messages::LazyLoadedImage *lli)
|
||||||
|
|
||||||
QObject::connect(&requester, &ImageLoaderRequester::request, worker,
|
QObject::connect(&requester, &ImageLoaderRequester::request, worker,
|
||||||
&ImageLoaderWorker::handleRequest);
|
&ImageLoaderWorker::handleRequest);
|
||||||
|
QObject::connect(worker, &ImageLoaderWorker::done, lli,
|
||||||
|
[lli]() { lli->windowManager.layoutVisibleChatWidgets(); });
|
||||||
|
|
||||||
emit requester.request(lli, &this->NaM);
|
emit requester.request(lli, &this->NaM);
|
||||||
}
|
}
|
||||||
|
@ -80,9 +82,9 @@ void ImageLoaderWorker::handleLoad(chatterino::messages::LazyLoadedImage *lli, Q
|
||||||
}
|
}
|
||||||
|
|
||||||
lli->emoteManager.incGeneration();
|
lli->emoteManager.incGeneration();
|
||||||
lli->windowManager.layoutVisibleChatWidgets();
|
|
||||||
|
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
|
emit this->done();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@ class ImageLoaderWorker : public QObject
|
||||||
public slots:
|
public slots:
|
||||||
void handleRequest(chatterino::messages::LazyLoadedImage *lli, QNetworkAccessManager *nam);
|
void handleRequest(chatterino::messages::LazyLoadedImage *lli, QNetworkAccessManager *nam);
|
||||||
void handleLoad(LazyLoadedImage *lli, QNetworkReply *reply);
|
void handleLoad(LazyLoadedImage *lli, QNetworkReply *reply);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void done();
|
||||||
};
|
};
|
||||||
|
|
||||||
class ImageLoaderRequester : public QObject
|
class ImageLoaderRequester : public QObject
|
||||||
|
|
|
@ -10,8 +10,6 @@ class WindowManager;
|
||||||
|
|
||||||
namespace messages {
|
namespace messages {
|
||||||
|
|
||||||
class ImageLoaderManager;
|
|
||||||
|
|
||||||
class LazyLoadedImage : public QObject
|
class LazyLoadedImage : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -68,6 +66,7 @@ private:
|
||||||
void gifUpdateTimout();
|
void gifUpdateTimout();
|
||||||
|
|
||||||
friend class ImageLoaderWorker;
|
friend class ImageLoaderWorker;
|
||||||
|
friend class ImageLoaderManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace messages
|
} // namespace messages
|
||||||
|
|
Loading…
Reference in a new issue