Changeset View
Changeset View
Standalone View
Standalone View
src/metadatafilter.cpp
Show All 38 Lines | |||||
39 | 39 | | |||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | void MetadataFilter::initMetaInformationSettings() | 42 | void MetadataFilter::initMetaInformationSettings() | ||
43 | { | 43 | { | ||
44 | const int currentVersion = 11; // increase version, if the blacklist of disabled | 44 | const int currentVersion = 11; // increase version, if the blacklist of disabled | ||
45 | // properties should be updated | 45 | // properties should be updated | ||
46 | 46 | | |||
47 | KConfig config("baloofileinformationrc", KConfig::NoGlobals); | 47 | KConfig config(QStringLiteral("baloofileinformationrc"), KConfig::NoGlobals); | ||
48 | if (config.group("Misc").readEntry("version", 0) < currentVersion) { | 48 | if (config.group("Misc").readEntry("version", 0) < currentVersion) { | ||
49 | // The resource file is read the first time. Assure | 49 | // The resource file is read the first time. Assure | ||
50 | // that some meta information is disabled per default. | 50 | // that some meta information is disabled per default. | ||
51 | 51 | | |||
52 | // clear old info | 52 | // clear old info | ||
53 | config.deleteGroup("Show"); | 53 | config.deleteGroup("Show"); | ||
54 | KConfigGroup settings = config.group("Show"); | 54 | KConfigGroup settings = config.group("Show"); | ||
55 | 55 | | |||
Show All 40 Lines | |||||
96 | { | 96 | { | ||
97 | if( data.isEmpty() ) | 97 | if( data.isEmpty() ) | ||
98 | return data; | 98 | return data; | ||
99 | 99 | | |||
100 | QVariantMap finalData(data); | 100 | QVariantMap finalData(data); | ||
101 | 101 | | |||
102 | // | 102 | // | ||
103 | // Remove all items, that are marked as hidden in kmetainformationrc | 103 | // Remove all items, that are marked as hidden in kmetainformationrc | ||
104 | KConfig config("baloofileinformationrc", KConfig::NoGlobals); | 104 | KConfig config(QStringLiteral("baloofileinformationrc"), KConfig::NoGlobals); | ||
105 | KConfigGroup settings = config.group("Show"); | 105 | KConfigGroup settings = config.group("Show"); | ||
106 | QVariantMap::iterator it = finalData.begin(); | 106 | QVariantMap::iterator it = finalData.begin(); | ||
107 | while (it != finalData.end()) { | 107 | while (it != finalData.end()) { | ||
108 | const QString uriString = it.key(); | 108 | const QString uriString = it.key(); | ||
109 | if (!settings.readEntry(uriString, true)) { | 109 | if (!settings.readEntry(uriString, true)) { | ||
110 | it = finalData.erase(it); | 110 | it = finalData.erase(it); | ||
111 | } else { | 111 | } else { | ||
112 | ++it; | 112 | ++it; | ||
113 | } | 113 | } | ||
114 | } | 114 | } | ||
115 | 115 | | |||
116 | return finalData; | 116 | return finalData; | ||
117 | } | 117 | } |