From ecdb06405fe6ed3eb08c8968bac2ab7446dcabee Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 9 Jun 2016 19:26:47 -0400 Subject: Add the ability to specify mimetype defaults within luminaDesktop.conf, and also allow regex wildard matching when looking for default applications ("text/*" will grab all text mimetypes for instance). --- src-qt5/core/libLumina/LuminaUtils.cpp | 35 ++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src-qt5/core/libLumina/LuminaUtils.cpp') diff --git a/src-qt5/core/libLumina/LuminaUtils.cpp b/src-qt5/core/libLumina/LuminaUtils.cpp index 28ef5ad3..c434febc 100644 --- a/src-qt5/core/libLumina/LuminaUtils.cpp +++ b/src-qt5/core/libLumina/LuminaUtils.cpp @@ -593,7 +593,7 @@ void LUtils::LoadSystemDefaults(bool skipOS){ } } //Now setup the default "desktopsettings.conf" and "sessionsettings.conf" files - QStringList deskset, sesset, lopenset; + QStringList deskset, sesset;//, lopenset; // -- SESSION SETTINGS -- QStringList tmp = sysDefaults.filter("session_"); @@ -619,7 +619,7 @@ void LUtils::LoadSystemDefaults(bool skipOS){ } //Parse/save the value - QString loset, sset; //temporary strings + QString sset; //temporary strings if(var=="session_enablenumlock"){ sset = "EnableNumlock="+ istrue; } else if(var=="session_playloginaudio"){ sset = "PlayStartupAudio="+istrue; } else if(var=="session_playlogoutaudio"){ sset = "PlayLogoutAudio="+istrue; } @@ -639,19 +639,42 @@ void LUtils::LoadSystemDefaults(bool skipOS){ //loset = "email="+val; } //Put the line into the file (overwriting any previous assignment as necessary) - if(!loset.isEmpty()){ + /*if(!loset.isEmpty()){ int index = lopenset.indexOf(QRegExp(loset.section("=",0,0)+"=*", Qt::CaseSensitive, QRegExp::Wildcard)); qDebug() << "loset line:" << loset << index << lopenset; if(index<0){ lopenset << loset; } //new line else{ lopenset[index] = loset; } //overwrite the other line - } + }*/ if(!sset.isEmpty()){ int index = sesset.indexOf(QRegExp(sset.section("=",0,0)+"=*", Qt::CaseSensitive, QRegExp::Wildcard)); if(index<0){ sesset << sset; } //new line else{ sesset[index] = sset; } //overwrite the other line } } - if(!lopenset.isEmpty()){ lopenset.prepend("[default]"); } //the session options exist within this set + //if(!lopenset.isEmpty()){ lopenset.prepend("[default]"); } //the session options exist within this set + + // -- MIMETYPE DEFAULTS -- + tmp = sysDefaults.filter("mime_default_"); + for(int i=0; i