aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/LSession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop/LSession.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp56
1 files changed, 36 insertions, 20 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index 2a1ec783..dab30f01 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -98,7 +98,7 @@ void LSession::setupSession(){
qDebug() << "Initializing Session";
if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); }
QTime* timer = 0;
- //if(DEBUG){ timer = new QTime(); timer->start(); qDebug() << " - Init srand:" << timer->elapsed();}
+ if(DEBUG){ timer = new QTime(); timer->start(); qDebug() << " - Init srand:" << timer->elapsed();}
//Setup the QSettings default paths
splash.showScreen("settings");
@@ -118,9 +118,9 @@ void LSession::setupSession(){
}
//use the system settings
//Setup the user's lumina settings directory as necessary
- splash.showScreen("user");
- if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();}
- checkUserFiles(); //adds these files to the watcher as well
+ //splash.showScreen("user");
+ //if(DEBUG){ qDebug() << " - Init User Files:" << timer->elapsed();}
+ //checkUserFiles(); //adds these files to the watcher as well
//Initialize the internal variables
DESKTOPS.clear();
@@ -147,11 +147,12 @@ void LSession::setupSession(){
if(DEBUG){ qDebug() << " - Init Desktops:" << timer->elapsed();}
desktopFiles = QDir(QDir::homePath()+"/Desktop").entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs, QDir::Name | QDir::IgnoreCase | QDir::DirsFirst);
updateDesktops();
- for(int i=0; i<6; i++){ LSession::processEvents(); } //Run through this a few times so the interface systems get up and running
+ //if(DEBUG){ qDebug() << " - Process Events (6x):" << timer->elapsed();}
+ //for(int i=0; i<6; i++){ LSession::processEvents(); } //Run through this a few times so the interface systems get up and running
//Now setup the system watcher for changes
splash.showScreen("final");
- qDebug() << " - Initialize file system watcher";
+ //qDebug() << " - Initialize file system watcher";
if(DEBUG){ qDebug() << " - Init QFileSystemWatcher:" << timer->elapsed();}
watcher = new QFileSystemWatcher(this);
QString confdir = sessionsettings->fileName().section("/",0,-2);
@@ -171,14 +172,18 @@ void LSession::setupSession(){
connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherChange(QString)) );
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) );
connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) );
- if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;}
- for(int i=0; i<4; i++){ LSession::processEvents(); } //Again, just a few event loops here so thing can settle before we close the splash screen
+ //if(DEBUG){ qDebug() << " - Process Events (4x):" << timer->elapsed();}
+ //for(int i=0; i<4; i++){ LSession::processEvents(); } //Again, just a few event loops here so thing can settle before we close the splash screen
+ if(DEBUG){ qDebug() << " - Launch Startup Apps:" << timer->elapsed();}
//launchStartupApps();
QTimer::singleShot(500, this, SLOT(launchStartupApps()) );
- splash.hide();
- LSession::processEvents();
+ //if(DEBUG){ qDebug() << " - Hide Splashscreen:" << timer->elapsed();}
+ //splash.hide();
+ //LSession::processEvents();
+ if(DEBUG){ qDebug() << " - Close Splashscreen:" << timer->elapsed();}
splash.close();
- LSession::processEvents();
+ //LSession::processEvents();
+ if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;}
}
void LSession::CleanupSession(){
@@ -289,7 +294,7 @@ void LSession::launchStartupApps(){
qDebug() << " - - Screen Brightness:" << QString::number(tmp)+"%";
}
//QProcess::startDetached("nice lumina-open -autostart-apps");
- ExternalProcess::launch("nice lumina-open -autostart-apps");
+ ExternalProcess::launch("lumina-open", QStringList() << "-autostart-apps", false);
//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
@@ -303,7 +308,7 @@ void LSession::launchStartupApps(){
QString sfile = sessionsettings->value("audiofiles/login", LOS::LuminaShare()+"Login.ogg").toString();
playAudioFile(sfile);
}
- qDebug() << "[DESKTOP INIT FINISHED]";
+ //qDebug() << "[DESKTOP INIT FINISHED]";
}
void LSession::StartLogout(){
@@ -384,15 +389,26 @@ void LSession::checkWindowGeoms(){
}
}
-void LSession::checkUserFiles(){
+bool LSession::checkUserFiles(){
//internal version conversion examples:
// [1.0.0 -> 1000000], [1.2.3 -> 1002003], [0.6.1 -> 6001]
- QString OVS = sessionsettings->value("DesktopVersion","0").toString(); //Old Version String
- bool changed = LDesktopUtils::checkUserFiles(OVS);
+ qDebug() << "Check User Files";
+ //char tmp[] = "junk\0";
+ //int tmpN = 0;
+ //QApplication A(tmpN, (char **)&tmp);
+ QSettings sset("lumina-desktop", "sessionsettings");
+ QString OVS = sset.value("DesktopVersion","0").toString(); //Old Version String
+ qDebug() << " - Old Version:" << OVS;
+ qDebug() << " - Current Version:" << LDesktopUtils::LuminaDesktopVersion();
+ bool changed = LDesktopUtils::checkUserFiles(OVS, LDesktopUtils::LuminaDesktopVersion());
+ qDebug() << " - Made Changes:" << changed;
if(changed){
//Save the current version of the session to the settings file (for next time)
- sessionsettings->setValue("DesktopVersion", this->applicationVersion());
+ sset.setValue("DesktopVersion", LDesktopUtils::LuminaDesktopVersion());
}
+ qDebug() << "Finished with user files check";
+ //delete A;
+ return changed;
}
void LSession::refreshWindowManager(){
@@ -573,7 +589,7 @@ void LSession::SessionEnding(){
//===============
void LSession::LaunchApplication(QString cmd){
//LSession::setOverrideCursor(QCursor(Qt::BusyCursor));
- ExternalProcess::launch(cmd);
+ ExternalProcess::launch(cmd, QStringList(), true);
//QProcess::startDetached(cmd);
}
@@ -674,7 +690,7 @@ void LSession::WindowPropertyEvent(){
if(RunningApps.length() < newapps.length()){
//New Window found
//qDebug() << "New window found";
- LSession::restoreOverrideCursor(); //restore the mouse cursor back to normal (new window opened?)
+ //LSession::restoreOverrideCursor(); //restore the mouse cursor back to normal (new window opened?)
//Perform sanity checks on any new window geometries
for(int i=0; i<newapps.length() && !TrayStopping; i++){
if(!RunningApps.contains(newapps[i])){
@@ -826,7 +842,7 @@ void LSession::attachTrayWindow(WId win){
if(RunningTrayApps.contains(win)){ return; } //already managed
qDebug() << "Session Tray: Window Added";
RunningTrayApps << win;
- LSession::restoreOverrideCursor();
+ //LSession::restoreOverrideCursor();
if(DEBUG){ qDebug() << "Tray List Changed"; }
emit TrayListChanged();
}
bgstack15