From 491b06d75e4ab3340429875b58e0149692384a03 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 4 Jan 2017 17:37:00 -0500 Subject: Create a new "ExternalProcess" class in the library directory which is specifically designed for launching external processes in an unattended manner and automatically cleaning up the object on the heap when finished. It will also hide any output from the process or forward it to a designated log file rather than polluting the current process output channel. --- src-qt5/core/lumina-desktop/LSession.cpp | 9 ++++++--- src-qt5/core/lumina-desktop/lumina-desktop.pro | 4 +--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 0387555a..a4cc12a7 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -16,6 +16,7 @@ //LibLumina X11 class #include #include +#include #include //for usleep() usage @@ -276,8 +277,9 @@ void LSession::launchStartupApps(){ LOS::setScreenBrightness( tmp ); qDebug() << " - - Screen Brightness:" << QString::number(tmp)+"%"; } - QProcess::startDetached("nice lumina-open -autostart-apps"); - + //QProcess::startDetached("nice lumina-open -autostart-apps"); + ExternalProcess::launch("nice lumina-open -autostart-apps"); + //Re-load the screen brightness and volume settings from the previous session // Wait until after the XDG-autostart functions, since the audio system might be started that way qDebug() << " - Loading previous settings"; @@ -524,7 +526,8 @@ void LSession::SessionEnding(){ //=============== void LSession::LaunchApplication(QString cmd){ LSession::setOverrideCursor(QCursor(Qt::BusyCursor)); - QProcess::startDetached(cmd); + ExternalProcess::launch(cmd); + //QProcess::startDetached(cmd); } QFileInfoList LSession::DesktopFiles(){ diff --git a/src-qt5/core/lumina-desktop/lumina-desktop.pro b/src-qt5/core/lumina-desktop/lumina-desktop.pro index 4b725288..1d60f7d3 100644 --- a/src-qt5/core/lumina-desktop/lumina-desktop.pro +++ b/src-qt5/core/lumina-desktop/lumina-desktop.pro @@ -15,9 +15,7 @@ include(../libLumina/LuminaXDG.pri) include(../libLumina/LuminaX11.pri) include(../libLumina/LuminaSingleApplication.pri) include(../libLumina/LuminaThemes.pri) - -#LIBS += -lLuminaUtils -lxcb -lxcb-damage -#DEPENDPATH += ../libLumina +include(../libLumina/ExternalProcess.pri) TEMPLATE = app -- cgit