<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>97776</bug_id>
          
          <creation_ts>2005-01-24 09:13:36 +0000</creation_ts>
          <short_desc>kde ignores icons folder in XDG_DATA_DIRS</short_desc>
          <delta_ts>2006-11-03 13:51:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kdelibs</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tobias Powalowski">tpowa</reporter>
          <assigned_to name="Stephan Kulow">coolo</assigned_to>
          <cc>l.lunak</cc>
    
    <cc>rdieter</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>30</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>306315</commentid>
    <comment_count>0</comment_count>
    <who name="Tobias Powalowski">tpowa</who>
    <bug_when>2005-01-24 09:13:36 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.3.91)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Linux

if you don&apos;t install kde to /usr and you set the XDG_DATA_DIRS variable to /usr kde doesn&apos;t recognize the icons folder and so some apps don&apos;t show the icon that is defined in the .desktop files
here is my XDG setup:
XDG_DATA_DIRS=&quot;/usr/share:/usr/share:/opt/gnome/share:/opt/kde/share&quot;

temporary workaround for that problem is to define an additional KDEDIR like that:
KDEDIR=&quot;/opt/kde&quot;
KDEDIRS=&quot;/opt/kde:/usr&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>372282</commentid>
    <comment_count>1</comment_count>
      <attachid>12524</attachid>
    <who name="Jan de Groot">jan</who>
    <bug_when>2005-09-11 13:39:48 +0000</bug_when>
    <thetext>Created attachment 12524
Adds icon lookup in XDG_DATA_DIRS

This patch looks a bit hacky, but kdecore seems to be hacky anyways (when I
started doing it the &quot;right&quot; way, I got so many compiler warnings that I had to
C&amp;P the compiler output in a text editor to find the error in it).

What this patch actually does is looking up icons in $KDEDIRS/icons and
$KDEDIRS/pixmaps as usual, and besides those standard dirs, it also looks at
$XDG_DATA_DIRS/icons and $XDG_DATA_DIRS/pixmaps.

According to the icon theme specifications at
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html,
looking in XDG_DATA_DIRS/icons and /usr/share/pixmaps is standard, but too many
applications store pixmaps in their own prefix, resulting in things like
/opt/gnome/share/pixmaps. GTK+ also looks for icons in XDG_DATA_DIRS/pixmaps,
so I do the same with KDE now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>446067</commentid>
    <comment_count>2</comment_count>
    <who name="Waldo Bastian">bastian</who>
    <bug_when>2006-06-12 20:06:45 +0000</bug_when>
    <thetext>Patch looks good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>462956</commentid>
    <comment_count>3</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-08-24 15:38:06 +0000</bug_when>
    <thetext>SVN commit 576641 by lunakl:

Read icons also from $XDG_DATA_DIRS, modified patch from #97776.
FEATURE: 97776



 M  +2 -0      kiconloader.cpp  
 M  +2 -2      kicontheme.cpp  
 M  +3 -0      kstandarddirs.cpp  


--- branches/KDE/3.5/kdelibs/kdecore/kiconloader.cpp #576640:576641
@@ -260,6 +260,8 @@
     QStringList dirs;
     dirs += d-&gt;mpDirs-&gt;resourceDirs(&quot;icon&quot;);
     dirs += d-&gt;mpDirs-&gt;resourceDirs(&quot;pixmap&quot;);
+    dirs += d-&gt;mpDirs-&gt;resourceDirs(&quot;xdgdata-icon&quot;);
+    dirs += &quot;/usr/share/pixmaps&quot;;
     for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
 	d-&gt;mpDirs-&gt;addResourceDir(&quot;appicon&quot;, *it);
 
--- branches/KDE/3.5/kdelibs/kdecore/kicontheme.cpp #576640:576641
@@ -105,7 +105,7 @@
     }
     // Find the theme description file. These are always global.
 
-    icnlibs = KGlobal::dirs()-&gt;resourceDirs(&quot;icon&quot;);
+    icnlibs = KGlobal::dirs()-&gt;resourceDirs(&quot;icon&quot;) + KGlobal::dirs()-&gt;resourceDirs(&quot;xdgdata-icon&quot;);
     for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
     {
         cDir = *it + name + &quot;/&quot;;
@@ -466,7 +466,7 @@
         return *_theme_list;
 
     _theme_list = new QStringList();
-    QStringList icnlibs = KGlobal::dirs()-&gt;resourceDirs(&quot;icon&quot;);
+    QStringList icnlibs = KGlobal::dirs()-&gt;resourceDirs(&quot;icon&quot;) + KGlobal::dirs()-&gt;resourceDirs(&quot;xdgdata-icon&quot;);
     QStringList::ConstIterator it;
     for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
     {
--- branches/KDE/3.5/kdelibs/kdecore/kstandarddirs.cpp #576640:576641
@@ -100,6 +100,7 @@
 			      &quot;wallpaper&quot;, &quot;lib&quot;, &quot;pixmap&quot;, &quot;templates&quot;,
 			      &quot;module&quot;, &quot;qtplugins&quot;,
 			      &quot;xdgdata-apps&quot;, &quot;xdgdata-dirs&quot;, &quot;xdgconf-menu&quot;,
+			      &quot;xdgdata-icon&quot;,
 			      &quot;kcfg&quot;, &quot;emoticons&quot;, 0 };
 
 static int tokenize( QStringList&amp; token, const QString&amp; str,
@@ -1055,6 +1056,8 @@
         return &quot;lib&quot; KDELIBSUFF &quot;/kde3/plugins&quot;;
     if (!strcmp(type, &quot;xdgdata-apps&quot;))
         return &quot;applications/&quot;;
+    if (!strcmp(type, &quot;xdgdata-icon&quot;))
+        return &quot;icons/&quot;;
     if (!strcmp(type, &quot;xdgdata-dirs&quot;))
         return &quot;desktop-directories/&quot;;
     if (!strcmp(type, &quot;xdgconf-menu&quot;))
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>483515</commentid>
    <comment_count>4</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-11-03 13:51:19 +0000</bug_when>
    <thetext>SVN commit 601485 by lunakl:

Add $XDG_DATA_DIRS/pixmaps to the icon lookup paths as well,
even though it&apos;s not in the spec. E.g. some GNOME apps put
their icons there :-/
CCBUG: 97776



 M  +2 -0      kiconloader.cpp  
 M  +4 -0      kicontheme.cpp  
 M  +3 -1      kstandarddirs.cpp  


--- branches/KDE/3.5/kdelibs/kdecore/kiconloader.cpp #601484:601485
@@ -246,6 +246,8 @@
     dirs += d-&gt;mpDirs-&gt;resourceDirs(&quot;pixmap&quot;);
     dirs += d-&gt;mpDirs-&gt;resourceDirs(&quot;xdgdata-icon&quot;);
     dirs += &quot;/usr/share/pixmaps&quot;;
+    // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
+    dirs += d-&gt;mpDirs-&gt;resourceDirs(&quot;xdgdata-pixmap&quot;);
     for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
 	d-&gt;mpDirs-&gt;addResourceDir(&quot;appicon&quot;, *it);
 
--- branches/KDE/3.5/kdelibs/kdecore/kicontheme.cpp #601484:601485
@@ -108,6 +108,8 @@
     icnlibs = KGlobal::dirs()-&gt;resourceDirs(&quot;icon&quot;);
     icnlibs += KGlobal::dirs()-&gt;resourceDirs(&quot;xdgdata-icon&quot;);
     icnlibs += &quot;/usr/share/pixmaps&quot;;
+    // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
+    icnlibs += KGlobal::dirs()-&gt;resourceDirs(&quot;xdgdata-pixmap&quot;);
     for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
     {
         cDir = *it + name + &quot;/&quot;;
@@ -471,6 +473,8 @@
     QStringList icnlibs = KGlobal::dirs()-&gt;resourceDirs(&quot;icon&quot;);
     icnlibs += (KGlobal::dirs()-&gt;resourceDirs(&quot;xdgdata-icon&quot;));
     icnlibs += &quot;/usr/share/pixmaps&quot;;
+    // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
+    icnlibs += KGlobal::dirs()-&gt;resourceDirs(&quot;xdgdata-pixmap&quot;);
     QStringList::ConstIterator it;
     for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
     {
--- branches/KDE/3.5/kdelibs/kdecore/kstandarddirs.cpp #601484:601485
@@ -100,7 +100,7 @@
 			      &quot;wallpaper&quot;, &quot;lib&quot;, &quot;pixmap&quot;, &quot;templates&quot;,
 			      &quot;module&quot;, &quot;qtplugins&quot;,
 			      &quot;xdgdata-apps&quot;, &quot;xdgdata-dirs&quot;, &quot;xdgconf-menu&quot;,
-			      &quot;xdgdata-icon&quot;,
+			      &quot;xdgdata-icon&quot;, &quot;xdgdata-pixmap&quot;,
 			      &quot;kcfg&quot;, &quot;emoticons&quot;, 0 };
 
 static int tokenize( QStringList&amp; token, const QString&amp; str,
@@ -1058,6 +1058,8 @@
         return &quot;applications/&quot;;
     if (!strcmp(type, &quot;xdgdata-icon&quot;))
         return &quot;icons/&quot;;
+    if (!strcmp(type, &quot;xdgdata-pixmap&quot;))
+        return &quot;pixmaps/&quot;;
     if (!strcmp(type, &quot;xdgdata-dirs&quot;))
         return &quot;desktop-directories/&quot;;
     if (!strcmp(type, &quot;xdgconf-menu&quot;))
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>12524</attachid>
            <date>2005-09-11 13:39:48 +0000</date>
            <delta_ts>2005-09-11 13:39:48 +0000</delta_ts>
            <desc>Adds icon lookup in XDG_DATA_DIRS</desc>
            <filename>xdg-icon-lookup.patch</filename>
            <type>text/plain</type>
            <size>1519</size>
            <attacher name="Jan de Groot">jan</attacher>
            
              <data encoding="base64">LS0tIGtkZWNvcmUva2ljb25sb2FkZXIuY3BwLm9sZAkyMDA1LTA5LTEwIDIwOjMyOjAyLjAwMDAw
MDAwMCArMDAwMAorKysga2RlY29yZS9raWNvbmxvYWRlci5jcHAJMjAwNS0wOS0xMCAyMDozNDoy
MS4wMDAwMDAwMDAgKzAwMDAKQEAgLTI2Myw2ICsyNjMsOCBAQAogICAgIFFTdHJpbmdMaXN0IGRp
cnM7CiAgICAgZGlycyArPSBkLT5tcERpcnMtPnJlc291cmNlRGlycygiaWNvbiIpOwogICAgIGRp
cnMgKz0gZC0+bXBEaXJzLT5yZXNvdXJjZURpcnMoInBpeG1hcCIpOworICAgIGRpcnMgKz0gZC0+
bXBEaXJzLT5yZXNvdXJjZURpcnMoInhkZ2RhdGEtaWNvbiIpOworICAgIGRpcnMgKz0gZC0+bXBE
aXJzLT5yZXNvdXJjZURpcnMoInhkZ2RhdGEtcGl4bWFwIik7CiAgICAgZm9yIChRU3RyaW5nTGlz
dDo6Q29uc3RJdGVyYXRvciBpdCA9IGRpcnMuYmVnaW4oKTsgaXQgIT0gZGlycy5lbmQoKTsgKytp
dCkKIAlkLT5tcERpcnMtPmFkZFJlc291cmNlRGlyKCJhcHBpY29uIiwgKml0KTsKIAotLS0ga2Rl
Y29yZS9rc3RhbmRhcmRkaXJzLmNwcC5vbGQJMjAwNS0wOS0xMCAyMDo0MjoxNi4wMDAwMDAwMDAg
KzAwMDAKKysrIGtkZWNvcmUva3N0YW5kYXJkZGlycy5jcHAJMjAwNS0wOS0xMCAyMDo0MjoyMS4w
MDAwMDAwMDAgKzAwMDAKQEAgLTk4LDggKzk4LDkgQEAKIAkJCSAgICAgICJkYXRhIiwgImxvY2Fs
ZSIsICJzZXJ2aWNlcyIsICJtaW1l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

          </attachment>
      

    </bug>

</bugzilla>