[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasma-framework] /: Fix svg iconPath resolving in IconItem
From: Weng Xuetian <wengxt () gmail ! com>
Date: 2016-02-29 21:05:53
Message-ID: E1aaV0r-00020n-VE () scm ! kde ! org
[Download RAW message or body]
Git commit 066cf0a0d7b46c60fccb945dbc0e9f858c4d6967 by Weng Xuetian.
Committed on 29/02/2016 at 21:05.
Pushed by xuetianweng into branch 'master'.
Fix svg iconPath resolving in IconItem
This fixes iconPath is not correctly set when its size changes.
REVIEW: 127201
C +0 -0 autotests/data/bug359388/hicolor/22x22/apps/bug359388.svg [from: \
autotests/data/icons/hicolor/22x22/apps/bug359388.svg - 100% similarity] R +0 -0 \
autotests/data/icons/test-theme/apps/22/tst-plasma-framework-test-icon.svg [from: \
autotests/data/icons/hicolor/22x22/apps/bug359388.svg - 100% similarity] A +763 -0 \
autotests/data/icons/test-theme/apps/32/tst-plasma-framework-test-icon.svg A +317 \
-0 autotests/data/icons/test-theme/apps/48/konversation.svg A +39 -0 \
autotests/data/icons/test-theme/index.theme M +54 -5 autotests/iconitemtest.cpp
M +7 -0 autotests/iconitemtest.h
M +4 -4 src/declarativeimports/core/iconitem.cpp
http://commits.kde.org/plasma-framework/066cf0a0d7b46c60fccb945dbc0e9f858c4d6967
diff --git a/autotests/data/icons/hicolor/22x22/apps/bug359388.svg \
b/autotests/data/bug359388/hicolor/22x22/apps/bug359388.svg similarity index 100%
copy from autotests/data/icons/hicolor/22x22/apps/bug359388.svg
copy to autotests/data/bug359388/hicolor/22x22/apps/bug359388.svg
diff --git a/autotests/data/icons/hicolor/22x22/apps/bug359388.svg \
b/autotests/data/icons/test-theme/apps/22/tst-plasma-framework-test-icon.svg \
similarity index 100% rename from \
autotests/data/icons/hicolor/22x22/apps/bug359388.svg rename to \
autotests/data/icons/test-theme/apps/22/tst-plasma-framework-test-icon.svg
diff --git a/autotests/data/icons/test-theme/apps/32/tst-plasma-framework-test-icon.svg \
b/autotests/data/icons/test-theme/apps/32/tst-plasma-framework-test-icon.svg new file \
mode 100644 index 0000000..940d46d
--- /dev/null
+++ b/autotests/data/icons/test-theme/apps/32/tst-plasma-framework-test-icon.svg
@@ -0,0 +1,763 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="32"
+ height="32"
+ id="svg5453"
+ version="1.1"
+ inkscape:version="0.91+devel r"
+ sodipodi:docname="preferences-desktop-plasma.svg">
+ <defs
+ id="defs5455">
+ <linearGradient
+ id="linearGradient4219"
+ inkscape:collect="always">
+ <stop
+ id="stop4221"
+ offset="0"
+ style="stop-color:#c3ced7;stop-opacity:1" />
+ <stop
+ id="stop4223"
+ offset="1"
+ style="stop-color:#e2f4f4;stop-opacity:1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4219"
+ id="linearGradient5010"
+ x1="400.57144"
+ y1="536.79797"
+ x2="400.57144"
+ y2="522.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4227-9"
+ id="linearGradient5093"
+ x1="9.0000114"
+ y1="7"
+ x2="23"
+ y2="21"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(384.57143,515.798)" />
+ <linearGradient
+ id="linearGradient4227-9"
+ inkscape:collect="always">
+ <stop
+ id="stop4229-5"
+ offset="0"
+ style="stop-color:#292c2f;stop-opacity:1" />
+ <stop
+ id="stop4231-6"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4591"
+ id="linearGradient4971"
+ x1="400.57144"
+ y1="545.79797"
+ x2="400.57144"
+ y2="517.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4591">
+ <stop
+ style="stop-color:#7e8f9e;stop-opacity:1"
+ offset="0"
+ id="stop4593" />
+ <stop
+ style="stop-color:#84ced5;stop-opacity:1"
+ offset="1"
+ id="stop4595" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4834-8"
+ id="linearGradient5082"
+ x1="403.57144"
+ y1="531.79797"
+ x2="413.57144"
+ y2="531.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4834-8">
+ <stop
+ style="stop-color:#89ad8b;stop-opacity:1"
+ offset="0"
+ id="stop4836" />
+ <stop
+ style="stop-color:#82b3c7;stop-opacity:1"
+ offset="1"
+ id="stop4838-3" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4754"
+ id="linearGradient5108"
+ x1="29"
+ y1="7"
+ x2="32"
+ y2="10"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4754">
+ <stop
+ style="stop-color:#768fac;stop-opacity:1"
+ offset="0"
+ id="stop4756" />
+ <stop
+ style="stop-color:#9fabc4;stop-opacity:1"
+ offset="1"
+ id="stop4758" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4762"
+ id="linearGradient5106"
+ x1="30.000011"
+ y1="4"
+ x2="32.000011"
+ y2="2"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4762">
+ <stop
+ style="stop-color:#7d95ae;stop-opacity:1"
+ offset="0"
+ id="stop4764" />
+ <stop
+ style="stop-color:#8ba3ba;stop-opacity:1"
+ offset="1"
+ id="stop4766" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4770"
+ id="linearGradient5090"
+ x1="409.57144"
+ y1="520.79797"
+ x2="413.57147"
+ y2="524.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4770">
+ <stop
+ style="stop-color:#5c7b9e;stop-opacity:1"
+ offset="0"
+ id="stop4772" />
+ <stop
+ style="stop-color:#839dc0;stop-opacity:1"
+ offset="1"
+ id="stop4774" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4810-4"
+ id="linearGradient5039"
+ x1="19"
+ y1="5"
+ x2="9"
+ y2="5"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4810-4">
+ <stop
+ style="stop-color:#7fbcc6;stop-opacity:1"
+ offset="0"
+ id="stop4812" />
+ <stop
+ style="stop-color:#8ee4e3;stop-opacity:1"
+ offset="1"
+ id="stop4814" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4802-1"
+ id="linearGradient5041"
+ x1="393.57144"
+ y1="522.79797"
+ x2="403.57144"
+ y2="522.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4802-1">
+ <stop
+ style="stop-color:#75d5c7;stop-opacity:1"
+ offset="0"
+ id="stop4804" />
+ <stop
+ style="stop-color:#66afb9;stop-opacity:1"
+ offset="1"
+ id="stop4806-3" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4794"
+ id="linearGradient4979"
+ x1="1.1650391e-05"
+ y1="4"
+ x2="9.0000114"
+ y2="4"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4794">
+ <stop
+ style="stop-color:#d1e6b7;stop-opacity:1"
+ offset="0"
+ id="stop4796" />
+ <stop
+ style="stop-color:#ade8e1;stop-opacity:1"
+ offset="1"
+ id="stop4798-2" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4786"
+ id="linearGradient5007"
+ x1="9.0000114"
+ y1="12"
+ x2="3.0000114"
+ y2="6"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4786">
+ <stop
+ style="stop-color:#99c487;stop-opacity:1"
+ offset="0"
+ id="stop4788" />
+ <stop
+ style="stop-color:#b4d99e;stop-opacity:1"
+ offset="1"
+ id="stop4790" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4778"
+ id="linearGradient5015"
+ x1="0"
+ y1="22"
+ x2="9"
+ y2="16"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4778">
+ <stop
+ style="stop-color:#e1b16f;stop-opacity:1"
+ offset="0"
+ id="stop4780" />
+ <stop
+ style="stop-color:#99bf83;stop-opacity:1"
+ offset="1"
+ id="stop4782" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4667"
+ id="linearGradient5031"
+ x1="1.1650391e-05"
+ y1="25"
+ x2="9.0000114"
+ y2="25"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4667">
+ <stop
+ style="stop-color:#f2a686;stop-opacity:1"
+ offset="0"
+ id="stop4669" />
+ <stop
+ style="stop-color:#f1a67c;stop-opacity:1"
+ offset="1"
+ id="stop4671" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4675"
+ id="linearGradient5023"
+ x1="4"
+ y1="27"
+ x2="9.0000114"
+ y2="19"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4675">
+ <stop
+ style="stop-color:#e4a56d;stop-opacity:1"
+ offset="0"
+ id="stop4677" />
+ <stop
+ style="stop-color:#a7bd78;stop-opacity:1"
+ offset="1"
+ id="stop4679" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4683"
+ id="linearGradient5058"
+ x1="393.57144"
+ y1="538.79797"
+ x2="403.57144"
+ y2="538.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4683">
+ <stop
+ style="stop-color:#c3a278;stop-opacity:1"
+ offset="0"
+ id="stop4685" />
+ <stop
+ style="stop-color:#6688aa;stop-opacity:1"
+ offset="1"
+ id="stop4687" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4699"
+ id="linearGradient5074"
+ x1="19"
+ y1="25"
+ x2="29"
+ y2="25"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4699">
+ <stop
+ style="stop-color:#7c8f9d;stop-opacity:1"
+ offset="0"
+ id="stop4701" />
+ <stop
+ style="stop-color:#7690ac;stop-opacity:1"
+ offset="1"
+ id="stop4703" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4722"
+ id="linearGradient5124"
+ x1="406.57144"
+ y1="540.79797"
+ x2="413.57141"
+ y2="533.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4722">
+ <stop
+ style="stop-color:#6588af;stop-opacity:1"
+ offset="0"
+ id="stop4724" />
+ <stop
+ style="stop-color:#8ba8cd;stop-opacity:1"
+ offset="1"
+ id="stop4726" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4730-0"
+ id="linearGradient5132"
+ x1="29"
+ y1="23"
+ x2="32.000011"
+ y2="23"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4730-0">
+ <stop
+ style="stop-color:#7ea0c5;stop-opacity:1"
+ offset="0"
+ id="stop4732" />
+ <stop
+ style="stop-color:#a1b1cd;stop-opacity:1"
+ offset="1"
+ id="stop4734" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4746"
+ id="linearGradient5116"
+ x1="29"
+ y1="18"
+ x2="32.000011"
+ y2="14.999988"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4746">
+ <stop
+ style="stop-color:#91a2c6;stop-opacity:1"
+ offset="0"
+ id="stop4748" />
+ <stop
+ style="stop-color:#b9b2c5;stop-opacity:1"
+ offset="1"
+ id="stop4750" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4818"
+ id="linearGradient5098"
+ x1="19"
+ y1="4"
+ x2="29"
+ y2="4"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4818">
+ <stop
+ style="stop-color:#84d5d7;stop-opacity:1"
+ offset="0"
+ id="stop4820" />
+ <stop
+ style="stop-color:#84a8ba;stop-opacity:1"
+ offset="1"
+ id="stop4822-2" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4691"
+ id="linearGradient5066"
+ x1="19"
+ y1="25"
+ x2="9"
+ y2="25"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4691">
+ <stop
+ style="stop-color:#748898;stop-opacity:1"
+ offset="0"
+ id="stop4693" />
+ <stop
+ style="stop-color:#e09c6d;stop-opacity:1"
+ offset="1"
+ id="stop4695" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4738"
+ id="linearGradient5140"
+ x1="31"
+ y1="29.999973"
+ x2="31"
+ y2="28"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4738">
+ <stop
+ style="stop-color:#889bba;stop-opacity:1"
+ offset="0"
+ id="stop4740" />
+ <stop
+ style="stop-color:#98a6c3;stop-opacity:1"
+ offset="1"
+ id="stop4742" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="14.950779"
+ inkscape:cy="15.256011"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:window-width="1366"
+ inkscape:window-height="670"
+ inkscape:window-x="-4"
+ inkscape:window-y="29"
+ inkscape:window-maximized="1"
+ inkscape:showpageshadow="false"
+ borderlayer="true"
+ showguides="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4063" />
+ <sodipodi:guide
+ position="1.1650391e-05,32.000026"
+ orientation="32,0"
+ id="guide4157" />
+ <sodipodi:guide
+ position="1.1650391e-05,2.6367188e-05"
+ orientation="0,32"
+ id="guide4159" />
+ <sodipodi:guide
+ position="32.000012,2.6367188e-05"
+ orientation="-32,0"
+ id="guide4161" />
+ <sodipodi:guide
+ position="32.000012,32.000026"
+ orientation="0,-32"
+ id="guide4163" />
+ <sodipodi:guide
+ position="2.0000117,30.000026"
+ orientation="28,0"
+ id="guide4167" />
+ <sodipodi:guide
+ position="34,2.0000264"
+ orientation="0,28"
+ id="guide4169" />
+ <sodipodi:guide
+ position="30.000012,2.0000264"
+ orientation="-28,0"
+ id="guide4171" />
+ <sodipodi:guide
+ position="30.000012,30.000026"
+ orientation="0,-28"
+ id="guide4173" />
+ <sodipodi:guide
+ position="2.0000117,30.000026"
+ orientation="28,0"
+ id="guide4181" />
+ <sodipodi:guide
+ position="2.0000117,2.0000264"
+ orientation="0,14"
+ id="guide4183" />
+ <sodipodi:guide
+ position="16.000012,2.0000264"
+ orientation="-28,0"
+ id="guide4185" />
+ <sodipodi:guide
+ position="16.000012,30.000026"
+ orientation="0,-14"
+ id="guide4187" />
+ <sodipodi:guide
+ position="9.0000117,23.000026"
+ orientation="14,0"
+ id="guide4193" />
+ <sodipodi:guide
+ position="22,11"
+ orientation="0,14.000031"
+ id="guide4195" />
+ <sodipodi:guide
+ position="23.000042,9.0000264"
+ orientation="-14,0"
+ id="guide4197" />
+ <sodipodi:guide
+ position="21,25"
+ orientation="0,-14.000031"
+ id="guide4199" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata5458">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-384.57143,-515.798)">
+ <g
+ transform="translate(-5.8251953e-6,1.3183594e-5)"
+ id="g5142">
+ <rect
+ y="517.79797"
+ x="384.57144"
+ height="28"
+ width="32"
+ id="rect4963"
+ style="fill:url(#linearGradient4971);fill-opacity:1;stroke:none" />
+ <path
+ style="fill:url(#linearGradient5082);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + \
d="m 403.57144,538.798 9.99999,-7 -9.99999,-7 z" + id="path4829"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4905"
+ d="M 29,2 29,16 32,13.900391 32,4.0996094 29,2 Z"
+ style="fill:url(#linearGradient5108);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4907"
+ d="M 29,2 32,4.0996094 32,2 29,2 Z"
+ style="fill:url(#linearGradient5106);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + \
style="fill:url(#linearGradient5090);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 413.57143,531.798 -9.99999,-7 9.99999,-7 z"
+ id="path4833"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4843"
+ d="M 9,2 19,9 19,2 9,2 Z"
+ style="fill:url(#linearGradient5039);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ id="path4841"
+ d="m 393.57144,531.798 9.99999,-7 -9.99999,-7 z"
+ style="fill:url(#linearGradient5041);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4863"
+ d="M 0,2 0,8.3007812 9,2 0,2 Z"
+ style="fill:url(#linearGradient4979);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4861"
+ d="M 9,2 0,8.3007812 0,9.6992188 9,16 9,2 Z"
+ style="fill:url(#linearGradient5007);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4857"
+ d="M 0,9.6992188 0,22.300781 9,16 0,9.6992188 Z"
+ style="fill:url(#linearGradient5015);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4865"
+ d="M 0,23.699219 0,30 9,30 0,23.699219 Z"
+ style="fill:url(#linearGradient5031);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4859"
+ d="M 9,16 0,22.300781 0,23.699219 9,30 9,16 Z"
+ style="fill:url(#linearGradient5023);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + \
style="fill:url(#linearGradient5058);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 393.57144,545.798 9.99999,-7 -9.99999,-7 z"
+ id="path4839"
+ inkscape:connector-curvature="0" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4837"
+ d="m 19,23 0,7 10,0 -10,-7 z"
+ style="fill:url(#linearGradient5074);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ id="path4831"
+ d="m 413.57143,545.798 -9.99999,-7 9.99999,-7 z"
+ style="fill:url(#linearGradient5124);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4903"
+ d="m 29,16 0,14 3,-2.099609 0,-9.800782 L 29,16 Z"
+ style="fill:url(#linearGradient5132);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4891"
+ d="M 32,13.900391 29,16 l 3,2.099609 0,-4.199218 z"
+ style="fill:url(#linearGradient5116);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4835"
+ d="M 19,2 19,9 29,2 19,2 Z"
+ style="fill:url(#linearGradient5098);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4845"
+ d="m 19,23 -10,7 10,0 0,-7 z"
+ style="fill:url(#linearGradient5066);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ <path + inkscape:connector-curvature="0"
+ transform="translate(384.57143,515.798)"
+ id="path4909"
+ d="M 32,27.900391 29,30 l 3,0 0,-2.099609 z"
+ style="fill:url(#linearGradient5140);fill-opacity:1;fill-rule:evenodd;stroke \
:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> \
+ </g> + <flowRoot
+ xml:space="preserve"
+ id="flowRoot4170"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:n \
ormal;font-size:10px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, \
Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-a \
nchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="translate(389.57143,520.79802)"><flowRegion
+ id="flowRegion4172"><rect
+ id="rect4174"
+ width="27"
+ height="15"
+ x="22"
+ y="3" /></flowRegion><flowPara
+ id="flowPara4176">Plasm</flowPara></flowRoot> <g
+ id="g4480">
+ <path
+ id="path5074"
+ d="m 396.57143,522.89761 0,1.5 7.2168,7.18359 -1.2168,1.2168 13,13 1,0 \
0,-1.49219 0,-2.49023 0,-5.01758 -9,-9 -2.5332,2.5332 -7.4668,-7.43359 -1,0 z m \
-2,5.40039 0,2.19922 4,3.97461 0,2.32617 9,9 5.59961,0 -17.59961,-17.5 -1,0 z" + \
style="opacity:0.2;fill:url(#linearGradient5093);fill-opacity:1;fill-rule:evenodd;stro \
ke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" \
+ inkscape:connector-curvature="0" /> + <path
+ inkscape:connector-curvature="0"
+ id="path4783"
+ d="m 397.07143,522.798 c -0.48475,0 -0.875,0.39025 -0.875,0.875 0,0.48475 \
0.39025,0.875 0.875,0.875 0.48475,0 0.875,-0.39025 0.875,-0.875 0,-0.48475 \
-0.39025,-0.875 -0.875,-0.875 z m 5.5,0 -2,2 3,3 -3,3 2,2 3,-3 2,-2 -2,-2 -3,-3 z m \
-7.6875,5.25 c -0.72712,0 -1.3125,0.58537 -1.3125,1.3125 0,0.72712 0.58538,1.3125 \
1.3125,1.3125 0.72713,0 1.3125,-0.58538 1.3125,-1.3125 0,-0.72713 -0.58537,-1.3125 \
-1.3125,-1.3125 z m 3.9375,5.25 c -0.9695,0 -1.75,0.7805 -1.75,1.75 0,0.9695 \
0.7805,1.75 1.75,1.75 0.9695,0 1.75,-0.7805 1.75,-1.75 0,-0.9695 -0.7805,-1.75 \
-1.75,-1.75 z" + \
style="opacity:1;fill:url(#linearGradient5010);fill-opacity:1.0;stroke:none" /> + \
</g> + <g
+ id="g4783"
+ transform="translate(0,-6.3278198e-5)">
+ <rect
+ y="541.7981"
+ x="384.57144"
+ height="3.9999676"
+ width="31.999952"
+ id="rect4267"
+ style="opacity:1;fill:#ffffff;fill-opacity:0.78431373;stroke:none" />
+ <circle
+ r="1"
+ cy="543.79797"
+ cx="414.57144"
+ id="path4166"
+ style="opacity:1;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-opacity:1" \
/> + <path
+ id="rect4183"
+ transform="translate(384.57143,515.798)"
+ d="m 2,27 0,1 1,0 0,-1 -1,0 z m 1,1 0,1 1,0 0,-1 -1,0 z"
+ style="opacity:1;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+</svg>
diff --git a/autotests/data/icons/test-theme/apps/48/konversation.svg \
b/autotests/data/icons/test-theme/apps/48/konversation.svg new file mode 100644
index 0000000..68027b8
--- /dev/null
+++ b/autotests/data/icons/test-theme/apps/48/konversation.svg
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg5453"
+ version="1.1"
+ inkscape:version="0.91+devel r"
+ sodipodi:docname="konversation.svg"
+ inkscape:export-filename="/home/phil/Projects/KDE/Konversation/new/Render/konversation \
48x48.png" + inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ viewBox="0 0 48 48">
+ <defs
+ id="defs5455">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4984">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.28627452"
+ offset="0"
+ id="stop4986" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1"
+ id="stop4988" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4207"
+ osb:paint="gradient">
+ <stop
+ style="stop-color:#3498db;stop-opacity:1;"
+ offset="0"
+ id="stop3371" />
+ <stop
+ style="stop-color:#3498db;stop-opacity:0;"
+ offset="1"
+ id="stop3373" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4290"
+ id="linearGradient4961"
+ x1="34"
+ y1="34"
+ x2="34"
+ y2="4"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4984"
+ id="linearGradient4990"
+ x1="405.57144"
+ y1="509.798"
+ x2="427.57144"
+ y2="533.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4984"
+ id="linearGradient6136"
+ x1="412.57144"
+ y1="514.79797"
+ x2="425.57144"
+ y2="527.79797"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4143">
+ <stop
+ style="stop-color:#197cf1;stop-opacity:1"
+ offset="0"
+ id="stop4145" />
+ <stop
+ style="stop-color:#20bcfa;stop-opacity:1"
+ offset="1"
+ id="stop4147" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4214">
+ <stop
+ style="stop-color:#2f74c8;stop-opacity:1"
+ offset="0"
+ id="stop4216" />
+ <stop
+ style="stop-color:#4699d7;stop-opacity:1"
+ offset="1"
+ id="stop4218" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="matrix(-1,0,0,1,432.57143,499.798)"
+ inkscape:collect="always"
+ xlink:href="#linearGradient4214"
+ id="linearGradient4416"
+ x1="26"
+ y1="43.999973"
+ x2="26"
+ y2="4"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4143"
+ id="linearGradient4149"
+ x1="400.57144"
+ y1="545.79797"
+ x2="400.57144"
+ y2="517.79797"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.92857108,0,0,0.92857057,28.612354,37.986142)" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4290">
+ <stop
+ style="stop-color:#7cbaf8;stop-opacity:1"
+ offset="0"
+ id="stop4292" />
+ <stop
+ style="stop-color:#f4fcff;stop-opacity:1"
+ offset="1"
+ id="stop4294" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4290"
+ id="linearGradient3077"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.3793103,0,0,1.3793103,1.2413794,1005.6035)"
+ x1="16"
+ y1="29.999973"
+ x2="16"
+ y2="2" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4143"
+ id="linearGradient3083"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.2807877,0,0,1.280787,-450.11598,346.31133)"
+ x1="400.57144"
+ y1="545.79797"
+ x2="400.57144"
+ y2="517.79797" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4290"
+ id="linearGradient3870"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.3793103,0,0,1.3793103,-18.758621,1005.6035)"
+ x1="16"
+ y1="29.999973"
+ x2="16"
+ y2="2" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="9.5134105"
+ inkscape:cx="-12.575111"
+ inkscape:cy="27.618757"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:window-width="2560"
+ inkscape:window-height="964"
+ inkscape:window-x="-4"
+ inkscape:window-y="34"
+ inkscape:window-maximized="1"
+ inkscape:showpageshadow="false"
+ borderlayer="true"
+ showguides="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-nodes="true"
+ inkscape:snap-others="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4063" />
+ <sodipodi:guide
+ position="1.1650391e-05,47.999996"
+ orientation="4,0"
+ id="guide4146" />
+ <sodipodi:guide
+ position="1.1650391e-05,43.999996"
+ orientation="0,48"
+ id="guide4148" />
+ <sodipodi:guide
+ position="48.000012,43.999996"
+ orientation="-4,0"
+ id="guide4150" />
+ <sodipodi:guide
+ position="48.000012,47.999996"
+ orientation="0,-48"
+ id="guide4152" />
+ <sodipodi:guide
+ position="1.1650391e-05,4.0000264"
+ orientation="4,0"
+ id="guide4154" />
+ <sodipodi:guide
+ position="1.1650391e-05,2.6367188e-05"
+ orientation="0,48"
+ id="guide4156" />
+ <sodipodi:guide
+ position="48.000012,2.6367188e-05"
+ orientation="-4,0"
+ id="guide4158" />
+ <sodipodi:guide
+ position="48.000012,4.0000264"
+ orientation="0,-48"
+ id="guide4160" />
+ <sodipodi:guide
+ position="48.000012,48.000026"
+ orientation="0,-4"
+ id="guide4162" />
+ <sodipodi:guide
+ position="44.000012,48.000026"
+ orientation="48,0"
+ id="guide4164" />
+ <sodipodi:guide
+ position="44.000012,2.6367188e-05"
+ orientation="0,4"
+ id="guide4166" />
+ <sodipodi:guide
+ position="48.000012,2.6367188e-05"
+ orientation="-48,0"
+ id="guide4168" />
+ <sodipodi:guide
+ position="4.0000422,48.000026"
+ orientation="0,-4"
+ id="guide4170" />
+ <sodipodi:guide
+ position="4.2167969e-05,48.000026"
+ orientation="48,0"
+ id="guide4172" />
+ <sodipodi:guide
+ position="4.2167969e-05,2.6367188e-05"
+ orientation="0,4"
+ id="guide4174" />
+ <sodipodi:guide
+ position="4,7"
+ orientation="-48,0"
+ id="guide4176" />
+ <sodipodi:guide
+ position="4.0000422,43.999996"
+ orientation="29.999969,0"
+ id="guide4437" />
+ <sodipodi:guide
+ position="4.0000422,14.000026"
+ orientation="0,39.999969"
+ id="guide4439" />
+ <sodipodi:guide
+ position="44.000012,14.000026"
+ orientation="-29.999969,0"
+ id="guide4441" />
+ <sodipodi:guide
+ position="44.000012,43.999996"
+ orientation="0,-39.999969"
+ id="guide4443" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata5458">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-384.57143,-499.798)">
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:url(#linearGradient4416);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 428.57143,503.798 v 30 h -20 l -11,10 v -10 h -9 v -30 z"
+ id="path4445-0" />
+ <path
+ style="opacity:0.2;fill:url(#linearGradient4990);fill-opacity:1;fill-rule:even \
odd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 402.57143,534.798 -6,-6 v -3 l -3,-3 v -9 h 4 l 1,1 v -1 l 20,-6 \
10,7.46136 V 533.798 h -26 z" + id="path4982"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccc" />
+ <path
+ style="fill:url(#linearGradient6136);fill-opacity:1;fill-rule:evenodd;stroke:n \
one;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.2"
+ d="m 419.57143,521.798 9,9 v -11 l -5,-5 h -4 z"
+ id="path6128"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:url(#linearGradient4961);fill-opacity:1;fill-rule:evenodd;stroke:none"
+ d="M 34 8 L 14 14 L 14 23 L 34 29 L 34 23 L 34 14 L 34 8 z M 9 14 L 9 23 L \
13 23 L 13 14 L 9 14 z M 35 15 L 35 22 L 39 22 L 39 15 L 35 15 z M 12 24 L 12 29 L 15 \
29 L 15 24 L 12 24 z " + transform="translate(384.57143,499.798)"
+ id="rect3794" />
+ </g>
+</svg>
diff --git a/autotests/data/icons/test-theme/index.theme \
b/autotests/data/icons/test-theme/index.theme new file mode 100644
index 0000000..52a7275
--- /dev/null
+++ b/autotests/data/icons/test-theme/index.theme
@@ -0,0 +1,39 @@
+[Icon Theme]
+Name=Unittest Theme
+
+DisplayDepth=32
+
+Inherits=breeze
+
+DesktopDefault=48
+DesktopSizes=16,22,32,48,64,128,256
+ToolbarDefault=22
+ToolbarSizes=16,22,32,48
+MainToolbarDefault=22
+MainToolbarSizes=16,22,32,48
+SmallDefault=16
+SmallSizes=16,22,32,48
+PanelDefault=32
+PanelSizes=16,22,32,48,64,128,256
+DialogDefault=32
+DialogSizes=16,22,32,48,64,128,256
+
+########## Directories
+########## ordered by category and alphabetically
+
+Directories=apps/22,apps/32
+
+[apps/22]
+Size=22
+Context=Applications
+Type=Fixed
+
+[apps/32]
+Size=32
+Context=Applications
+Type=Fixed
+
+[apps/48]
+Size=48
+Context=Applications
+Type=Fixed
diff --git a/autotests/iconitemtest.cpp b/autotests/iconitemtest.cpp
index ea98c9d..9b36670 100644
--- a/autotests/iconitemtest.cpp
+++ b/autotests/iconitemtest.cpp
@@ -46,6 +46,26 @@ static bool imageIsEmpty(const QImage &img)
void IconItemTest::initTestCase()
{
+ // make our theme in search path
+ qputenv("XDG_DATA_DIRS",
+ qgetenv("XDG_DATA_DIRS") + ":" + QFINDTESTDATA("data").toLocal8Bit());
+
+ // set default icon theme to test-theme
+ QStandardPaths::setTestModeEnabled(true);
+
+ QString configPath = \
QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); +
+ if(!QDir(configPath).mkpath(QStringLiteral("."))) {
+ qFatal("Failed to create test configuration directory.");
+ }
+
+ QFile::remove(configPath);
+
+ KConfigGroup cg(KSharedConfig::openConfig(), "Icons");
+ cg.writeEntry("Theme", "test-theme");
+ KConfigGroup plasmaConfig(KSharedConfig::openConfig("plasmarc"), "Theme");
+ plasmaConfig.writeEntry("name", "default");
+
m_view = new QQuickView();
m_view->setSource(QUrl::fromLocalFile(QFINDTESTDATA("data/view.qml")));
m_view->show();
@@ -88,6 +108,11 @@ QImage IconItemTest::grabImage(QQuickItem *item)
return grab->image();
}
+Plasma::Svg *IconItemTest::findPlasmaSvg(QQuickItem *item)
+{
+ return item->findChild<Plasma::Svg *>();
+}
+
// ------ Tests
void IconItemTest::invalidIcon()
{
@@ -106,7 +131,7 @@ void IconItemTest::invalidIcon()
void IconItemTest::usesPlasmaTheme()
{
Plasma::Theme theme;
- if (!theme.themeName().startsWith("breeze")) {
+ if (!theme.themeName().startsWith("default")) {
QSKIP("Current Plasma theme is not Breeze.");
}
@@ -132,7 +157,7 @@ void IconItemTest::usesPlasmaTheme()
img1 = grabImage(item2);
// This depends on konversation icon being different in Plasma Breeze theme
- // and normal Breeze icon theme
+ // and our test icon theme
QVERIFY(img1 != img2);
}
@@ -191,23 +216,47 @@ void IconItemTest::bug_359388()
{
QString name("bug359388");
KIconLoader iconLoader("tst_plasma-framework");
+ QIcon customThemeIcon(new KIconEngine(name, &iconLoader));
if (iconLoader.hasIcon(name)) {
QSKIP("Current icon theme has 'bug359388' icon.");
}
- iconLoader.addAppDir("tst_plasma-framework", QFINDTESTDATA("data/icons"));
- QIcon customThemeIcon(new KIconEngine(name, &iconLoader));
+ iconLoader.addAppDir("tst_plasma-framework", QFINDTESTDATA("data/bug359388"));
QQuickItem *item1 = createIconItem();
item1->setProperty("source", customThemeIcon);
QVERIFY(item1->property("valid").toBool());
QQuickItem *item2 = createIconItem();
- item2->setProperty("source", \
QIcon(QFINDTESTDATA("data/icons/hicolor/22x22/apps/" + name + ".svg"))); + \
item2->setProperty("source", QIcon(QFINDTESTDATA("data/bug359388/hicolor/22x22/apps/" \
+ name + ".svg"))); QVERIFY(item2->property("valid").toBool());
QCOMPARE(grabImage(item1), grabImage(item2));
}
+void IconItemTest::loadSvg()
+{
+ QString name("tst-plasma-framework-test-icon");
+
+ QQuickItem *item = createIconItem();
+ item->setProperty("animated", false);
+ item->setSize(QSize(22, 22));
+ item->setProperty("source", name);
+ QVERIFY(item->property("valid").toBool());
+
+ Plasma::Svg *svg;
+ svg = findPlasmaSvg(item);
+ Q_ASSERT(svg);
+ QCOMPARE(svg->imagePath(), QFINDTESTDATA("data/icons/test-theme/apps/22/" + name \
+ ".svg")); +
+ // we only have 32x32 and 22x22 version in the theme, thus 32x32 is a better \
match. + item->setSize(QSize(64, 64));
+ // just to update the icon
+ grabImage(item);
+ svg = findPlasmaSvg(item);
+ Q_ASSERT(svg);
+ QCOMPARE(svg->imagePath(), QFINDTESTDATA("data/icons/test-theme/apps/32/" + name \
+ ".svg")); +}
+
QTEST_MAIN(IconItemTest)
diff --git a/autotests/iconitemtest.h b/autotests/iconitemtest.h
index 9fd3063..b27680a 100644
--- a/autotests/iconitemtest.h
+++ b/autotests/iconitemtest.h
@@ -23,6 +23,11 @@
#include <QQuickView>
#include <QtTest/QtTest>
+namespace Plasma
+{
+class Svg;
+}
+
class IconItemTest : public QObject
{
Q_OBJECT
@@ -36,10 +41,12 @@ private Q_SLOTS:
void animation();
void animationAfterHide();
void bug_359388();
+ void loadSvg();
private:
QQuickItem *createIconItem();
QImage grabImage(QQuickItem *item);
+ Plasma::Svg *findPlasmaSvg(QQuickItem *item);
QQuickView *m_view;
};
diff --git a/src/declarativeimports/core/iconitem.cpp \
b/src/declarativeimports/core/iconitem.cpp index c65a9a7..9552847 100644
--- a/src/declarativeimports/core/iconitem.cpp
+++ b/src/declarativeimports/core/iconitem.cpp
@@ -134,9 +134,9 @@ void IconItem::setSource(const QVariant &source)
const auto *iconTheme = KIconLoader::global()->theme();
QString iconPath;
if (iconTheme) {
- iconTheme->iconPath(sourceString + QLatin1String(".svg"), \
qMin(width(), height()), KIconLoader::MatchBest); + iconPath = \
iconTheme->iconPath(sourceString + QLatin1String(".svg"), qMin(width(), height()), \
KIconLoader::MatchBest); if (iconPath.isEmpty()) {
- iconPath = iconTheme->iconPath(sourceString + \
QLatin1String(".svg"), qMin(width(), height()), KIconLoader::MatchBest); + \
iconPath = iconTheme->iconPath(sourceString + QLatin1String(".svgz"), qMin(width(), \
height()), KIconLoader::MatchBest); }
} else {
qWarning() << "KIconLoader has no theme set";
@@ -412,9 +412,9 @@ void IconItem::loadPixmap()
const auto *iconTheme = KIconLoader::global()->theme();
QString iconPath;
if (iconTheme) {
- QString iconPath = iconTheme->iconPath(source().toString() + \
QLatin1String(".svg"), qMin(width(), height()), KIconLoader::MatchBest); + \
iconPath = iconTheme->iconPath(source().toString() + QLatin1String(".svg"), \
qMin(width(), height()), KIconLoader::MatchBest); if (iconPath.isEmpty()) {
- iconPath = iconTheme->iconPath(source().toString() + \
QLatin1String(".svg"), qMin(width(), height()), KIconLoader::MatchBest); + \
iconPath = iconTheme->iconPath(source().toString() + QLatin1String(".svgz"), \
qMin(width(), height()), KIconLoader::MatchBest); }
} else {
qWarning() << "KIconLoader has no theme set";
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic