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/windowmanager.hpp"
#include "util/networkmanager.hpp"
#include "util/posttothread.hpp"
#include "util/urlfetch.hpp"
#include <QBuffer>
@ -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([=]() {

View file

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

View file

@ -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 {

View file

@ -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()