Skip to content
Permalink
Browse files

Avoid useless tray icon on Windows 7

Fixes #20247

(cherry picked from commit 908a058)
  • Loading branch information
nyalldawson committed Oct 29, 2018
1 parent c077fbc commit 3179b3b8215f85db96f6ad9eb394084e59a09215
Showing with 2 additions and 21 deletions.
  1. +2 −18 src/app/qgisapp.cpp
  2. +0 −3 src/app/qgisapp.h
@@ -59,7 +59,6 @@
#endif
#include <QStatusBar>
#include <QStringList>
#include <QSystemTrayIcon>
#include <QTcpSocket>
#include <QTextStream>
#include <QtGlobal>
@@ -1362,13 +1361,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
QgsGui::instance()->nativePlatformInterface()->setApplicationBadgeCount( count );
} );

if ( !( QgsGui::nativePlatformInterface()->capabilities() & QgsNative::NativeDesktopNotifications ) )
{
mTray = new QSystemTrayIcon();
mTray->setIcon( QIcon( QgsApplication::appIconPath() ) );
mTray->hide();
}

// supposedly all actions have been added, now register them to the shortcut manager
QgsGui::shortcutsManager()->registerAllChildren( this );
QgsGui::shortcutsManager()->registerAllChildren( mSnappingWidget );
@@ -1556,7 +1548,6 @@ QgisApp::~QgisApp()
delete mPythonUtils;
#endif

delete mTray;
delete mDataSourceManagerDialog;
qDeleteAll( mCustomDropHandlers );
qDeleteAll( mCustomLayoutDropHandlers );
@@ -13983,15 +13974,8 @@ void QgisApp::showSystemNotification( const QString &title, const QString &messa

if ( !result.successful )
{
// fallback - use system tray notification
if ( mTray )
{
// Menubar icon is hidden by default. Show to enable notification bubbles
mTray->show();
mTray->showMessage( title, message );
// Re-hide menubar icon
mTray->hide();
}
// fallback - use message bar
messageBar()->pushInfo( title, message );
}
else
{
@@ -36,7 +36,6 @@ class QStringList;
class QToolButton;
class QTcpSocket;
class QValidator;
class QSystemTrayIcon;

class QgisAppInterface;
class QgisAppStyleSheet;
@@ -2267,8 +2266,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
bool gestureEvent( QGestureEvent *event );
void tapAndHoldTriggered( QTapAndHoldGesture *gesture );

QSystemTrayIcon *mTray = nullptr;

QgsLocatorWidget *mLocatorWidget = nullptr;

QgsStatusBar *mStatusBar = nullptr;

0 comments on commit 3179b3b

Please sign in to comment.
You can’t perform that action at this time.