aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp16
-rw-r--r--src-qt5/core/lumina-desktop/LSession.h2
-rw-r--r--src-qt5/core/lumina-desktop/main.cpp25
3 files changed, 17 insertions, 26 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index 0acd7303..fb24117d 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -384,20 +384,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]
+ 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
- char *tmp;
- int tmpN = 0;
- QApplication *A = new QApplication(tmpN, &tmp);
+ 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)
sset.setValue("DesktopVersion", LDesktopUtils::LuminaDesktopVersion());
}
- delete A;
+ qDebug() << "Finished with user files check";
+ //delete A;
+ return changed;
}
void LSession::refreshWindowManager(){
diff --git a/src-qt5/core/lumina-desktop/LSession.h b/src-qt5/core/lumina-desktop/LSession.h
index 43cddac7..a25f3c15 100644
--- a/src-qt5/core/lumina-desktop/LSession.h
+++ b/src-qt5/core/lumina-desktop/LSession.h
@@ -52,7 +52,7 @@ public:
LSession(int &argc, char **argv);
~LSession();
- static void checkUserFiles();
+ static bool checkUserFiles();
//Functions to be called during startup
void setupSession();
diff --git a/src-qt5/core/lumina-desktop/main.cpp b/src-qt5/core/lumina-desktop/main.cpp
index c272f263..826d697c 100644
--- a/src-qt5/core/lumina-desktop/main.cpp
+++ b/src-qt5/core/lumina-desktop/main.cpp
@@ -76,36 +76,21 @@ int main(int argc, char ** argv)
setenv("QT_QPA_PLATFORMTHEME", "lthemeengine", 1);
unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); //causes pixel-specific scaling issues with the desktop - turn this on after-the-fact for other apps
//Startup the session
- LSession::checkUserFiles(); //make sure to create any config files before creating the QApplication
LSession a(argc, argv);
if(!a.isPrimaryProcess()){ return 0; }
+ //Ensure that the user's config files exist
+ /*if( LSession::checkUserFiles() ){ //make sure to create any config files before creating the QApplication
+ qDebug() << "User files changed - restarting the desktop session";
+ return 787; //return special restart code
+ }*/
//Setup the log file
- /* logfile.setFileName( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-desktop/logs/runtime.log" );
- qDebug() << "Lumina Log File:" << logfile.fileName();
- if(QFile::exists(logfile.fileName()+".old")){ QFile::remove(logfile.fileName()+".old"); }
- if(logfile.exists()){ QFile::rename(logfile.fileName(), logfile.fileName()+".old"); }
- //Make sure the parent directory exists
- if(!QFile::exists(QDir::homePath()+"/.lumina/logs")){
- QDir dir;
- dir.mkpath(QDir::homePath()+"/.lumina/logs");
- }
- logfile.open(QIODevice::WriteOnly | QIODevice::Append);*/
QTime *timer=0;
if(DEBUG){ timer = new QTime(); timer->start(); }
- //Setup Log File
- //qInstallMessageHandler(MessageOutput);
- //if(DEBUG){ qDebug() << "Theme Init:" << timer->elapsed(); }
- //LuminaThemeEngine theme(&a);
- //QObject::connect(&theme, SIGNAL(updateIcons()), &a, SLOT(reloadIconTheme()) );
- //if(DEBUG){ qDebug() << "Load Locale:" << timer->elapsed(); }
- //LUtils::LoadTranslation(&a, "lumina-desktop");
if(DEBUG){ qDebug() << "Session Setup:" << timer->elapsed(); }
a.setupSession();
- //theme.refresh();
if(DEBUG){ qDebug() << "Exec Time:" << timer->elapsed(); delete timer;}
int retCode = a.exec();
//qDebug() << "Stopping the window manager";
qDebug() << "Finished Closing Down Lumina";
- //logfile.close();
return retCode;
}
bgstack15