aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaXDG.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-11-10 15:07:30 -0500
committerKen Moore <moorekou@gmail.com>2015-11-10 15:07:30 -0500
commit65014339c12ecc10d6f0a2db1c887b0cb250f89c (patch)
tree2c44a1e5cf04a94b5b7020cfcac665ecc8682c89 /libLumina/LuminaXDG.cpp
parentTweak the font outlines a bit more for the desktop icons: (diff)
downloadlumina-65014339c12ecc10d6f0a2db1c887b0cb250f89c.tar.gz
lumina-65014339c12ecc10d6f0a2db1c887b0cb250f89c.tar.bz2
lumina-65014339c12ecc10d6f0a2db1c887b0cb250f89c.zip
Replace the libreoffice SVG icon skip with a generic rule that skips any SVG file which explicitly sets version 1.0 of the format. Only one other icon gets caught in this on my systems (ibus.svg), and that one always looked slightly off as well if I recall.
Diffstat (limited to 'libLumina/LuminaXDG.cpp')
-rw-r--r--libLumina/LuminaXDG.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/libLumina/LuminaXDG.cpp b/libLumina/LuminaXDG.cpp
index 7003c976..b3905aa9 100644
--- a/libLumina/LuminaXDG.cpp
+++ b/libLumina/LuminaXDG.cpp
@@ -615,16 +615,23 @@ QIcon LXDG::findIcon(QString iconName, QString fallback){
for(int i=0; i<srch.length() && ico.isNull(); i++){
//Look for a svg first
if(QFile::exists(srch[i]+":"+iconName+".svg") ){
- //Temporary bypass for known bad icons (libreoffice only at the moment)
- if( !iconName.startsWith("libreoffice") ){
//Be careful about how an SVG is loaded - needs to render the image onto a paint device
QSvgRenderer svg;
if( svg.load(srch[i]+":"+iconName+".svg") ){
- ico.addFile(srch[i]+":"+iconName+".svg"); //could be loaded/parsed successfully
+ //Could be loaded - now check that it is version 1.1+ (Qt has issues with 1.0? (LibreOffice Icons) )
+ float version = 1.1; //only downgrade files that explicitly set the version as older
+ QString svginfo = LUtils::readFile(srch[i]+":"+iconName+".svg").join("\n").section("<svg",1,1).section(">",0,0);
+ svginfo.replace("\t"," "); svginfo.replace("\n"," ");
+ if(svginfo.contains(" version=")){ version = svginfo.section(" version=\"",1,1).section("\"",0,0).toFloat(); }
+ if(version>=1.1){
+ ico.addFile(srch[i]+":"+iconName+".svg"); //could be loaded/parsed successfully
+ }else{
+ qDebug() << "Old SVG Version file:" << iconName+".svg Theme:" << srch[i];
+ //qDebug() << "SVGInfo:" << svginfo;
+ }
}else{
qDebug() << "Found bad SVG file:" << iconName+".svg Theme:" << srch[i];
}
- }
}
if(QFile::exists(srch[i]+":"+iconName+".png")){
//simple PNG image - load directly into the QIcon structure
bgstack15