summaryrefslogtreecommitdiff
path: root/SystrayIcon.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2020-08-11 22:35:12 +0100
committerThomas Preud'homme <robotux@celest.fr>2020-08-11 22:35:12 +0100
commit3ac113857071fc1f225b2e1b42547269e568c6b7 (patch)
tree8b28dd9c44a0d3c7ab8187cd8d8f19d47591d813 /SystrayIcon.cpp
parent9b10c21f5cad0e2ec27d23c59e65af7141a226f3 (diff)
New upstream version 2.2.4.4
Diffstat (limited to 'SystrayIcon.cpp')
-rwxr-xr-x[-rw-r--r--]SystrayIcon.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/SystrayIcon.cpp b/SystrayIcon.cpp
index eb09f3b..ceed27d 100644..100755
--- a/SystrayIcon.cpp
+++ b/SystrayIcon.cpp
@@ -36,7 +36,7 @@ SystrayIcon::SystrayIcon(QObject * parent) :
actionOptions = new QAction(this);
actionProductKey = new QAction(this);
//actionTransfer = new QAction(this);
- #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
+ #ifdef TREEMENU
copyMenu = NULL;
#endif
//to prevent init bug
@@ -80,8 +80,10 @@ SystrayIcon::SystrayIcon(QObject * parent) :
#ifdef ULTRACOPIER_DEBUG
systrayMenu->addAction(actionSaveBugReport);
#endif
+ #ifndef Q_OS_LINUX
if(!ProductKey::productKey->isUltimate())
systrayMenu->addAction(actionProductKey);
+ #endif
systrayMenu->addAction(actionMenuQuit);
#ifndef Q_OS_MAC
systrayMenu->insertSeparator(actionOptions);
@@ -90,7 +92,7 @@ SystrayIcon::SystrayIcon(QObject * parent) :
updateSystrayIcon();
#ifdef ULTRACOPIER_INTERNET_SUPPORT
- lastVersion=ULTRACOPIER_VERSION;
+ lastVersion=FacilityEngine::version();
#endif
timerCheckSetTooltip.setSingleShot(true);
@@ -118,7 +120,7 @@ SystrayIcon::~SystrayIcon()
delete actionOptions;
delete actionProductKey;
delete systrayMenu;
- #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
+ #ifdef TREEMENU
if(copyMenu!=NULL)
{
delete copyMenu;
@@ -267,8 +269,11 @@ void SystrayIcon::updateSystrayIcon()
#endif
}
if(theNewSystrayIcon.isNull())
+ {
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"All the icon include the default icon remain null");
- setIcon(theNewSystrayIcon);
+ }
+ else
+ setIcon(theNewSystrayIcon);
#ifdef ULTRACOPIER_MODE_SUPERCOPIER
setToolTip(QString::fromStdString("Supercopier - "+toolTip));
#else
@@ -494,7 +499,7 @@ void SystrayIcon::addEngineAction(const QString &name, const QIcon &icon, const
QAction *copy = new QAction(icon, label, menu);
connect(copy,&QAction::triggered, this, query);
copy->setData(name);
- #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
+ #ifdef TREEMENU
copyMenu->addAction(copy);
#else
actions.push_back(copy);
@@ -505,7 +510,7 @@ void SystrayIcon::addEngineAction(const QString &name, const QIcon &icon, const
void SystrayIcon::reloadEngineList()
{
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start");
- #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
+ #ifdef TREEMENU
if(copyMenu!=NULL)
{
delete copyMenu;
@@ -542,7 +547,7 @@ void SystrayIcon::reloadEngineList()
QString labelTransfer = tr("Add &transfer");
QString labelMove = tr("Add &move");
QMenu *menu = nullptr;
- #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
+ #ifdef TREEMENU
if(engineEntryList.size()==1)
menu = copyMenu;
else
@@ -560,7 +565,7 @@ void SystrayIcon::reloadEngineList()
addEngineAction(name, IconAdd, labelTransfer, menu, &SystrayIcon::CatchTransferQuery);
addEngineAction(name, IconAdd, labelMove, menu, &SystrayIcon::CatchMoveQuery);
}
- #if ! defined(Q_OS_LINUX) || (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
+ #ifdef TREEMENU
if(engineEntryList.size()!=1)
copyMenu->addMenu(menu);
#endif