From bdd067370eb0af9b2e8179034730ef8e9e4c8202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 22 Jan 2016 02:06:59 +0100 Subject: [PATCH] Strictly use autostart-enabled .desktop This resolves Bug 2577 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit b62b2d3a077be091b693fecb52f65cbc1ac2681e) --- src/Makefile.am | 6 +++++- src/ksensors.desktop | 6 +++++- src/main.cpp | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 8128f46..7c17c10 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -45,10 +45,14 @@ ksensors_SOURCES = main.cpp ksensors.cpp aboutcfgdesign.ui \ ksensors_LDFLAGS = $(TDE_RPATH) $(all_libraries) ksensors_LDADD = $(LIB_TDEUI) $(LIB_TDECORE) $(LIB_QT) -lsensors -lm -# this is where the desktop file will go +# this is where the desktop file will go shelldesktopdir = $(kde_appsdir)/System shelldesktop_DATA = ksensors.desktop +# and for autostart +autostartdir = $(prefix)/share/autostart +autostart_DATA = ksensors.desktop + # this is where the shell's XML-GUI resource file goes shellrcdir = $(kde_datadir)/ksensors shellrc_DATA = ksensorsui.rc diff --git a/src/ksensors.desktop b/src/ksensors.desktop index 07eff55..a32adfc 100644 --- a/src/ksensors.desktop +++ b/src/ksensors.desktop @@ -16,4 +16,8 @@ Comment[pl]=Ładny frondend lmsensors dla TDE Comment[sv]=Ett trevligt gränssnitt mot lmsensors för TDE GenericName=Lm-Sensors Frontend X-DocPath=ksensors/index.html -Categories=Qt;TDE;System;; +X-TDE-autostart-after=panel +X-TDE-StartupNotify=false +X-TDE-UniqueApplet=true +X-TDE-autostart-condition=ksensorsrc:General:AutoStart:true +Categories=Qt;TDE;System;Applet; diff --git a/src/main.cpp b/src/main.cpp index 035b0fc..708db35 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,6 +56,8 @@ int main(int argc, char *argv[]) if(!KUniqueApplication::start()) return 0; KUniqueApplication a; + // We handle autostart via standard autostart-enabled .desktop file instead of the session + a.disableSessionManagement(); TDEConfig *cfg= kapp->config(); cfg->setGroup("General");