Changeset View
Changeset View
Standalone View
Standalone View
src/filemetadatautil.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Library General Public License * | 14 | * You should have received a copy of the GNU Library General Public License * | ||
15 | * along with this library; see the file COPYING.LIB. If not, write to * | 15 | * along with this library; see the file COPYING.LIB. If not, write to * | ||
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * | ||
17 | * Boston, MA 02110-1301, USA. * | 17 | * Boston, MA 02110-1301, USA. * | ||
18 | *****************************************************************************/ | 18 | *****************************************************************************/ | ||
19 | 19 | | |||
20 | #include "filemetadatautil_p.h" | 20 | #include "filemetadatautil_p.h" | ||
21 | #include <KFileMetaData/UserMetaData> | 21 | #include <KFileMetaData/UserMetaData> | ||
22 | #include <KFileMetaData/PropertyInfo> | ||||
22 | 23 | | |||
23 | namespace Baloo | 24 | namespace Baloo | ||
24 | { | 25 | { | ||
25 | namespace Private | 26 | namespace Private | ||
26 | { | 27 | { | ||
27 | 28 | | |||
28 | QVariantMap convertUserMetaData(const KFileMetaData::UserMetaData& metaData) | 29 | QVariantMap convertUserMetaData(const KFileMetaData::UserMetaData& metaData) | ||
29 | { | 30 | { | ||
Show All 17 Lines | |||||
47 | const QString originUrl = metaData.originUrl().toDisplayString(); | 48 | const QString originUrl = metaData.originUrl().toDisplayString(); | ||
48 | if (!originUrl.isEmpty()) { | 49 | if (!originUrl.isEmpty()) { | ||
49 | properties.insert(QStringLiteral("originUrl"), originUrl); | 50 | properties.insert(QStringLiteral("originUrl"), originUrl); | ||
50 | } | 51 | } | ||
51 | 52 | | |||
52 | return properties; | 53 | return properties; | ||
53 | } | 54 | } | ||
54 | 55 | | |||
56 | QVariantMap toNamedVariantMap(const KFileMetaData::PropertyMap& propMap) | ||||
57 | { | ||||
58 | QVariantMap map; | ||||
59 | KFileMetaData::PropertyMap::const_iterator it = propMap.constBegin(); | ||||
60 | for (; it != propMap.constEnd(); it++) { | ||||
61 | KFileMetaData::PropertyInfo pi(it.key()); | ||||
62 | map.insertMulti(pi.name(), it.value()); | ||||
63 | } | ||||
64 | | ||||
65 | return map; | ||||
66 | } | ||||
67 | | ||||
55 | } // namespace KFMPrivate | 68 | } // namespace KFMPrivate | ||
56 | } // namespace Baloo | 69 | } // namespace Baloo |