honor the extractMetaData flag
ClosedPublic

Authored by astippich on Apr 26 2020, 1:16 PM.

Details

Summary

Metadata was extracted unconditionally before.
Only do so if it is actually requested.

Diff Detail

Repository
R286 KFileMetaData
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich created this revision.Apr 26 2020, 1:16 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 26 2020, 1:16 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
astippich requested review of this revision.Apr 26 2020, 1:16 PM
bruns added inline comments.Apr 26 2020, 1:38 PM
src/extractors/office2007extractor.cpp
79

Long line

bool extractMetaData = ...
if (extractMetaData && docPropsEntries.contains(QStringLiteral("core.xml")) {
144

Long line

if (extractMetaData && docPropsEntries.contains(QStringLiteral("app.xml")) {
185

... like done here

src/extractors/taglibextractor.cpp
99

when you add the flag check here, you can avoid the extra indentation below. Likewise in some other places.

src/extractors/xmlextractor.cpp
103–107

correct place for the flags check

bruns requested changes to this revision.Apr 26 2020, 1:39 PM
This revision now requires changes to proceed.Apr 26 2020, 1:39 PM
astippich updated this revision to Diff 81248.Apr 26 2020, 2:47 PM
astippich marked 4 inline comments as done.
  • implement review
astippich added inline comments.Apr 26 2020, 2:47 PM
src/extractors/taglibextractor.cpp
99

true, that was still written with D25517 and D25515 in mind

bruns added inline comments.Apr 26 2020, 3:00 PM
src/extractors/exiv2extractor.cpp
178

if (!....) return

src/extractors/taglibextractor.cpp
99

Still trivially possible:

if (savedProperties.isEmpty()) {
    return;
}
if (extractFulltext) {
    // extract lyrics
}
if (!extractMetadata) {
    return
}
src/extractors/xmlextractor.cpp
103–107

skipped, if (!....) { continue; }

astippich updated this revision to Diff 81253.Apr 26 2020, 3:10 PM
astippich marked an inline comment as done.
  • more fixes
astippich marked 2 inline comments as done.Apr 26 2020, 3:11 PM
astippich added inline comments.
src/extractors/xmlextractor.cpp
103–107

sorry, that went lost somehow

astippich updated this revision to Diff 81257.Apr 26 2020, 4:50 PM
  • fix another stupid mistake
astippich updated this revision to Diff 81258.Apr 26 2020, 4:55 PM
  • use continue
bruns accepted this revision.Apr 26 2020, 5:04 PM
This revision is now accepted and ready to land.Apr 26 2020, 5:04 PM
ngraham accepted this revision.Apr 27 2020, 2:23 PM
This revision was automatically updated to reflect the committed changes.