aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/main.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/main.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/main.cpp b/src-qt5/core/lumina-desktop-unified/main.cpp
new file mode 100644
index 00000000..f8be977d
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/main.cpp
@@ -0,0 +1,46 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2012-2017, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+
+#include "global-includes.h"
+#include "LSession.h"
+
+#define DEBUG 0
+
+int main(int argc, char ** argv)
+{
+ if (argc > 1) {
+ if (QString(argv[1]) == QString("--version")){
+ qDebug() << LDesktopUtils::LuminaDesktopVersion();
+ return 0;
+ }
+ }
+ if(!QFile::exists(LOS::LuminaShare())){
+ qDebug() << "Lumina does not appear to be installed correctly. Cannot find: " << LOS::LuminaShare();
+ return 1;
+ }
+ //Setup any pre-QApplication initialization values
+ LTHEME::LoadCustomEnvSettings();
+ LXDG::setEnvironmentVars();
+ setenv("DESKTOP_SESSION","Lumina",1);
+ setenv("XDG_CURRENT_DESKTOP","Lumina",1);
+ unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default...
+ //Startup the session
+ LSession a(argc, argv);
+ if(!a.isPrimaryProcess()){ return 0; }
+ QTime *timer=0;
+ if(DEBUG){ timer = new QTime(); timer->start(); }
+ if(DEBUG){ qDebug() << "Theme Init:" << timer->elapsed(); }
+ LuminaThemeEngine theme(&a);
+ QObject::connect(&theme, SIGNAL(updateIcons()), &a, SLOT(reloadIconTheme()) );
+ 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() << "Finished Closing Down Lumina";
+ return retCode;
+}
bgstack15