1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Assert that Widget isn't used on Android

That would cause horrible conflicts and apreciable slowdowns
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2015-02-06 19:51:03 +01:00
parent 2e7c73dcb0
commit 3b9d4eba2e
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -37,6 +37,7 @@
#include "src/platform/timer.h" #include "src/platform/timer.h"
#include "systemtrayicon.h" #include "systemtrayicon.h"
#include "src/nexus.h" #include "src/nexus.h"
#include <cassert>
#include <QMessageBox> #include <QMessageBox>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
@ -54,6 +55,12 @@
#include <QTranslator> #include <QTranslator>
#include <tox/tox.h> #include <tox/tox.h>
#ifdef Q_OS_ANDROID
#define IS_ON_DESKTOP_GUI 0
#else
#define IS_ON_DESKTOP_GUI 1
#endif
void toxActivateEventHandler(const QByteArray& data) void toxActivateEventHandler(const QByteArray& data)
{ {
if (data != "$activate") if (data != "$activate")
@ -285,6 +292,8 @@ Widget::~Widget()
Widget* Widget::getInstance() Widget* Widget::getInstance()
{ {
assert(IS_ON_DESKTOP_GUI); // Widget must only be used on Desktop platforms
if (!instance) if (!instance)
{ {
instance = new Widget(); instance = new Widget();