From 950d3ad78bc7403be701936e3838d142c920d643 Mon Sep 17 00:00:00 2001 From: Sebastian Trueg Date: Tue, 26 Jan 2010 09:25:22 +0000 Subject: [PATCH] * Do not hide the parent folder since we can now browse into it by simply clicking the link. * 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 | 23 ++++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/panels/information/kmetadatawidget.cpp b/src/panels/information/kmetadatawidget.cpp index 5ac64a957..a17a0fd8f 100644 --- a/src/panels/information/kmetadatawidget.cpp +++ b/src/panels/information/kmetadatawidget.cpp @@ -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 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 ); } } -- 2.47.3