From 7308c7d03e182795d6b64d85a3f0725d8af32436 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 5 Aug 2008 20:15:51 +0000 Subject: First step of refactoring to improve the zooming capabilities of views: * 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 --- src/iconmanager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/iconmanager.cpp') diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp index 11a3e2864..56c2b627c 100644 --- a/src/iconmanager.cpp +++ b/src/iconmanager.cpp @@ -506,7 +506,14 @@ void IconManager::startPreviewJob(const KFileItemList& items) 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*)), -- cgit v1.3