diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-14 12:57:59 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-14 12:57:59 -0600 |
commit | f07158cd9dcb61b32e7dba5674e8ed0f7c8c6fe2 (patch) | |
tree | 57df7f3e690c3c20855bd03849b65ae13dbd5486 /libkonq/tdefileivi.cc | |
parent | f943ed4a5828c3dafbc987602115cfdf3c53ddcc (diff) | |
download | tdebase-f07158cd9dcb61b32e7dba5674e8ed0f7c8c6fe2.tar.gz tdebase-f07158cd9dcb61b32e7dba5674e8ed0f7c8c6fe2.zip |
Fix large file previews that were broken in GIT hash 3e7ad37f
Diffstat (limited to 'libkonq/tdefileivi.cc')
-rw-r--r-- | libkonq/tdefileivi.cc | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/libkonq/tdefileivi.cc b/libkonq/tdefileivi.cc index 08bd240ba..2e23cfbf7 100644 --- a/libkonq/tdefileivi.cc +++ b/libkonq/tdefileivi.cc @@ -570,10 +570,42 @@ void KFileIVI::updatePixmapSize() KonqIconViewWidget* view = static_cast<KonqIconViewWidget*>( iconView() ); - TQSize pixSize = TQSize( size, size ); - if ( pixSize != pixmapSize() ) { - setPixmapSize( pixSize ); + bool mimeDetermined = false; + if ( m_fileitem->isMimeTypeKnown() ) { + mimeDetermined = true; } + + if (mimeDetermined) { + bool changed = false; + if ( view && view->canPreview( item() ) ) { + int previewSize = view->previewIconSize( size ); + if (previewSize != size) { + setPixmapSize( TQSize( previewSize, previewSize ) ); + changed = true; + } + } + else { + TQSize pixSize = TQSize( size, size ); + if ( pixSize != pixmapSize() ) { + setPixmapSize( pixSize ); + changed = true; + } + } + if (changed) { + view->adjustItems(); + } + } + else { + TQSize pixSize = TQSize( size, size ); + if ( pixSize != pixmapSize() ) { + setPixmapSize( pixSize ); + } + } +} + +void KFileIVI::mimeTypeAndIconDetermined() +{ + updatePixmapSize(); } /* vim: set noet sw=4 ts=8 softtabstop=4: */ |