mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
remove dependency injection from systemtrayicon
as it was used as experiment only fix compilation warning about unchecked switch case
This commit is contained in:
parent
8c4d58f391
commit
7d8e0644ce
|
@ -70,6 +70,8 @@ void logMessageHandler(QtMsgType type, const QMessageLogContext& ctxt, const QSt
|
|||
case QtFatalMsg:
|
||||
LogMsg += "Fatal";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
LogMsg += ": " + msg + "\n";
|
||||
|
|
|
@ -26,9 +26,8 @@
|
|||
#include <QDebug>
|
||||
#include "src/persistence/settings.h"
|
||||
|
||||
SystemTrayIcon::SystemTrayIcon(Widget *parent)
|
||||
SystemTrayIcon::SystemTrayIcon()
|
||||
{
|
||||
this->parent = parent;
|
||||
QString desktop = getenv("XDG_CURRENT_DESKTOP");
|
||||
if (desktop.isEmpty())
|
||||
desktop = getenv("DESKTOP_SESSION");
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#define SYSTEMTRAYICON_H
|
||||
|
||||
#include "systemtrayicon_private.h"
|
||||
#include "widget.h"
|
||||
#include <QObject>
|
||||
|
||||
class QSystemTrayIcon;
|
||||
|
@ -32,7 +31,7 @@ class SystemTrayIcon : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SystemTrayIcon(Widget *parent);
|
||||
SystemTrayIcon();
|
||||
~SystemTrayIcon();
|
||||
void setContextMenu(QMenu* menu);
|
||||
void show();
|
||||
|
@ -49,7 +48,6 @@ private:
|
|||
private:
|
||||
SystrayBackendType backendType;
|
||||
QSystemTrayIcon* qtIcon;
|
||||
Widget *parent;
|
||||
|
||||
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
|
||||
AppIndicator *unityIndicator;
|
||||
|
|
|
@ -119,6 +119,7 @@ void Widget::init()
|
|||
offlineMsgTimer = new QTimer();
|
||||
offlineMsgTimer->start(15000);
|
||||
|
||||
icon_size = 15;
|
||||
statusOnline = new QAction(this);
|
||||
statusOnline->setIcon(getStatusIcon(Status::Online, icon_size, icon_size));
|
||||
connect(statusOnline, &QAction::triggered, this, &Widget::setStatusOnline);
|
||||
|
@ -1693,7 +1694,7 @@ void Widget::onTryCreateTrayIcon()
|
|||
{
|
||||
if (QSystemTrayIcon::isSystemTrayAvailable())
|
||||
{
|
||||
icon = new SystemTrayIcon(this);
|
||||
icon = new SystemTrayIcon();
|
||||
updateIcons();
|
||||
trayMenu = new QMenu(this);
|
||||
QStyle *style = qApp->style();
|
||||
|
|
|
@ -183,7 +183,7 @@ private slots:
|
|||
void friendListContextMenu(const QPoint &pos);
|
||||
|
||||
private:
|
||||
const int icon_size = 15;
|
||||
int icon_size;
|
||||
|
||||
private:
|
||||
enum ActiveToolMenuButton {
|
||||
|
|
Loading…
Reference in New Issue
Block a user