fixed crash

This commit is contained in:
fourtf 2018-01-19 23:41:02 +01:00
parent 03ff2205fa
commit 3104aae80a
4 changed files with 14 additions and 11 deletions

View file

@ -3,6 +3,7 @@
#include "singletons/ircmanager.hpp" #include "singletons/ircmanager.hpp"
#include "singletons/windowmanager.hpp" #include "singletons/windowmanager.hpp"
#include "util/networkmanager.hpp" #include "util/networkmanager.hpp"
#include "util/posttothread.hpp"
#include "util/urlfetch.hpp" #include "util/urlfetch.hpp"
#include <QBuffer> #include <QBuffer>
@ -40,6 +41,7 @@ Image::Image(QPixmap *image, qreal scale, const QString &name, const QString &to
, ishat(isHat) , ishat(isHat)
, scale(scale) , scale(scale)
, isLoading(true) , isLoading(true)
, isLoaded(true)
{ {
} }
@ -85,7 +87,7 @@ void Image::loadImage()
singletons::EmoteManager::getInstance().incGeneration(); singletons::EmoteManager::getInstance().incGeneration();
singletons::WindowManager::getInstance().layoutVisibleChatWidgets(); postToThread([] { singletons::WindowManager::getInstance().layoutVisibleChatWidgets(); });
}); });
singletons::EmoteManager::getInstance().getGifUpdateSignal().connect([=]() { singletons::EmoteManager::getInstance().getGifUpdateSignal().connect([=]() {

View file

@ -375,8 +375,6 @@ int MessageLayoutContainer::getSelectionIndex(QPoint point)
index += this->elements[i]->getSelectionIndexCount(); index += this->elements[i]->getSelectionIndexCount();
} }
qDebug() << index;
return index; return index;
} }

View file

@ -131,6 +131,8 @@ public:
if (cachedFile.open(QIODevice::ReadOnly)) { if (cachedFile.open(QIODevice::ReadOnly)) {
QByteArray bytes = cachedFile.readAll(); QByteArray bytes = cachedFile.readAll();
qDebug() << "loaded cached resource" << this->data.request.url();
onFinished(bytes); onFinished(bytes);
cachedFile.close(); cachedFile.close();
@ -158,7 +160,7 @@ public:
QByteArray bytes = reply->readAll(); QByteArray bytes = reply->readAll();
data.writeToCache(bytes); data.writeToCache(bytes);
// onFinished(bytes); onFinished(bytes);
reply->deleteLater(); reply->deleteLater();
}); });
@ -191,7 +193,7 @@ public:
if (data.caller == nullptr) { if (data.caller == nullptr) {
QByteArray bytes = reply->readAll(); QByteArray bytes = reply->readAll();
data.writeToCache(bytes); data.writeToCache(bytes);
// onFinished(bytes); onFinished(bytes);
reply->deleteLater(); reply->deleteLater();
} else { } else {

View file

@ -113,14 +113,15 @@ ChannelView::~ChannelView()
void ChannelView::queueUpdate() void ChannelView::queueUpdate()
{ {
// if (this->updateTimer.isActive()) { if (this->updateTimer.isActive()) {
// this->updateQueued = true; this->updateQueued = true;
// return; return;
// } }
this->repaint(); // this->repaint();
this->update();
// this->updateTimer.start(); this->updateTimer.start();
} }
void ChannelView::layoutMessages() void ChannelView::layoutMessages()