Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:wolfi323:branches:KDE:Frameworks5
libbaloowidgets4
FileMetaDataProvider-Use-custom-unite-function....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File FileMetaDataProvider-Use-custom-unite-function.patch of Package libbaloowidgets4
From a5035ec235e9ad6681c7651cd646665c17804d2b Mon Sep 17 00:00:00 2001 From: Vishesh Handa <me@vhanda.in> Date: Thu, 12 Feb 2015 16:15:56 +0100 Subject: FileMetaDataProvider: Use custom unite function --- src/filemetadataprovider.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/filemetadataprovider.cpp b/src/filemetadataprovider.cpp index 72b45b1..3acedd5 100644 --- a/src/filemetadataprovider.cpp +++ b/src/filemetadataprovider.cpp @@ -136,6 +136,25 @@ namespace { return QVariant(); } + + /** + * The standard QMap::unite will contain the key multiple times if both \p v1 and \p v2 + * contain the same key. + * + * This will only take the key from \p v2 into account + */ + QVariantMap unite(const QVariantMap& v1, const QVariantMap& v2) + { + QVariantMap v(v1); + QMapIterator<QString, QVariant> it(v2); + while (it.hasNext()) { + it.next(); + + v[it.key()] = it.value(); + } + + return v; + } } void FileMetaDataProvider::Private::totalPropertyAndInsert(const QString& prop, @@ -221,7 +240,7 @@ void FileMetaDataProvider::Private::slotFileFetchFinished(KJob* job) void FileMetaDataProvider::Private::slotLoadingFinished(KJob* job) { IndexedDataRetriever* ret = dynamic_cast<IndexedDataRetriever*>(job); - m_data.unite(ret->data()); + m_data = unite(m_data, ret->data()); insertBasicData(); insertEditableData(); -- cgit v1.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor