diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-02 03:24:06 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-02 03:24:06 -0600 |
commit | 0b0fc72987436ffbce2ac96d8c163a063572897f (patch) | |
tree | 8e2e05986ca6fb5fc758c4d0c9869230e12e38ec /kio | |
parent | 06e60421cd41c4c17550d9e8ee7d52b611a99314 (diff) | |
download | tdelibs-0b0fc72987436ffbce2ac96d8c163a063572897f.tar.gz tdelibs-0b0fc72987436ffbce2ac96d8c163a063572897f.zip |
Make elf icon reading more robust
Diffstat (limited to 'kio')
-rw-r--r-- | kio/kio/kfileitem.cpp | 5 | ||||
-rw-r--r-- | kio/kio/kurifilter.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/kio/kio/kfileitem.cpp b/kio/kio/kfileitem.cpp index 38e3c0e3c..6207e66b9 100644 --- a/kio/kio/kfileitem.cpp +++ b/kio/kio/kfileitem.cpp @@ -660,6 +660,11 @@ TQPixmap KFileItem::pixmap( int _size, int _state ) const 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; diff --git a/kio/kio/kurifilter.cpp b/kio/kio/kurifilter.cpp index f16e0db7d..d0f6425ad 100644 --- a/kio/kio/kurifilter.cpp +++ b/kio/kio/kurifilter.cpp @@ -207,6 +207,11 @@ TQString KURIFilterData::iconName() 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; |