]> cloud.milkyroute.net Git - dolphin.git/commitdiff
* Do not hide the parent folder since we can now browse into it by simply clicking...
authorSebastian Trueg <sebastian@trueg.de>
Tue, 26 Jan 2010 09:25:22 +0000 (09:25 +0000)
committerSebastian Trueg <sebastian@trueg.de>
Tue, 26 Jan 2010 09:25:22 +0000 (09:25 +0000)
* Fixed index bug which caused the last information item to be deleted.
* Why make merge-sort more complicated than it is? ;)

svn path=/trunk/KDE/kdebase/apps/; revision=1080377

src/panels/information/kmetadatawidget.cpp

index 5ac64a9577cc662c3671e469323a5a45bd217f07..a17a0fd8fb57abff0f8360d93535926abb324a4f 100644 (file)
@@ -267,7 +267,7 @@ void KMetaDataWidget::Private::setRowVisible(QWidget* infoWidget, bool visible)
 
 void KMetaDataWidget::Private::initMetaInfoSettings()
 {
-    const int currentVersion = 1; // increase version, if the blacklist of disabled
+    const int currentVersion = 2; // increase version, if the blacklist of disabled
                                   // properties should be updated
 
     KConfig config("kmetainformationrc", KConfig::NoGlobals);
@@ -283,7 +283,7 @@ void KMetaDataWidget::Private::initMetaInfoSettings()
 
         static const char* const disabledProperties[] = {
             "asText", "contentSize", "created", "depth", "description", "fileExtension",
-            "fileName", "fileSize", "hasTag", "isPartOf", "lastModified", "mimeType", "name",
+            "fileName", "fileSize", "hasTag", "lastModified", "mimeType", "name",
             "numericRating", "parentUrl", "permissions", "plainTextContent", "owner",
             "sourceModified", "url",
             0 // mandatory last entry
@@ -410,7 +410,7 @@ void KMetaDataWidget::Private::slotLoadingFinished()
     }
 
     // remove rows that are not needed anymore
-    for (int i = m_rows.count() - 1; i >= index; --i) {
+    for (int i = m_rows.count() - 1; i > index; --i) {
         delete m_rows[i].label;
         delete m_rows[i].infoWidget;
         m_rows.pop_back();
@@ -507,19 +507,12 @@ QList<KLoadMetaDataThread::Item>
             height = item;
         } else {
             // insert the item sorted by the label
-            bool inserted = false;
-            int i = 0;
-            const int count = mergedItems.count();
-            while (!inserted && (i < count)) {
-                if (item.label < mergedItems[i].label) {
-                    mergedItems.insert(i, item);
-                    inserted = true;
-                }
-                ++i;
-            }
-            if (!inserted) {
-                mergedItems.append(item);
+            int pos = 0;
+            while ( mergedItems.count() > pos &&
+                    mergedItems[pos].label < item.label ) {
+                ++pos;
             }
+            mergedItems.insert( pos, item );
         }
     }