summaryrefslogtreecommitdiffstats
path: root/libkonq
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-11-14 12:57:59 -0600
committerTimothy Pearson <[email protected]>2014-11-14 12:57:59 -0600
commitf07158cd9dcb61b32e7dba5674e8ed0f7c8c6fe2 (patch)
tree57df7f3e690c3c20855bd03849b65ae13dbd5486 /libkonq
parentf943ed4a5828c3dafbc987602115cfdf3c53ddcc (diff)
downloadtdebase-f07158cd9dcb61b32e7dba5674e8ed0f7c8c6fe2.tar.gz
tdebase-f07158cd9dcb61b32e7dba5674e8ed0f7c8c6fe2.zip
Fix large file previews that were broken in GIT hash 3e7ad37f
Diffstat (limited to 'libkonq')
-rw-r--r--libkonq/konq_iconviewwidget.cc12
-rw-r--r--libkonq/tdefileivi.cc38
-rw-r--r--libkonq/tdefileivi.h4
3 files changed, 46 insertions, 8 deletions
diff --git a/libkonq/konq_iconviewwidget.cc b/libkonq/konq_iconviewwidget.cc
index 8cb222659..96e04df29 100644
--- a/libkonq/konq_iconviewwidget.cc
+++ b/libkonq/konq_iconviewwidget.cc
@@ -709,14 +709,16 @@ void KonqIconViewWidget::setItemTextPos( ItemTextPos pos )
// can't call gridXValue() because this already would need the new itemTextPos()
int sz = m_size ? m_size : TDEGlobal::iconLoader()->currentSize( TDEIcon::Desktop );
- if ( m_bSetGridX )
- if ( pos == TQIconView::Bottom )
+ if ( m_bSetGridX ) {
+ if ( pos == TQIconView::Bottom ) {
setGridX( TQMAX( sz + 50, previewIconSize( sz ) + 13 ) );
+ }
else
{
setMaxItemWidth( TQMAX( sz, previewIconSize( sz ) ) + m_pSettings->iconTextWidth() );
setGridX( -1 );
}
+ }
TDEIconView::setItemTextPos( pos );
}
@@ -773,14 +775,16 @@ void KonqIconViewWidget::gridValues( int* x, int* y, int* dx, int* dy,
void KonqIconViewWidget::calculateGridX()
{
- if ( m_bSetGridX )
- if ( itemTextPos() == TQIconView::Bottom )
+ if ( m_bSetGridX ) {
+ if ( itemTextPos() == TQIconView::Bottom ) {
setGridX( gridXValue() );
+ }
else
{
setMaxItemWidth( gridXValue() );
setGridX( -1 );
}
+ }
}
int KonqIconViewWidget::gridXValue() const
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: */
diff --git a/libkonq/tdefileivi.h b/libkonq/tdefileivi.h
index 243688d43..4701fb9c1 100644
--- a/libkonq/tdefileivi.h
+++ b/libkonq/tdefileivi.h
@@ -208,6 +208,8 @@ public:
virtual int compare( TQIconViewItem *i ) const;
+ void mimeTypeAndIconDetermined();
+
protected:
virtual void dropped( TQDropEvent *e, const TQValueList<TQIconDragItem> & );
@@ -240,7 +242,7 @@ private:
/** Check if a thumbnail will be generated and calc the size of the icon */
void updatePixmapSize();
-
+
int m_size, m_state;
bool m_bDisabled;
bool m_bThumbnail;