move supported mimetypes to static string list
ClosedPublic

Authored by astippich on Oct 31 2018, 8:50 PM.

Details

Summary

Do not create the list of supported mime types on demand
and use a static stringlist instead.
Order alphabetically where required

Diff Detail

Repository
R286 KFileMetaData
Branch
mimetype_lists
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4448
Build 4466: arc lint + arc unit
astippich created this revision.Oct 31 2018, 8:50 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptOct 31 2018, 8:50 PM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
astippich requested review of this revision.Oct 31 2018, 8:50 PM
bruns added inline comments.Nov 1 2018, 2:09 AM
src/extractors/epubextractor.cpp
36–37

Opening braces should go on the same line for everything but functions ...

38–42

you can put the static mimetypes variable here in the anonymous namespace

astippich updated this revision to Diff 44612.Nov 1 2018, 10:12 AM
  • coding style fixes
  • use anonymous namespace
astippich updated this revision to Diff 44613.Nov 1 2018, 10:14 AM
  • adjust taglibwriter
bruns added inline comments.Nov 1 2018, 1:28 PM
src/extractors/epubextractor.cpp
44 ↗(On Diff #44613)

The idea behind using anonymous namespaces is to neither "pollute" the class namespace nor the global namespace. Remove the "EPubExtractor::" qualifier, see fetchMetadata.

astippich added inline comments.Nov 1 2018, 4:16 PM
src/extractors/epubextractor.cpp
44 ↗(On Diff #44613)

All the stringlists are currently implemented as a private static member of the class... would you like to change that to a local static variable?

bruns added inline comments.Nov 1 2018, 6:21 PM
src/extractors/epubextractor.cpp
44 ↗(On Diff #44613)

I consider this cleaner, yes.
We don't expose static helper functions, either.

astippich updated this revision to Diff 44661.Nov 1 2018, 7:04 PM
  • use local static variable
bruns accepted this revision.Nov 1 2018, 8:59 PM
bruns added inline comments.
src/extractors/taglibextractor.cpp
71

w < x

This revision is now accepted and ready to land.Nov 1 2018, 8:59 PM
This revision was automatically updated to reflect the committed changes.