aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/LuminaXDG.cpp
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2017-09-11 18:26:55 -0400
committerZackaryWelch <welch.zackary@gmail.com>2017-09-11 18:26:55 -0400
commit3591a104eecb1258cd40c34fb76232e204a6d8b7 (patch)
tree7214ed1559d5b0a96ff94d3e9ceb7b58ecac0827 /src-qt5/core/libLumina/LuminaXDG.cpp
parentSet default tooltip to be translateable in case issues arise (diff)
downloadlumina-3591a104eecb1258cd40c34fb76232e204a6d8b7.tar.gz
lumina-3591a104eecb1258cd40c34fb76232e204a6d8b7.tar.bz2
lumina-3591a104eecb1258cd40c34fb76232e204a6d8b7.zip
Added video file detection and correct desktop file translation
Diffstat (limited to 'src-qt5/core/libLumina/LuminaXDG.cpp')
-rw-r--r--src-qt5/core/libLumina/LuminaXDG.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp
index c1e7e199..ab1000ab 100644
--- a/src-qt5/core/libLumina/LuminaXDG.cpp
+++ b/src-qt5/core/libLumina/LuminaXDG.cpp
@@ -75,9 +75,9 @@ void XDGDesktop::sync(){
//-------------------
if(var=="Name"){
if(insection){
- if(name.isEmpty() && loc.isEmpty()){ name = val; }
- else if(name.isEmpty() && loc==slang){ name = val; } //short locale code
- else if(loc == lang){ name = val; }
+ if(loc==slang){ name = val;} //short locale code
+ else if(loc==lang){ name = val;}
+ else if(name.isEmpty() && loc.isEmpty()){ /*qDebug() << "Empty" << val;*/ name = val; }
}else if(inaction){
if(CDA.name.isEmpty() && loc.isEmpty()){ CDA.name = val; }
else if(CDA.name.isEmpty() && loc==slang){ CDA.name = val; } //short locale code
@@ -704,7 +704,14 @@ XDGDesktop* LFileInfo::XDG(){
return desk;
}
-// -- Check if this is a readable image file (for thumbnail support)
+// -- Check if this is a readable video file (for thumbnail support)
+bool LFileInfo::isVideo(){
+ if(!mime.startsWith("video/")){ return false; }
+ //Check the hardcoded list of known supported video formats to see if the thumbnail can be generated
+ return ( !LUtils::videoExtensions().filter(this->suffix().toLower()).isEmpty() );
+}
+
+// -- Check if this is a readable image file
bool LFileInfo::isImage(){
if(!mime.startsWith("image/")){ return false; } //quick return for non-image files
//Check the Qt subsystems to see if this image file can be read
bgstack15