aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/libLumina/ExternalProcess.h45
-rw-r--r--src-qt5/core/libLumina/ExternalProcess.pri6
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp9
-rw-r--r--src-qt5/core/lumina-desktop/lumina-desktop.pro4
4 files changed, 58 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/ExternalProcess.h b/src-qt5/core/libLumina/ExternalProcess.h
new file mode 100644
index 00000000..2106f296
--- /dev/null
+++ b/src-qt5/core/libLumina/ExternalProcess.h
@@ -0,0 +1,45 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2017, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This is a simple class for launching/managing an external process in a non-interactive manner
+// This object will clean itself up when finished and log all output to a particular file if designated
+// otherwise it will suppress all output from the process
+//===========================================
+#ifndef _LUMINA_EXTERNAL_PROCESS_H
+#define _LUMINA_EXTERNAL_PROCESS_H
+
+#include <QProcess>
+#include <QString>
+
+class ExternalProcess : public QProcess{
+ Q_OBJECT
+private slots:
+ void processFinished(){
+ //Clean up this object
+ this->deleteLater();
+ }
+public:
+ ExternalProcess(QString logfile = "") : QProcess(){
+ this->setProcessChannelMode(QProcess::MergedChannels);
+ if(logfile.isEmpty()){
+ this->setStandardOutputFile(QProcess::nullDevice());
+ }else{
+ this->setStandardOutputFile(logfile);
+ }
+ //Setup the connection for automatic cleanup
+ connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(processFinished()) );
+ }
+ ~ExternalProcess(){
+ }
+
+ static void launch(QString program, QStringList args = QStringList()){
+ //Quick launch of a process with logging disabled and automatic cleanup
+ ExternalProcess *tmp = new ExternalProcess();
+ if(args.isEmpty()){ tmp->start(program); }
+ else{ tmp->start(program, args); }
+ }
+};
+#endif
diff --git a/src-qt5/core/libLumina/ExternalProcess.pri b/src-qt5/core/libLumina/ExternalProcess.pri
new file mode 100644
index 00000000..0af4388c
--- /dev/null
+++ b/src-qt5/core/libLumina/ExternalProcess.pri
@@ -0,0 +1,6 @@
+HEADERS *= $${PWD}/ExternalProcess.h
+
+INCLUDEPATH *= ${PWD}
+
+#Now the other dependendies of it
+#include(LUtils.pri)
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 <LuminaX11.h>
#include <LUtils.h>
+#include <ExternalProcess.h>
#include <unistd.h> //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
bgstack15