Skip to content

Commit

Permalink
Add a check for the existence of the log dir before starting the proc…
Browse files Browse the repository at this point in the history
…esses.
  • Loading branch information
beanpole135 committed May 6, 2016
1 parent 87e3920 commit aa46846
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src-qt5/core/lumina-session/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#include <QProcess>
#include <QString>




#include "session.h"
#include <LuminaUtils.h>
#include <LuminaOS.h>
Expand Down Expand Up @@ -39,7 +36,7 @@ int main(int argc, char ** argv)
setenv("XDG_CURRENT_DESKTOP","Lumina",1);
unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default...
//Check for any missing user config files

//Start X11 if needed

//Configure X11 monitors if needed
Expand Down
5 changes: 4 additions & 1 deletion src-qt5/core/lumina-session/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ void LSession::procFinished(){
}

void LSession::startProcess(QString ID, QString command){
QString logfile = QDir::homePath()+"/.lumina/logs/"+ID+".log";
QString dir = QDir::homePath()+"/.lumina/logs";
if(!QFile::exists(dir)){ QDir tmp(dir); tmp.mkpath(dir); }
QString logfile = dir+"/"+ID+".log";
if(QFile::exists(logfile+".old")){ QFile::remove(logfile+".old"); }
if(QFile::exists(logfile)){ QFile::rename(logfile,logfile+".old"); }

QProcess *proc = new QProcess();
proc->setProcessChannelMode(QProcess::MergedChannels);
proc->setProcessEnvironment( QProcessEnvironment::systemEnvironment() );
Expand Down

0 comments on commit aa46846

Please sign in to comment.