Make elf icon reading more robust

pull/16/head
Timothy Pearson 13 years ago
parent 06e60421cd
commit 0b0fc72987

@ -659,6 +659,11 @@ 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);

@ -206,6 +206,11 @@ TQString KURIFilterData::iconName()
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);

Loading…
Cancel
Save