feat: Live Emote Updates for 7TV (#4090)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2022-11-13 12:07:41 +01:00
committed by GitHub
parent 8fa89b4073
commit 39f7d8ac4c
35 changed files with 1833 additions and 54 deletions
+13 -13
View File
@@ -30,19 +30,6 @@ private:
std::function<void()> action_;
};
template <typename F>
static void runInGuiThread(F &&fun)
{
if (isGuiThread())
{
fun();
}
else
{
postToThread(fun);
}
}
// Taken from
// https://stackoverflow.com/questions/21646467/how-to-execute-a-functor-or-a-lambda-in-a-given-thread-in-qt-gcd-style
// Qt 5/4 - preferred, has least allocations
@@ -70,4 +57,17 @@ static void postToThread(F &&fun, QObject *obj = qApp)
QCoreApplication::postEvent(obj, new Event(std::forward<F>(fun)));
}
template <typename F>
static void runInGuiThread(F &&fun)
{
if (isGuiThread())
{
fun();
}
else
{
postToThread(fun);
}
}
} // namespace chatterino