mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
29 lines
821 B
C++
29 lines
821 B
C++
#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
|