File xdgdata-pixmap.diff of Package kdelibs3
--- kdecore/kiconloader.cpp
+++ kdecore/kiconloader.cpp
@@ -260,6 +260,10 @@
QStringList dirs;
dirs += d->mpDirs->resourceDirs("icon");
dirs += d->mpDirs->resourceDirs("pixmap");
+ dirs += d->mpDirs->resourceDirs("xdgdata-icon");
+ dirs += "/usr/share/pixmaps";
+ // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
+ dirs += d->mpDirs->resourceDirs("xdgdata-pixmap");
for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
d->mpDirs->addResourceDir("appicon", *it);
--- kdecore/kiconloader.cpp.orig
+++ kdecore/kiconloader.cpp.orig
@@ -260,6 +260,8 @@
QStringList dirs;
dirs += d->mpDirs->resourceDirs("icon");
dirs += d->mpDirs->resourceDirs("pixmap");
+ dirs += d->mpDirs->resourceDirs("xdgdata-icon");
+ dirs += "/usr/share/pixmaps";
for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
d->mpDirs->addResourceDir("appicon", *it);
@@ -733,8 +735,10 @@
// Try "User" icon too. Some apps expect this.
if (!name.isEmpty())
pix = loadIcon(name, KIcon::User, size, state, path_store, true);
- if (!pix.isNull() || canReturnNull)
+ if (!pix.isNull() || canReturnNull) {
+ QPixmapCache::insert(key, pix);
return pix;
+ }
icon = findMatchingIcon(str_unknown, size);
if (!icon.isValid())
--- kdecore/kicontheme.cpp
+++ kdecore/kicontheme.cpp
@@ -106,6 +106,10 @@
// Find the theme description file. These are always global.
icnlibs = KGlobal::dirs()->resourceDirs("icon");
+ icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-icon");
+ icnlibs += "/usr/share/pixmaps";
+ // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
+ icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-pixmap");
for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
{
cDir = *it + name + "/";
@@ -455,6 +459,10 @@
_theme_list = new QStringList();
QStringList icnlibs = KGlobal::dirs()->resourceDirs("icon");
+ icnlibs += (KGlobal::dirs()->resourceDirs("xdgdata-icon"));
+ icnlibs += "/usr/share/pixmaps";
+ // These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
+ icnlibs += KGlobal::dirs()->resourceDirs("xdgdata-pixmap");
QStringList::ConstIterator it;
for (it=icnlibs.begin(); it!=icnlibs.end(); ++it)
{
--- kdecore/kstandarddirs.cpp
+++ kdecore/kstandarddirs.cpp
@@ -100,6 +100,7 @@
"wallpaper", "lib", "pixmap", "templates",
"module", "qtplugins",
"xdgdata-apps", "xdgdata-dirs", "xdgconf-menu",
+ "xdgdata-icon", "xdgdata-pixmap",
"kcfg", "emoticons", "xdgconf-autostart", 0 };
static int tokenize( QStringList& token, const QString& str,
@@ -440,7 +441,7 @@
}
#ifndef NDEBUG
- if(false && type != "locale")
+ if(false && strcmp(type, "locale"))
kdDebug() << "KStdDirs::findResDir(): can't find \"" << filename << "\" in type \"" << type << "\"." << endl;
#endif
@@ -689,7 +690,7 @@
/* If the path contains symlinks, get the real name */
if (realpath( QFile::encodeName(dirname).data(), realpath_buffer) != 0) {
- // succes, use result from realpath
+ // success, use result from realpath
int len = strlen(realpath_buffer);
realpath_buffer[len] = '/';
realpath_buffer[len+1] = 0;
@@ -707,7 +708,7 @@
/* If the path contains symlinks, get the real name */
if (realpath( QFile::encodeName(filename).data(), realpath_buffer) != 0) {
- // succes, use result from realpath
+ // success, use result from realpath
return QFile::decodeName(realpath_buffer);
}
@@ -1058,6 +1059,10 @@
return "lib" KDELIBSUFF "/kde3/plugins";
if (!strcmp(type, "xdgdata-apps"))
return "applications/";
+ if (!strcmp(type, "xdgdata-icon"))
+ return "icons/";
+ if (!strcmp(type, "xdgdata-pixmap"))
+ return "pixmaps/";
if (!strcmp(type, "xdgdata-dirs"))
return "desktop-directories/";
if (!strcmp(type, "xdgconf-menu"))