//=========================================== // Lumina-DE source code // Copyright (c) 2013-2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #include "LuminaXDG.h" #include "LuminaOS.h" #include "LUtils.h" #include #include #include #include static QStringList mimeglobs; static qint64 mimechecktime; //============================= // XDGDesktop CLASS //============================= XDGDesktop::XDGDesktop(QString file, QObject *parent) : QObject(parent){ isHidden=false; useTerminal=false; startupNotify=false; useVGL = false; type = XDGDesktop::BAD; filePath = file; exec = tryexec = ""; // just to make sure this is initialized if(!filePath.isEmpty()){ sync(); } //if an input file is given - go ahead and sync now } void XDGDesktop::sync(){ //Reset internal vars isHidden=false; useTerminal=false; startupNotify=false; type = XDGDesktop::BAD; exec = tryexec = ""; //Read in the File if(!filePath.endsWith(".desktop")){ return; } lastRead = QDateTime::currentDateTime(); QStringList file = LUtils::readFile(filePath); if(file.isEmpty()){ return; } //done with init right here - nothing to load //Get the current localization code type = XDGDesktop::APP; //assume this initially if we read the file properly QString lang = QLocale::system().name(); //lang code QString slang = lang.section("_",0,0); //short lang code //Now start looping over the information XDGDesktopAction CDA; //current desktop action bool insection=false; bool inaction=false; for(int i=0; i