[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.2/kdelibs/kio/kio
From:       David Faure <faure () kde ! org>
Date:       2009-01-08 20:11:45
Message-ID: 1231445505.504945.450.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 907837 by dfaure:

Clear the cached icon (preview or "cut icon") when the mimetype changes (due to \
delayed mimetype determination or due to renaming the file). The fix will be in 4.2.
CCBUG: 164185


 M  +13 -0     kdirmodel.cpp  


--- branches/KDE/4.2/kdelibs/kio/kio/kdirmodel.cpp #907836:907837
@@ -545,6 +545,9 @@
                 m_nodeHash.remove(cleanupUrl(oldUrl));
                 m_nodeHash.insert(cleanupUrl(newUrl), node);
             }
+            // Mimetype changed -> forget cached icon (e.g. from "cut", #164185 \
comment #13) +            if (fit->first.mimeTypePtr() != fit->second.mimeTypePtr())
+                node->setPreview(QIcon());
             const QModelIndex index = indexForNode(node);
             if (!topLeft.isValid() || index.row() < topLeft.row()) {
                 topLeft = index;
@@ -598,6 +601,16 @@
 
 void KDirModel::itemChanged( const QModelIndex& index )
 {
+    // This method is really a itemMimeTypeChanged(), it's mostly called by \
KMimeTypeResolver. +    // When the mimetype is determined, clear the old "preview" \
(could be +    // mimetype dependent like when cutting files, #164185)
+    KDirModelNode* node = d->nodeForIndex(index);
+    if (node)
+        node->setPreview(QIcon());
+
+#ifndef NDEBUG // debugIndex only defined in debug mode
+    //kDebug(7008) << "dataChanged(" << debugIndex(index);
+#endif
     emit dataChanged(index, index);
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic