Replace QSystemTrayIcon with a empty stub on Android

Should hopefully fix the Android builds on binary factory.
This commit is contained in:
Volker Krause 2023-02-10 16:50:34 +01:00 committed by Bart De Vries
parent 3f1859e14b
commit c0410506d1
2 changed files with 19 additions and 1 deletions

View File

@ -6,6 +6,7 @@
#include "systrayicon.h"
#ifndef Q_OS_ANDROID
#include <QCoreApplication>
#include <QFile>
#include <QMenu>
@ -117,6 +118,12 @@ SystrayIcon::SystrayIcon(QObject *parent)
show();
}
}
#else
SystrayIcon::SystrayIcon(QObject *parent)
: QObject(parent)
{
}
#endif
SystrayIcon::~SystrayIcon()
{
@ -124,5 +131,9 @@ SystrayIcon::~SystrayIcon()
bool SystrayIcon::available() const
{
#ifndef Q_OS_ANDROID
return QSystemTrayIcon::isSystemTrayAvailable();
#else
return false;
#endif
}

View File

@ -7,9 +7,16 @@
#pragma once
#include <QObject>
#ifndef Q_OS_ANDROID
#include <QSystemTrayIcon>
#endif
class SystrayIcon : public QSystemTrayIcon
class SystrayIcon
#ifndef Q_OS_ANDROID
: public QSystemTrayIcon
#else
: public QObject
#endif
{
Q_OBJECT