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
Branch
honorFlag
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25929
Build 25947: arc lint + arc unit
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 ↗(On Diff #81235)

Long line

bool extractMetaData = ...
if (extractMetaData && docPropsEntries.contains(QStringLiteral("core.xml")) {
144 ↗(On Diff #81235)

Long line

if (extractMetaData && docPropsEntries.contains(QStringLiteral("app.xml")) {
185 ↗(On Diff #81235)

... like done here

src/extractors/taglibextractor.cpp
99 ↗(On Diff #81235)

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

src/extractors/xmlextractor.cpp
103 ↗(On Diff #81235)

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 ↗(On Diff #81235)

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
172

if (!....) return

src/extractors/taglibextractor.cpp
99 ↗(On Diff #81235)

Still trivially possible:

if (savedProperties.isEmpty()) {
    return;
}
if (extractFulltext) {
    // extract lyrics
}
if (!extractMetadata) {
    return
}
src/extractors/xmlextractor.cpp
103 ↗(On Diff #81235)

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 ↗(On Diff #81235)

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.