Make KDE integration optional

This commit is contained in:
Ximi1970
2020-06-07 13:00:50 +02:00
parent a8e0e2dec8
commit 7b3b06bd57
8 changed files with 33 additions and 10 deletions

View File

@@ -17,6 +17,8 @@ else
endif
endif
#OPTIONS = "DEFINES += NO_KDE_INTEGRATION"
.PHONY: clean \
systray-x-xpi \
systray-x-app
@@ -56,7 +58,7 @@ systray-x-app:
rm -f SysTray-X ;\
mkdir -p app/build ;\
cd app/build ;\
$(QMAKE) $(EXT_VERSION) ../SysTray-X/SysTray-X.pro ;\
$(QMAKE) $(EXT_VERSION) $(OPTIONS) ../SysTray-X/SysTray-X.pro ;\
make ;\
cd ../.. ;\
cp app/build/SysTray-X .

View File

@@ -4,13 +4,28 @@
#
#-------------------------------------------------
QT += core gui
#DEFINES += NO_KDE_INTEGRATION
!contains(DEFINES,NO_KDE_INTEGRATION) {
DEFINES += KDE_INTEGRATION
}
#
# Set the Qt modules
#
QT += core gui
unix:!macx: {
QT += dbus KNotifications
contains(DEFINES,KDE_INTEGRATION) {
QT += dbus KNotifications
}
}
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#
# Define the target
#
TARGET = SysTray-X
TEMPLATE = app

View File

@@ -44,6 +44,12 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
m_ui->hideDefaultIconCheckBox->hide();
#endif
#if defined( Q_OS_UNIX ) && defined( NO_KDE_INTEGRATION )
m_ui->hideDefaultIconCheckBox->hide();
#endif
/*

View File

@@ -324,7 +324,7 @@ void SysTrayX::hideTrayIcon()
}
#ifdef Q_OS_UNIX
#if defined( Q_OS_UNIX ) && defined( KDE_INTEGRATION )
/*
* Show / create tray icon
@@ -438,7 +438,7 @@ void SysTrayX::slotSelectIconObjectPref()
void SysTrayX::slotSelectIconObject( bool state )
{
#ifdef Q_OS_UNIX
#if defined( Q_OS_UNIX ) && defined( KDE_INTEGRATION )
if( state )
{
@@ -574,7 +574,7 @@ void SysTrayX::slotVersion( QString version )
QSystemTrayIcon::Warning );
}
#ifdef Q_OS_UNIX
#if defined( Q_OS_UNIX ) && defined( KDE_INTEGRATION )
if( m_kde_tray_icon )
{

View File

@@ -1,6 +1,6 @@
#include "systrayxstatusnotifier.h"
#ifdef Q_OS_UNIX
#if defined( Q_OS_UNIX ) && defined( KDE_INTEGRATION )
/*
* Local includes

View File

@@ -1,5 +1,5 @@
#include <QtGlobal>
#ifdef Q_OS_UNIX
#if defined( Q_OS_UNIX ) && defined( KDE_INTEGRATION )
#ifndef SYSTRAYXSTATUSNOTIFIER_H
#define SYSTRAYXSTATUSNOTIFIER_H

View File

@@ -34,7 +34,7 @@ build-stamp:
# Add here commands to compile the package.
sed < app/config/linux/SysTray_X.json.template -e 's|SYSTRAY_X_PATH|/usr/bin/SysTray-X|' > SysTray_X.json
make EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$(VERSION_MAJOR)\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$(VERSION_MINOR)\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$(VERSION_PATCH)\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$(BUILD_NUMBER)\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$(GIT_HASH)\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$(GIT_BRANCH)\\\\\\\\\\\\\\\""
make OPTIONS="DEFINES += NO_KDE_INTEGRATION" EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$(VERSION_MAJOR)\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$(VERSION_MINOR)\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$(VERSION_PATCH)\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$(BUILD_NUMBER)\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$(GIT_HASH)\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$(GIT_BRANCH)\\\\\\\\\\\\\\\""
# --- end custom part for compiling

View File

@@ -68,7 +68,7 @@ export BUILD_NUMBER=`cat %{S:1} | grep BUILD_NUMBER | sed -e "s/BUILD_NUMBER=\(.
export GIT_HASH=`cat %{S:1} | grep GIT_HASH | sed -e "s/GIT_HASH=\(.*\)/\1/"`
export GIT_BRANCH=`cat %{S:1} | grep GIT_BRANCH | sed -e "s/GIT_BRANCH=\(.*\)/\1/"`
make %{?_smp_mflags} EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$VERSION_MAJOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$VERSION_MINOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$VERSION_PATCH\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$BUILD_NUMBER\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$GIT_HASH\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$GIT_BRANCH\\\\\\\\\\\\\\\""
make %{?_smp_mflags} OPTIONS="DEFINES += NO_KDE_INTEGRATION" EXT_VERSION="DEFINES+=EXT_VERSION DEFINES+=APP_VERSION_MAJOR=\\\\\\\\\\\\\\\"$VERSION_MAJOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_MINOR=\\\\\\\\\\\\\\\"$VERSION_MINOR\\\\\\\\\\\\\\\" DEFINES+=APP_VERSION_PATCH=\\\\\\\\\\\\\\\"$VERSION_PATCH\\\\\\\\\\\\\\\" DEFINES+=APP_BUILD=\\\\\\\\\\\\\\\"$BUILD_NUMBER\\\\\\\\\\\\\\\" DEFINES+=APP_GITHASH=\\\\\\\\\\\\\\\"$GIT_HASH\\\\\\\\\\\\\\\" DEFINES+=APP_GITBRANCH=\\\\\\\\\\\\\\\"$GIT_BRANCH\\\\\\\\\\\\\\\""
sed < app/config/linux/SysTray_X.json.template -e 's|SYSTRAY_X_PATH|%{_bindir}/SysTray-X|' > SysTray_X.json