1
0
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:
agilob 2015-08-29 17:06:22 +01:00 committed by tux3
parent 8c4d58f391
commit 7d8e0644ce
5 changed files with 7 additions and 7 deletions

View File

@ -70,6 +70,8 @@ void logMessageHandler(QtMsgType type, const QMessageLogContext& ctxt, const QSt
case QtFatalMsg:
LogMsg += "Fatal";
break;
default:
break;
}
LogMsg += ": " + msg + "\n";

View File

@ -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");

View File

@ -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;

View File

@ -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();

View File

@ -183,7 +183,7 @@ private slots:
void friendListContextMenu(const QPoint &pos);
private:
const int icon_size = 15;
int icon_size;
private:
enum ActiveToolMenuButton {