From: Peter Penz Date: Thu, 13 Mar 2008 21:31:34 +0000 (+0000) Subject: Remove the semitransparent effect for hidden items in the IconManager, it just takes... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/3d75a64e6ea4958e896f2dc7d2376bdf96de983f?ds=inline Remove the semitransparent effect for hidden items in the IconManager, it just takes too much time at this part of the code. David Faure suggested some alternative ideas, I hope I can try them before KDE 4.1. Currently it is more important to keep the performance high. BUG: 158807 svn path=/trunk/KDE/kdebase/apps/; revision=785369 --- diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp index 03dd70cf9..ae2b80b99 100644 --- a/src/iconmanager.cpp +++ b/src/iconmanager.cpp @@ -93,13 +93,6 @@ void IconManager::updatePreviews() void IconManager::updateIcons(const KFileItemList& items) { - // make the icons of all hidden files semitransparent - foreach (KFileItem item, items) { - if (item.isHidden()) { - applyHiddenItemEffect(item); - } - } - if (m_showPreview) { generatePreviews(items); } @@ -139,16 +132,6 @@ void IconManager::replaceIcon(const KFileItem& item, const QPixmap& pixmap) limitToSize(icon, m_view->iconSize()); } - if (item.isHidden()) { - if (!icon.hasAlpha()) { - // the semitransparent operation requires having an alpha mask - QPixmap alphaMask(icon.size()); - alphaMask.fill(); - icon.setAlphaChannel(alphaMask); - } - KIconEffect::semiTransparent(icon); - } - const QMimeData* mimeData = QApplication::clipboard()->mimeData(); if (KonqMimeData::decodeIsCutSelection(mimeData) && isCutItem(item)) { KIconEffect iconEffect; @@ -264,19 +247,6 @@ void IconManager::applyCutItemEffect() } } -void IconManager::applyHiddenItemEffect(const KFileItem& hiddenItem) -{ - const QModelIndex index = m_dolphinModel->indexForItem(hiddenItem); - const QVariant value = m_dolphinModel->data(index, Qt::DecorationRole); - if (value.type() == QVariant::Icon) { - const QIcon icon(qvariant_cast(value)); - const QSize maxSize = m_view->iconSize(); - QPixmap pixmap = icon.pixmap(maxSize.height(), maxSize.height()); // ignore the width - KIconEffect::semiTransparent(pixmap); - m_dolphinModel->setData(index, QIcon(pixmap), Qt::DecorationRole); - } -} - bool IconManager::applyImageFrame(QPixmap& icon) { const QSize maxSize = m_view->iconSize(); diff --git a/src/iconmanager.h b/src/iconmanager.h index e35b13989..888fb42ee 100644 --- a/src/iconmanager.h +++ b/src/iconmanager.h @@ -85,9 +85,6 @@ private: /** Applies an item effect to all cut items. */ void applyCutItemEffect(); - /** Applies an item effect to the hidden item \a hiddenItem. */ - void applyHiddenItemEffect(const KFileItem& hiddenItem); - /** * Applies a frame around the icon. False is returned if * no frame has been added because the icon is too small.