fixed deleting QTimer on wrong thread

This commit is contained in:
fourtf
2019-08-20 23:30:39 +02:00
parent 14222f84f2
commit 7643c0d20d
16 changed files with 64 additions and 59 deletions
+3 -2
View File
@@ -11,7 +11,8 @@
namespace chatterino {
void LinkResolver::getLinkInfo(
const QString url, std::function<void(QString, Link)> successCallback)
const QString url, QObject *caller,
std::function<void(QString, Link)> successCallback)
{
if (!getSettings()->linkInfoTooltip)
{
@@ -22,7 +23,7 @@ void LinkResolver::getLinkInfo(
// QTimer::singleShot(3000, [=]() {
NetworkRequest(Env::get().linkResolverUrl.arg(QString::fromUtf8(
QUrl::toPercentEncoding(url, "", "/:"))))
.caller(QThread::currentThread())
.caller(caller)
.timeout(30000)
.onSuccess([successCallback, url](auto result) mutable -> Outcome {
auto root = result.parseJson();