summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-02 03:36:55 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-02 03:36:55 -0600
commit84aea07a73ee724007513c157912385518f3dd7a (patch)
tree88c1cd31ddecbb7b7dcee75b4a7c83283e283bb2
parent0b0fc72987436ffbce2ac96d8c163a063572897f (diff)
downloadtdelibs-84aea07a.tar.gz
tdelibs-84aea07a.zip
Another attempt at prior commit
-rw-r--r--kio/kio/kfileitem.cpp19
-rw-r--r--kio/kio/kurifilter.cpp19
2 files changed, 16 insertions, 22 deletions
diff --git a/kio/kio/kfileitem.cpp b/kio/kio/kfileitem.cpp
index 6207e66b9..40927f0cf 100644
--- a/kio/kio/kfileitem.cpp
+++ b/kio/kio/kfileitem.cpp
@@ -658,17 +658,6 @@ TQPixmap KFileItem::pixmap( int _size, int _state ) const
icon_size = _size;
icon = libr_icon_geticon_bysize(handle, icon_size);
- if(icon == NULL)
- {
- // Try loading the first icon as fallback
- icon = libr_icon_geticon_byid(handle, 0);
- }
- if(icon == NULL)
- {
- kdWarning() << "failed to obtain ELF icon: " << libr_errmsg() << endl;
- libr_close(handle);
- return p;
- }
// See if the embedded icon name matches any icon file names already on the system
// If it does, use the system icon instead of the embedded one
@@ -678,10 +667,18 @@ TQPixmap KFileItem::pixmap( int _size, int _state ) const
if(!get_iconlist(handle, &icons))
{
// Failed to obtain a list of ELF icons
+ kdWarning() << "failed to obtain ELF icon: " << libr_errmsg() << endl;
+ libr_close(handle);
+ return p;
}
else {
while((entry = get_nexticon(&icons, entry)) != NULL)
{
+ if(icon == NULL)
+ {
+ // Try loading this icon as fallback
+ icon = libr_icon_geticon_byname(handle, entry->name);
+ }
if (KGlobal::iconLoader()->iconPath(entry->name, 0, true) != "") {
iconresnamefound = 1;
p = DesktopIcon( entry->name, _size, _state );
diff --git a/kio/kio/kurifilter.cpp b/kio/kio/kurifilter.cpp
index d0f6425ad..102d83166 100644
--- a/kio/kio/kurifilter.cpp
+++ b/kio/kio/kurifilter.cpp
@@ -205,17 +205,6 @@ TQString KURIFilterData::iconName()
if (libr_can_continue == 1) {
icon_size = 32; // FIXME: Is this a reasonable size request for all possible usages of kurifilter?
icon = libr_icon_geticon_bysize(handle, icon_size);
- if(icon == NULL)
- {
- // Try loading the first icon as fallback
- icon = libr_icon_geticon_byid(handle, 0);
- }
- if(icon == NULL)
- {
- kdWarning() << "failed to obtain ELF icon: " << libr_errmsg() << endl;
- libr_close(handle);
- libr_can_continue = 0;
- }
if (libr_can_continue == 1) {
// See if the embedded icon name matches any icon file names already on the system
@@ -226,10 +215,18 @@ TQString KURIFilterData::iconName()
if(!get_iconlist(handle, &icons))
{
// Failed to obtain a list of ELF icons
+ kdWarning() << "failed to obtain ELF icon: " << libr_errmsg() << endl;
+ libr_close(handle);
+ libr_can_continue = 0;
}
else {
while((entry = get_nexticon(&icons, entry)) != NULL)
{
+ if(icon == NULL)
+ {
+ // Try loading this icon as fallback
+ icon = libr_icon_geticon_byname(handle, entry->name);
+ }
if (KGlobal::iconLoader()->iconPath(entry->name, 0, true) != "") {
iconresnamefound = 1;
m_strIconName = entry->name;