* Let classes that use DolphinView know about the currently used zoom level.
* Provide more zoom levels for all views (the settings dialogs have not been adjusted yet).
* Fixed issue that when using the wheel that the enabled state of the zoom actions has not been updated.
svn path=/trunk/KDE/kdebase/apps/; revision=842715
connect(this, SIGNAL(viewportEntered()),
controller, SLOT(emitViewportEntered()));
- connect(controller, SIGNAL(zoomIn()),
- this, SLOT(zoomIn()));
- connect(controller, SIGNAL(zoomOut()),
- this, SLOT(zoomOut()));
+ connect(controller, SIGNAL(zoomLevelChanged(int)),
+ this, SLOT(setZoomLevel(int)));
connect(controller, SIGNAL(activationChanged(bool)),
this, SLOT(updateColumnsBackground(bool)));
QAbstractItemView::wheelEvent(event);
}
-void DolphinColumnView::zoomIn()
+void DolphinColumnView::setZoomLevel(int level)
{
- if (isZoomInPossible()) {
- ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- switch (settings->iconSize()) {
- case KIconLoader::SizeSmall: settings->setIconSize(KIconLoader::SizeMedium); break;
- case KIconLoader::SizeMedium: settings->setIconSize(KIconLoader::SizeLarge); break;
- default: Q_ASSERT(false); break;
- }
- updateDecorationSize();
- }
-}
-
-void DolphinColumnView::zoomOut()
-{
- if (isZoomOutPossible()) {
- ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- switch (settings->iconSize()) {
- case KIconLoader::SizeLarge: settings->setIconSize(KIconLoader::SizeMedium); break;
- case KIconLoader::SizeMedium: settings->setIconSize(KIconLoader::SizeSmall); break;
- default: Q_ASSERT(false); break;
- }
- updateDecorationSize();
- }
+ const int size = DolphinController::iconSizeForZoomLevel(level);
+ ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
+ settings->setIconSize(size);
+
+ updateDecorationSize();
}
void DolphinColumnView::moveContentHorizontally(int x)
}
}
- m_controller->setZoomInPossible(isZoomInPossible());
- m_controller->setZoomOutPossible(isZoomOutPossible());
-
doItemsLayout();
}
}
}
-bool DolphinColumnView::isZoomInPossible() const
-{
- ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- return settings->iconSize() < KIconLoader::SizeLarge;
-}
-
-bool DolphinColumnView::isZoomOutPossible() const
-{
- ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
- return settings->iconSize() > KIconLoader::SizeSmall;
-}
-
void DolphinColumnView::setActiveColumnIndex(int index)
{
if (m_index == index) {
virtual void wheelEvent(QWheelEvent* event);
private slots:
- void zoomIn();
- void zoomOut();
+ void setZoomLevel(int level);
/**
* Moves the content of the columns view to represent
void slotShowPreviewChanged();
private:
- bool isZoomInPossible() const;
- bool isZoomOutPossible() const;
-
DolphinColumnWidget* activeColumn() const;
/**
DolphinController::DolphinController(DolphinView* dolphinView) :
QObject(dolphinView),
- m_zoomInPossible(false),
- m_zoomOutPossible(false),
+ m_zoomLevel(0),
m_openTab(false),
m_url(),
m_dolphinView(dolphinView),
m_itemView = view;
if (m_itemView != 0) {
+ switch (m_itemView->iconSize().height()) {
+ case KIconLoader::SizeSmallMedium: m_zoomLevel = 0; break;
+ case KIconLoader::SizeMedium: m_zoomLevel = 1; break;
+ case KIconLoader::SizeLarge: m_zoomLevel = 2; break;
+ case KIconLoader::SizeHuge: m_zoomLevel = 3; break;
+ case KIconLoader::SizeEnormous: m_zoomLevel = 4; break;
+ case KIconLoader::SizeEnormous * 3 / 2: m_zoomLevel = 5; break;
+ case KIconLoader::SizeEnormous * 2: m_zoomLevel = 6; break;
+ default: Q_ASSERT(false); m_zoomLevel = 2; break;
+ }
+
// TODO: this is a workaround until Qt-issue 176832 has been fixed
connect(m_itemView, SIGNAL(pressed(const QModelIndex&)),
this, SLOT(updateOpenTabState()));
emit activationChanged(active);
}
-void DolphinController::triggerZoomIn()
+void DolphinController::setZoomLevel(int level)
{
- emit zoomIn();
+ Q_ASSERT(level >= zoomLevelMinimum());
+ Q_ASSERT(level <= zoomLevelMaximum());
+ if (level != m_zoomLevel) {
+ m_zoomLevel = level;
+ emit zoomLevelChanged(m_zoomLevel);
+ }
}
-void DolphinController::triggerZoomOut()
+int DolphinController::iconSizeForZoomLevel(int level)
{
- emit zoomOut();
+ int size = KIconLoader::SizeMedium;
+ switch (level) {
+ case 0: size = KIconLoader::SizeSmallMedium; break;
+ case 1: size = KIconLoader::SizeMedium; break;
+ case 2: size = KIconLoader::SizeLarge; break;
+ case 3: size = KIconLoader::SizeHuge; break;
+ case 4: size = KIconLoader::SizeEnormous; break;
+ case 5: size = KIconLoader::SizeEnormous * 3 / 2; break;
+ case 6: size = KIconLoader::SizeEnormous * 2; break;
+ default: Q_ASSERT(false); break;
+ }
+ return size;
}
void DolphinController::handleKeyPressEvent(QKeyEvent* event)
* - indicateDroppedUrls()
* - indicateSortingChange()
* - indicateSortOrderChanged()
- * - setZoomInPossible()
- * - setZoomOutPossible()
* - triggerItem()
* - handleKeyPressEvent()
* - emitItemEntered()
* - setShowHiddenFiles()
* - setShowPreview()
* - indicateActivationChange()
- * - triggerZoomIn()
- * - triggerZoomOut()
+ * - setZoomLevel()
*/
class LIBDOLPHINPRIVATE_EXPORT DolphinController : public QObject
{
void indicateActivationChange(bool active);
/**
- * Tells the view implementation to zoom in by emitting the signal zoomIn()
- * and is invoked by the abstract Dolphin view.
+ * Sets the zoom level to \a level and emits the signal zoomLevelChanged().
+ * It must be assured that the used level is inside the range
+ * DolphinController::zoomLevelMinimum() and
+ * DolphinController::zoomLevelMaximum().
+ * Is invoked by the abstract Dolphin view.
*/
- void triggerZoomIn();
-
+ void setZoomLevel(int level);
+ int zoomLevel() const;
+
+ int zoomLevelMinimum() const;
+ int zoomLevelMaximum() const;
+
/**
- * Is invoked by the view implementation to indicate whether a zooming in
- * is possible. The abstract Dolphin view updates the corresponding menu
- * action depending on this state.
+ * Helper method for the view implementation to get
+ * the icon size for the zoom level \a level
+ * (see DolphinController::zoomLevel()).
*/
- void setZoomInPossible(bool possible);
- bool isZoomInPossible() const;
+ static int iconSizeForZoomLevel(int level);
/**
* Tells the view implementation to zoom out by emitting the signal zoomOut()
*/
void triggerZoomOut();
- /**
- * Is invoked by the view implementation to indicate whether a zooming out
- * is possible. The abstract Dolphin view updates the corresponding menu
- * action depending on this state.
- */
- void setZoomOutPossible(bool possible);
- bool isZoomOutPossible() const;
-
/**
* Should be invoked in each view implementation whenever a key has been
* pressed. If the selection model of \a view is not empty and
void viewportEntered();
/**
- * Is emitted if the view should zoom in. The view implementation
- * must connect to this signal if it supports zooming.
- */
- void zoomIn();
-
- /**
- * Is emitted if the view should zoom out. The view implementation
+ * Is emitted if the view should change the zoom to \a level. The view implementation
* must connect to this signal if it supports zooming.
*/
- void zoomOut();
+ void zoomLevelChanged(int level);
private slots:
void updateOpenTabState();
private:
- bool m_zoomInPossible;
- bool m_zoomOutPossible;
+ int m_zoomLevel;
bool m_openTab; // TODO: this is a workaround until Qt-issue 176832 has been fixed
KUrl m_url;
DolphinView* m_dolphinView;
return m_itemView;
}
-inline void DolphinController::setZoomInPossible(bool possible)
-{
- m_zoomInPossible = possible;
-}
-
-inline bool DolphinController::isZoomInPossible() const
+inline int DolphinController::zoomLevel() const
{
- return m_zoomInPossible;
+ return m_zoomLevel;
}
-inline void DolphinController::setZoomOutPossible(bool possible)
+inline int DolphinController::zoomLevelMinimum() const
{
- m_zoomOutPossible = possible;
+ return 0;
}
-inline bool DolphinController::isZoomOutPossible() const
+inline int DolphinController::zoomLevelMaximum() const
{
- return m_zoomOutPossible;
+ return 6;
}
#endif
this, SLOT(slotEntered(const QModelIndex&)));
connect(this, SIGNAL(viewportEntered()),
controller, SLOT(emitViewportEntered()));
- connect(controller, SIGNAL(zoomIn()),
- this, SLOT(zoomIn()));
- connect(controller, SIGNAL(zoomOut()),
- this, SLOT(zoomOut()));
+ connect(controller, SIGNAL(zoomLevelChanged(int)),
+ this, SLOT(setZoomLevel(int)));
connect(controller->dolphinView(), SIGNAL(additionalInfoChanged()),
this, SLOT(updateColumnVisibility()));
return QRect(topLeft, m_elasticBandDestination).normalized();
}
-void DolphinDetailsView::zoomIn()
+void DolphinDetailsView::setZoomLevel(int level)
{
- if (isZoomInPossible()) {
- DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- switch (settings->iconSize()) {
- case KIconLoader::SizeSmall: settings->setIconSize(KIconLoader::SizeMedium); break;
- case KIconLoader::SizeMedium: settings->setIconSize(KIconLoader::SizeLarge); break;
- default: Q_ASSERT(false); break;
- }
- updateDecorationSize();
- }
-}
-
-void DolphinDetailsView::zoomOut()
-{
- if (isZoomOutPossible()) {
- DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- switch (settings->iconSize()) {
- case KIconLoader::SizeLarge: settings->setIconSize(KIconLoader::SizeMedium); break;
- case KIconLoader::SizeMedium: settings->setIconSize(KIconLoader::SizeSmall); break;
- default: Q_ASSERT(false); break;
- }
- updateDecorationSize();
- }
+ const int size = DolphinController::iconSizeForZoomLevel(level);
+ DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
+ settings->setIconSize(size);
+
+ updateDecorationSize();
}
void DolphinDetailsView::configureColumns(const QPoint& pos)
}
}
-bool DolphinDetailsView::isZoomInPossible() const
-{
- DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- return settings->iconSize() < KIconLoader::SizeLarge;
-}
-
-bool DolphinDetailsView::isZoomOutPossible() const
-{
- DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
- return settings->iconSize() > KIconLoader::SizeSmall;
-}
-
void DolphinDetailsView::updateDecorationSize()
{
DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
setIconSize(QSize(iconSize, iconSize));
m_decorationSize = QSize(iconSize, iconSize);
- m_controller->setZoomInPossible(isZoomInPossible());
- m_controller->setZoomOutPossible(isZoomOutPossible());
-
if (m_selectionManager != 0) {
m_selectionManager->reset();
}
*/
QRect elasticBandRect() const;
- void zoomIn();
- void zoomOut();
+ void setZoomLevel(int level);
/**
* Opens a context menu at the position \a pos and allows to
void updateFont();
private:
- bool isZoomInPossible() const;
- bool isZoomOutPossible() const;
-
/**
* Updates the size of the decoration dependent on the
* icon size of the DetailsModeSettings. The controller
controller, SLOT(emitItemEntered(const QModelIndex&)));
connect(this, SIGNAL(viewportEntered()),
controller, SLOT(emitViewportEntered()));
- connect(controller, SIGNAL(zoomIn()),
- this, SLOT(zoomIn()));
- connect(controller, SIGNAL(zoomOut()),
- this, SLOT(zoomOut()));
+ connect(controller, SIGNAL(zoomLevelChanged(int)),
+ this, SLOT(setZoomLevel(int)));
const DolphinView* view = controller->dolphinView();
connect(view, SIGNAL(showPreviewChanged()),
updateGridSize(showPreview, view->additionalInfo().count());
}
-void DolphinIconsView::zoomIn()
+void DolphinIconsView::setZoomLevel(int level)
{
- if (isZoomInPossible()) {
- IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
-
- const int oldIconSize = settings->iconSize();
- int newIconSize = oldIconSize;
-
- const bool showPreview = m_controller->dolphinView()->showPreview();
- if (showPreview) {
- const int previewSize = increasedIconSize(settings->previewSize());
- settings->setPreviewSize(previewSize);
- } else {
- newIconSize = increasedIconSize(oldIconSize);
- settings->setIconSize(newIconSize);
- }
+ IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- // increase also the grid size
- const int diff = newIconSize - oldIconSize;
- settings->setItemWidth(settings->itemWidth() + diff);
- settings->setItemHeight(settings->itemHeight() + diff);
+ const int oldIconSize = settings->iconSize();
+ int newIconSize = oldIconSize;
- updateGridSize(showPreview, additionalInfoCount());
+ const bool showPreview = m_controller->dolphinView()->showPreview();
+ if (showPreview) {
+ const int previewSize = DolphinController::iconSizeForZoomLevel(level);
+ settings->setPreviewSize(previewSize);
+ } else {
+ newIconSize = DolphinController::iconSizeForZoomLevel(level);
+ settings->setIconSize(newIconSize);
}
-}
-void DolphinIconsView::zoomOut()
-{
- if (isZoomOutPossible()) {
- IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
-
- const int oldIconSize = settings->iconSize();
- int newIconSize = oldIconSize;
-
- const bool showPreview = m_controller->dolphinView()->showPreview();
- if (showPreview) {
- const int previewSize = decreasedIconSize(settings->previewSize());
- settings->setPreviewSize(previewSize);
- } else {
- newIconSize = decreasedIconSize(settings->iconSize());
- settings->setIconSize(newIconSize);
- }
+ // increase also the grid size
+ const int diff = newIconSize - oldIconSize;
+ settings->setItemWidth(settings->itemWidth() + diff);
+ settings->setItemHeight(settings->itemHeight() + diff);
- // decrease also the grid size
- const int diff = oldIconSize - newIconSize;
- settings->setItemWidth(settings->itemWidth() - diff);
- settings->setItemHeight(settings->itemHeight() - diff);
-
- updateGridSize(showPreview, additionalInfoCount());
- }
+ updateGridSize(showPreview, additionalInfoCount());
}
void DolphinIconsView::requestActivation()
}
}
-bool DolphinIconsView::isZoomInPossible() const
-{
- IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- const bool showPreview = m_controller->dolphinView()->showPreview();
- const int size = showPreview ? settings->previewSize() : settings->iconSize();
- return size < KIconLoader::SizeEnormous;
-}
-
-bool DolphinIconsView::isZoomOutPossible() const
-{
- IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- const bool showPreview = m_controller->dolphinView()->showPreview();
- const int size = showPreview ? settings->previewSize() : settings->iconSize();
- return size > KIconLoader::SizeSmall;
-}
-
-int DolphinIconsView::increasedIconSize(int size) const
-{
- int incSize = 0;
- switch (size) {
- case KIconLoader::SizeSmall: incSize = KIconLoader::SizeSmallMedium; break;
- case KIconLoader::SizeSmallMedium: incSize = KIconLoader::SizeMedium; break;
- case KIconLoader::SizeMedium: incSize = KIconLoader::SizeLarge; break;
- case KIconLoader::SizeLarge: incSize = KIconLoader::SizeHuge; break;
- case KIconLoader::SizeHuge: incSize = KIconLoader::SizeEnormous; break;
- default: Q_ASSERT(false); break;
- }
- return incSize;
-}
-
-int DolphinIconsView::decreasedIconSize(int size) const
-{
- int decSize = 0;
- switch (size) {
- case KIconLoader::SizeSmallMedium: decSize = KIconLoader::SizeSmall; break;
- case KIconLoader::SizeMedium: decSize = KIconLoader::SizeSmallMedium; break;
- case KIconLoader::SizeLarge: decSize = KIconLoader::SizeMedium; break;
- case KIconLoader::SizeHuge: decSize = KIconLoader::SizeLarge; break;
- case KIconLoader::SizeEnormous: decSize = KIconLoader::SizeHuge; break;
- default: Q_ASSERT(false); break;
- }
- return decSize;
-}
-
void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
{
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
const int spacing = settings->gridSpacing();
setGridSize(QSize(itemWidth + spacing * 2, itemHeight + spacing));
- m_controller->setZoomInPossible(isZoomInPossible());
- m_controller->setZoomOutPossible(isZoomOutPossible());
-
KFileItemDelegate* delegate = dynamic_cast<KFileItemDelegate*>(itemDelegate());
if (delegate != 0) {
delegate->setMaximumSize(m_itemSize);
private slots:
void slotShowPreviewChanged();
void slotAdditionalInfoChanged();
- void zoomIn();
- void zoomOut();
+ void setZoomLevel(int level);
void requestActivation();
void updateFont();
private:
- bool isZoomInPossible() const;
- bool isZoomOutPossible() const;
-
- /** Returns the increased icon size for the size \a size. */
- int increasedIconSize(int size) const;
-
- /** Returns the decreased icon size for the size \a size. */
- int decreasedIconSize(int size) const;
-
/**
* Updates the size of the grid depending on the state
* of \a showPreview and \a additionalInfoCount.
return QPoint(x, y);
}
-void DolphinView::zoomIn()
+void DolphinView::setZoomLevel(int level)
{
- m_controller->triggerZoomIn();
- m_iconManager->updatePreviews();
+ if (level < zoomLevelMinimum()) {
+ level = zoomLevelMinimum();
+ } else if (level > zoomLevelMaximum()) {
+ level = zoomLevelMaximum();
+ }
+
+ if (level != zoomLevel()) {
+ m_controller->setZoomLevel(level);
+ m_iconManager->updatePreviews();
+ emit zoomLevelChanged(level);
+ }
}
-void DolphinView::zoomOut()
+int DolphinView::zoomLevel() const
{
- m_controller->triggerZoomOut();
- m_iconManager->updatePreviews();
+ return m_controller->zoomLevel();
}
-bool DolphinView::isZoomInPossible() const
+int DolphinView::zoomLevelMinimum() const
{
- return m_controller->isZoomInPossible();
+ return m_controller->zoomLevelMinimum();
}
-bool DolphinView::isZoomOutPossible() const
+int DolphinView::zoomLevelMaximum() const
{
- return m_controller->isZoomOutPossible();
+ return m_controller->zoomLevelMaximum();
}
void DolphinView::setSorting(Sorting sorting)
{
if (event->modifiers() & Qt::ControlModifier) {
const int delta = event->delta();
- if ((delta > 0) && isZoomInPossible()) {
- zoomIn();
- } else if ((delta < 0) && isZoomOutPossible()) {
- zoomOut();
+ const int level = zoomLevel();
+ if (delta > 0) {
+ setZoomLevel(level + 1);
+ } else if (delta < 0) {
+ setZoomLevel(level - 1);
}
event->accept();
}
/** Returns the upper left position of the view content. */
QPoint contentsPosition() const;
- /** Increases the size of the current set view mode. */
- void zoomIn();
-
- /** Decreases the size of the current set view mode. */
- void zoomOut();
-
+ /**
+ * Sets the zoom level to \a level. It is assured that the used
+ * level is adjusted to be inside the range DolphinView::zoomLevelMinimum() and
+ * DolphinView::zoomLevelMaximum().
+ */
+ void setZoomLevel(int level);
+ int zoomLevel() const;
+
+ int zoomLevelMinimum() const;
+ int zoomLevelMaximum() const;
+
/**
* Returns true, if zooming in is possible. If false is returned,
* the minimal zoom size is possible.
/** Is emitted if the additional information shown for this view has been changed. */
void additionalInfoChanged();
+
+ /** Is emitted if the zoom level has been changed by zooming in or out. */
+ void zoomLevelChanged(int level);
/**
* Is emitted if information of an item is requested to be shown e. g. in the sidebar.
this, SLOT(slotShowHiddenFilesChanged()));
connect(view, SIGNAL(sortingChanged(DolphinView::Sorting)),
this, SLOT(slotSortingChanged(DolphinView::Sorting)));
+ connect(view, SIGNAL(zoomLevelChanged(int)),
+ this, SLOT(slotZoomLevelChanged(int)));
}
void DolphinViewActionHandler::createActions()
viewModeAction->setChecked(true);
}
- QAction* zoomInAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomIn));
- if (zoomInAction != 0) {
- zoomInAction->setEnabled(m_currentView->isZoomInPossible());
- }
-
- QAction* zoomOutAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomOut));
- if (zoomOutAction != 0) {
- zoomOutAction->setEnabled(m_currentView->isZoomOutPossible());
- }
-
QAction* showPreviewAction = m_actionCollection->action("show_preview");
showPreviewAction->setChecked(m_currentView->showPreview());
slotAdditionalInfoChanged();
slotCategorizedSortingChanged();
slotSortingChanged(m_currentView->sorting());
+ slotZoomLevelChanged(m_currentView->zoomLevel());
QAction* showHiddenFilesAction = m_actionCollection->action("show_hidden_files");
showHiddenFilesAction->setChecked(m_currentView->showHiddenFiles());
void DolphinViewActionHandler::zoomIn()
{
- m_currentView->zoomIn();
+ const int level = m_currentView->zoomLevel();
+ m_currentView->setZoomLevel(level + 1);
updateViewActions();
}
void DolphinViewActionHandler::zoomOut()
{
- m_currentView->zoomOut();
+ const int level = m_currentView->zoomLevel();
+ m_currentView->setZoomLevel(level - 1);
updateViewActions();
}
}
}
+void DolphinViewActionHandler::slotZoomLevelChanged(int level)
+{
+ QAction* zoomInAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomIn));
+ if (zoomInAction != 0) {
+ zoomInAction->setEnabled(level < m_currentView->zoomLevelMaximum());
+ }
+
+ QAction* zoomOutAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomOut));
+ if (zoomOutAction != 0) {
+ zoomOutAction->setEnabled(level > m_currentView->zoomLevelMinimum());
+ }
+}
+
void DolphinViewActionHandler::slotSortTriggered(QAction* action)
{
const DolphinView::Sorting sorting = action->data().value<DolphinView::Sorting>();
* Updates the state of the 'Sort by' actions.
*/
void slotSortingChanged(DolphinView::Sorting sorting);
+
+ /**
+ * Updates the state of the 'Zoom In' and 'Zoom Out' actions.
+ */
+ void slotZoomLevelChanged(int level);
/**
* Switches on or off the displaying of additional information
m_hasCutSelection = KonqMimeData::decodeIsCutSelection(mimeData);
const QSize size = m_view->iconSize();
- KIO::PreviewJob* job = KIO::filePreview(items, 128, 128);
+
+ // PreviewJob internally caches items always with the size of
+ // 128 x 128 pixels or 256 x 256 pixels. A downscaling is done
+ // by PreviewJob if a smaller size is requested. As the IconManager must
+ // do a downscaling anyhow because of the frame, only the provided
+ // cache sizes are requested.
+ const int cacheSize = (size.width() > 128) || (size.height() > 128) ? 256 : 128;
+ KIO::PreviewJob* job = KIO::filePreview(items, cacheSize, cacheSize);
connect(job, SIGNAL(gotPreview(const KFileItem&, const QPixmap&)),
this, SLOT(addToPreviewQueue(const KFileItem&, const QPixmap&)));
connect(job, SIGNAL(finished(KJob*)),