D29199: honor the extractMetaData flag

2020-05-04 Thread Alexander Stippich
This revision was automatically updated to reflect the committed changes.
Closed by commit R286:538c34b58057: honor the extractMetaData flag (authored by 
astippich).

REPOSITORY
  R286 KFileMetaData

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29199?vs=81258=81927

REVISION DETAIL
  https://phabricator.kde.org/D29199

AFFECTED FILES
  src/extractors/epubextractor.cpp
  src/extractors/exiv2extractor.cpp
  src/extractors/ffmpegextractor.cpp
  src/extractors/odfextractor.cpp
  src/extractors/office2007extractor.cpp
  src/extractors/plaintextextractor.cpp
  src/extractors/popplerextractor.cpp
  src/extractors/postscriptdscextractor.cpp
  src/extractors/taglibextractor.cpp
  src/extractors/xmlextractor.cpp

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-27 Thread Nathaniel Graham
ngraham accepted this revision.

REPOSITORY
  R286 KFileMetaData

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Stefan Brüns
bruns accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R286 KFileMetaData

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich updated this revision to Diff 81258.
astippich added a comment.


  - use continue

REPOSITORY
  R286 KFileMetaData

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29199?vs=81257=81258

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

AFFECTED FILES
  src/extractors/epubextractor.cpp
  src/extractors/exiv2extractor.cpp
  src/extractors/ffmpegextractor.cpp
  src/extractors/odfextractor.cpp
  src/extractors/office2007extractor.cpp
  src/extractors/plaintextextractor.cpp
  src/extractors/popplerextractor.cpp
  src/extractors/postscriptdscextractor.cpp
  src/extractors/taglibextractor.cpp
  src/extractors/xmlextractor.cpp

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich updated this revision to Diff 81257.
astippich added a comment.


  - fix another stupid mistake

REPOSITORY
  R286 KFileMetaData

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29199?vs=81253=81257

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

AFFECTED FILES
  src/extractors/epubextractor.cpp
  src/extractors/exiv2extractor.cpp
  src/extractors/ffmpegextractor.cpp
  src/extractors/odfextractor.cpp
  src/extractors/office2007extractor.cpp
  src/extractors/plaintextextractor.cpp
  src/extractors/popplerextractor.cpp
  src/extractors/postscriptdscextractor.cpp
  src/extractors/taglibextractor.cpp
  src/extractors/xmlextractor.cpp

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich marked 2 inline comments as done.
astippich added inline comments.

INLINE COMMENTS

> bruns wrote in xmlextractor.cpp:103
> skipped, `if (!) { continue; }`

sorry, that went lost somehow

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich updated this revision to Diff 81253.
astippich marked an inline comment as done.
astippich added a comment.


  - more fixes

REPOSITORY
  R286 KFileMetaData

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29199?vs=81248=81253

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

AFFECTED FILES
  src/extractors/epubextractor.cpp
  src/extractors/exiv2extractor.cpp
  src/extractors/ffmpegextractor.cpp
  src/extractors/odfextractor.cpp
  src/extractors/office2007extractor.cpp
  src/extractors/plaintextextractor.cpp
  src/extractors/popplerextractor.cpp
  src/extractors/postscriptdscextractor.cpp
  src/extractors/taglibextractor.cpp
  src/extractors/xmlextractor.cpp

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Stefan Brüns
bruns added inline comments.

INLINE COMMENTS

> exiv2extractor.cpp:172
>  
> -if (image->pixelHeight()) {
> -result->add(Property::Height, image->pixelHeight());
> -}
> +if (result->inputFlags() & ExtractionResult::ExtractMetaData) {
>  

`if (!) return`

> astippich wrote in taglibextractor.cpp:99
> true, that was still written with D25517  
> and D25515  in mind

Still trivially possible:

  if (savedProperties.isEmpty()) {
  return;
  }
  if (extractFulltext) {
  // extract lyrics
  }
  if (!extractMetadata) {
  return
  }

> bruns wrote in xmlextractor.cpp:103
> correct place for the flags check

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

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich added inline comments.

INLINE COMMENTS

> bruns wrote in taglibextractor.cpp:99
> when you add the flag check here, you can avoid the extra indentation below. 
> Likewise in some other places.

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

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich updated this revision to Diff 81248.
astippich marked 4 inline comments as done.
astippich added a comment.


  - implement review

REPOSITORY
  R286 KFileMetaData

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29199?vs=81235=81248

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

AFFECTED FILES
  src/extractors/epubextractor.cpp
  src/extractors/exiv2extractor.cpp
  src/extractors/ffmpegextractor.cpp
  src/extractors/odfextractor.cpp
  src/extractors/office2007extractor.cpp
  src/extractors/plaintextextractor.cpp
  src/extractors/popplerextractor.cpp
  src/extractors/postscriptdscextractor.cpp
  src/extractors/taglibextractor.cpp
  src/extractors/xmlextractor.cpp

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Stefan Brüns
bruns added inline comments.

INLINE COMMENTS

> office2007extractor.cpp:79
> +
> +if (docPropsEntries.contains(QStringLiteral("core.xml")) && 
> result->inputFlags() & ExtractionResult::ExtractMetaData) {
>  QDomDocument coreDoc(QStringLiteral("core"));

Long line

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

> office2007extractor.cpp:144
>  
> -if (docPropsEntries.contains(QStringLiteral("app.xml"))) {
> +if (docPropsEntries.contains(QStringLiteral("app.xml")) && 
> result->inputFlags() & ExtractionResult::ExtractMetaData) {
>  QDomDocument appDoc(QStringLiteral("app"));

Long line

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

> office2007extractor.cpp:185
>  //
>  bool extractPlainText = (result->inputFlags() & 
> ExtractionResult::ExtractPlainText);
>  

... like done here

> taglibextractor.cpp:99
>  {
>  if (savedProperties.isEmpty()) {
>  return;

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

> xmlextractor.cpp:103
>  
>  if (e.localName() == QLatin1String("metadata")) {
>  auto rdf = e.firstChildElement(QLatin1String("RDF"));

correct place for the flags check

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Stefan Brüns
bruns requested changes to this revision.
This revision now requires changes to proceed.

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich added a dependent revision: D29200: test the extractNothing flag.

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D29199

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams


D29199: honor the extractMetaData flag

2020-04-26 Thread Alexander Stippich
astippich created this revision.
astippich added reviewers: Baloo, bruns, ngraham.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
astippich requested review of this revision.

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

REPOSITORY
  R286 KFileMetaData

BRANCH
  honorFlag

REVISION DETAIL
  https://phabricator.kde.org/D29199

AFFECTED FILES
  src/extractors/epubextractor.cpp
  src/extractors/exiv2extractor.cpp
  src/extractors/ffmpegextractor.cpp
  src/extractors/odfextractor.cpp
  src/extractors/office2007extractor.cpp
  src/extractors/plaintextextractor.cpp
  src/extractors/popplerextractor.cpp
  src/extractors/postscriptdscextractor.cpp
  src/extractors/taglibextractor.cpp
  src/extractors/xmlextractor.cpp

To: astippich, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, 
fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, 
bruns, abrahams