diff --git a/src/messages/image.cpp b/src/messages/image.cpp index a29a47ce..ac6a68a7 100644 --- a/src/messages/image.cpp +++ b/src/messages/image.cpp @@ -3,6 +3,7 @@ #include "singletons/ircmanager.hpp" #include "singletons/windowmanager.hpp" #include "util/networkmanager.hpp" +#include "util/posttothread.hpp" #include "util/urlfetch.hpp" #include @@ -40,6 +41,7 @@ Image::Image(QPixmap *image, qreal scale, const QString &name, const QString &to , ishat(isHat) , scale(scale) , isLoading(true) + , isLoaded(true) { } @@ -85,7 +87,7 @@ void Image::loadImage() singletons::EmoteManager::getInstance().incGeneration(); - singletons::WindowManager::getInstance().layoutVisibleChatWidgets(); + postToThread([] { singletons::WindowManager::getInstance().layoutVisibleChatWidgets(); }); }); singletons::EmoteManager::getInstance().getGifUpdateSignal().connect([=]() { diff --git a/src/messages/layouts/messagelayoutcontainer.cpp b/src/messages/layouts/messagelayoutcontainer.cpp index 465ce2de..dd74df63 100644 --- a/src/messages/layouts/messagelayoutcontainer.cpp +++ b/src/messages/layouts/messagelayoutcontainer.cpp @@ -375,8 +375,6 @@ int MessageLayoutContainer::getSelectionIndex(QPoint point) index += this->elements[i]->getSelectionIndexCount(); } - qDebug() << index; - return index; } diff --git a/src/util/networkrequest.hpp b/src/util/networkrequest.hpp index 06c7292f..8a3466ec 100644 --- a/src/util/networkrequest.hpp +++ b/src/util/networkrequest.hpp @@ -131,6 +131,8 @@ public: if (cachedFile.open(QIODevice::ReadOnly)) { QByteArray bytes = cachedFile.readAll(); + qDebug() << "loaded cached resource" << this->data.request.url(); + onFinished(bytes); cachedFile.close(); @@ -158,7 +160,7 @@ public: QByteArray bytes = reply->readAll(); data.writeToCache(bytes); - // onFinished(bytes); + onFinished(bytes); reply->deleteLater(); }); @@ -191,7 +193,7 @@ public: if (data.caller == nullptr) { QByteArray bytes = reply->readAll(); data.writeToCache(bytes); - // onFinished(bytes); + onFinished(bytes); reply->deleteLater(); } else { diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index 6f691502..d3c1b684 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -113,14 +113,15 @@ ChannelView::~ChannelView() void ChannelView::queueUpdate() { - // if (this->updateTimer.isActive()) { - // this->updateQueued = true; - // return; - // } + if (this->updateTimer.isActive()) { + this->updateQueued = true; + return; + } - this->repaint(); + // this->repaint(); + this->update(); - // this->updateTimer.start(); + this->updateTimer.start(); } void ChannelView::layoutMessages()