diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-09 19:26:47 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-09 19:26:47 -0400 |
commit | ecdb06405fe6ed3eb08c8968bac2ab7446dcabee (patch) | |
tree | 0dcd06cd9f4a494293a95c862a59092da2bff744 /src-qt5/core/libLumina/LuminaXDG.cpp | |
parent | Merge branch 'master' of github.com:pcbsd/lumina (diff) | |
download | lumina-ecdb06405fe6ed3eb08c8968bac2ab7446dcabee.tar.gz lumina-ecdb06405fe6ed3eb08c8968bac2ab7446dcabee.tar.bz2 lumina-ecdb06405fe6ed3eb08c8968bac2ab7446dcabee.zip |
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).
Diffstat (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp')
-rw-r--r-- | src-qt5/core/libLumina/LuminaXDG.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index 68cd84bc..f92d4fa1 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -866,10 +866,16 @@ QString LXDG::findDefaultAppForMime(QString mime){ for(int d=def+1; d<info.length(); d++){ //qDebug() << "Check Line:" << info[d]; if(info[d].startsWith("[")){ break; } //starting a new section now - finished with defaults - if(info[d].contains(mime+"=")){ + if(info[d].contains(mime+"=") ){ white << info[d].section("=",1,-1).split(";"); break; - } + }else if(info[d].contains("*") && info[d].contains("=") ){ + QRegExp rg(info[d].section("=",0,0), Qt::CaseSensitive, QRegExp::WildcardUnix); + if(rg.exactMatch(mime)){ + white << info[d].section("=",1,-1).split(";"); + break; + } + } } } // Now check for any white-listed files in this work dir |