/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
platform/gui_thread_linux.cpp
28 строк
821 B
Arsentiy Milchakov
[base] TaskLoop::kIncorrectId is renamed to kNoId
10 дек 2020, 20:05
10 дек 2020, 20:05
a0a66d8
Код
Авторство
О чём код?
#include "platform/gui_thread.hpp" #include <utility> #include <QtCore/QCoreApplication> namespace platform { base::TaskLoop::PushResult GuiThread::Push(Task && task) { // Following hack is used to post on main message loop |fn| when // |source| is destroyed (at the exit of the code block). QObject source; QObject::connect(&source, &QObject::destroyed, QCoreApplication::instance(), std::move(task)); return {true, base::TaskLoop::kNoId}; } base::TaskLoop::PushResult GuiThread::Push(Task const & task) { // Following hack is used to post on main message loop |fn| when // |source| is destroyed (at the exit of the code block). QObject source; QObject::connect(&source, &QObject::destroyed, QCoreApplication::instance(), task); return {true, base::TaskLoop::kNoId}; } } // namespace platform