From 9252a3ae449e3d19afbfbfa92ac99e6e5a9aadee Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@qt.io>
Date: Wed, 9 Nov 2016 14:25:30 +0100
Subject: [PATCH] CMake: Add fileoverlay icons for cmake project files

Change-Id: Id9b8aa9b1902e6f88ca4e8bde2e5f20281a77437
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
---
 .../cmakeprojectmanager/cmakeproject.qrc      |   2 ++
 .../cmakeprojectconstants.h                   |   3 ++
 .../cmakeprojectplugin.cpp                    |   7 +++-
 .../images/fileoverlay_cmake.png              | Bin 0 -> 419 bytes
 .../images/fileoverlay_cmake@2x.png           | Bin 0 -> 947 bytes
 src/tools/icons/qtcreatoricons.svg            |  33 ++++++++++++++++++
 6 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 src/plugins/cmakeprojectmanager/images/fileoverlay_cmake.png
 create mode 100644 src/plugins/cmakeprojectmanager/images/fileoverlay_cmake@2x.png

diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.qrc b/src/plugins/cmakeprojectmanager/cmakeproject.qrc
index 4b5080980a..6926b1d41d 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.qrc
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.qrc
@@ -1,5 +1,7 @@
 <RCC>
     <qresource prefix="/cmakeproject">
         <file>CMakeProjectManager.mimetypes.xml</file>
+        <file>images/fileoverlay_cmake.png</file>
+        <file>images/fileoverlay_cmake@2x.png</file>
     </qresource>
 </RCC>
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h
index 1f6c33411e..94abe1c1fd 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h
@@ -54,5 +54,8 @@ const char CMAKE_SETTINGSPAGE_ID[] = "Z.CMake";
 // Snippets
 const char CMAKE_SNIPPETS_GROUP_ID[] = "CMake";
 
+// Icons
+const char FILEOVERLAY_CMAKE[] = ":/cmakeproject/images/fileoverlay_cmake.png";
+
 } // namespace Constants
 } // namespace CMakeProjectManager
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp
index dba81e9c27..cffcc282a6 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp
@@ -37,9 +37,11 @@
 #include "cmaketoolmanager.h"
 #include "cmakekitinformation.h"
 
-#include <utils/mimetypes/mimedatabase.h>
+#include <coreplugin/fileiconprovider.h>
 #include <projectexplorer/kitmanager.h>
 
+#include <utils/mimetypes/mimedatabase.h>
+
 using namespace CMakeProjectManager::Internal;
 
 bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
@@ -47,6 +49,9 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
     Q_UNUSED(errorMessage)
     Utils::MimeDatabase::addMimeTypes(QLatin1String(":cmakeproject/CMakeProjectManager.mimetypes.xml"));
 
+    Core::FileIconProvider::registerIconOverlayForSuffix(Constants::FILEOVERLAY_CMAKE, "cmake");
+    Core::FileIconProvider::registerIconOverlayForFilename(Constants::FILEOVERLAY_CMAKE, "CMakeLists.txt");
+
     addAutoReleasedObject(new Internal::CMakeSnippetProvider);
     addAutoReleasedObject(new CMakeSettingsPage);
     addAutoReleasedObject(new CMakeManager);
diff --git a/src/plugins/cmakeprojectmanager/images/fileoverlay_cmake.png b/src/plugins/cmakeprojectmanager/images/fileoverlay_cmake.png
new file mode 100644
index 0000000000000000000000000000000000000000..95104870c26f2e32eaac7bac672d3e02407e91e4
GIT binary patch
literal 419
zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7vpiiKLo9mVUOcPa%qYYD
z;r-^DD<s_lEi(0&ifuhyq<D-~{1g9-=`t}-`3s7+Ot}^&<Kt|3;*#F&gQrhAUJ+7_
z`sj1(a++E7w~Bp!dbcx*zwQ0^tM=DkhW{%yROYJ8t<QZoWyztF?m<?nHzQ-Nha~JM
z|1NZw|DdvT!^>3+lb%hVekj6Xj*0Eu*jXuoGU}P@(wc70U6675dFVsm+e<p?_VXUd
zab@tVwwWj2=eC56!Q=Xt6DI>!7?#)DJ8fD%iSth5fz6?T8XQak=_{tL)DWn(<8GK4
z&p7Ga?cHx4+^oE{;xgx}J2A(7=bO%EY6wwDI&&=P@BMsTMh`BAG^X2}-TVHAX2#wV
zJG;)s>;4@bW`<DFMc1<#4g7-yPBA!#Uza@p>fy$>B?+CACS74{2)+K*uJYotU3@`o
zwSHG4%*>L$@*PjIOvu*UWwv!?tl^1OF`MQEMxVdv^ZxmZ<momWH|&e&`@pc_f5DAM
cG4+fNGuFr1IxIWOz`(%Z>FVdQ&MBb@0E?!)r~m)}

literal 0
HcmV?d00001

diff --git a/src/plugins/cmakeprojectmanager/images/fileoverlay_cmake@2x.png b/src/plugins/cmakeprojectmanager/images/fileoverlay_cmake@2x.png
new file mode 100644
index 0000000000000000000000000000000000000000..805db2fabd72a4222526da3c54171eaa8c1e5da9
GIT binary patch
literal 947
zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANOKRh}-6ArY-_r^V+4hsqqc
z|9)@XTItxt5=p(BoDEY`RaTtQEoA(!@;Eh6sgYf#ldJ2~vbK&+{XH`>d{oYy;GXc6
z@rHeSnc?Qf=|7#6TzoG0@I<Q>tG%ATHTzojb^Gt%o-@C_)XQS^BJRw-leHH2i}&yU
zZ2A1j9GQsAv#xDf_P^U@NvKQPrugiImP<XF*E3f!x?k&JjO|+VqW{#YqYMmujD7R-
z&xHS8|37Fht7VAChfYS96x$8*3-;fS|Nec!dNIKUW~HEwuNV%@c6j;X#hqy%KeA@4
zi0IG!{4<Nux}YMI(Par&#Z?nmSqY9S3`b6z8D72|ti5a{({Gn2FGHCb`WRIAt)BSn
zW&I>EhPzP{J^g$m55?u%CNSQM5@irv$!K*cGjKf*>+0gVkiumQf8_kPst8GK2zS{g
zBFkXGmT~W4K(fJ%OGVFWjwLcIVP@2|Fxa4LeazaGRbb-V1Me#C=zOel4*gkc_<7~g
zSqtyo^If)XIzzR~lARe0cjoUkDp9>6(JSShb>z~vqh(e?fz9IjW@)qCyO<P|tQ)8O
ztUPRHWE8z~kNva_5ua`^Jb2JcS!g5U`R)_N{yYqO*e_fcFL=Fc=O3-<;c-Q0o=7iS
zr~Pl9T)CdMlDCmIlfcBg2l@guV#~fprJU4F->mt}UH)2+Z0-Jc^RhOkeENOp@L^HS
z{rh<`m~P2)D|r7iJMh$QzxB*BI_Hi&-K1CZvGVYGSy|D|3{jPpTK2O&RYd-`a_<bS
zFs~O4+r(7en0xuM=W+kV#pmYi+^H({_TR3D({9K9%0G8`&bcq23Q|&z>@={9<h#Ns
z3v$U(>9?0s|9>lqV%V_vW9^pzPitStOWeL$RP-n1u1n1!zJx-nVE!uxJb#{_f9`kW
zV$Rt^_n4JFS$#No_v4Q?VRf~6fonV?E&heRX?uG7)1Ut#u2W<CVlOstH<w=f{M`<n
zW0!t)t$OsWB5%5x`FX~45m(7Nm4=QR4c-l}udLjE>mSG6&HiPzSv}Ip*V><&Wl0Ck
zJ-F;g_Wh-ALd#35&y{c6etdgb`F)l{2Oc^x>}p8f|94$@-OuLrFMoB<Uy+zx=BmF^
zHp=<gf%#u&+U_-;73#0en|}UY;g+qe4aKbtJdD!za<-RWU9{8oPL;cHuj%Q9Yo5#h
zt+{Er)pYCsALizb1&R#!nbsYb`}%N}?h}zY&;HekMkhY_QeT`<QEUBwD=2$1c)I$z
JtaD0e0swGU#aI9U

literal 0
HcmV?d00001

diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg
index ea755809a8..e6e5e59dcb 100644
--- a/src/tools/icons/qtcreatoricons.svg
+++ b/src/tools/icons/qtcreatoricons.svg
@@ -6764,6 +6764,39 @@
          inkscape:connector-curvature="0"
          sodipodi:nodetypes="ccccccc" />
     </g>
+    <g
+       id="src/plugins/cmakeprojectmanager/images/fileoverlay_cmake">
+      <rect
+         style="fill:none"
+         id="rect6843-2-6"
+         width="16"
+         height="16"
+         x="192"
+         y="520" />
+      <path
+         d="m 197,535 5,-9.5 5,9.5 z"
+         id="path5434"
+         inkscape:connector-curvature="0"
+         style="fill:#ffffff;fill-opacity:0.74901961;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:0.74901961" />
+      <path
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0"
+         id="path4544"
+         d="M 202.70313,533.34375 207,535 l -5,-9.5 z"
+         style="fill:#ce3434;fill-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0"
+         id="path4544-6"
+         d="M 202.46673,530.56042 202,525.5 197,535 Z"
+         style="fill:#4a4bd0;fill-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0"
+         id="path4544-6-2"
+         d="M 200.23323,532.37183 197,535 l 10,0 z"
+         style="fill:#0dbf0d;fill-opacity:1" />
+    </g>
     <g
        transform="translate(-48,32)"
        id="src/plugins/baremetal/images/baremetaldevice">
-- 
GitLab