Fix clang warning about the ObjectTreeSourceIf vtable being emitted in every translation unit.
ClosedPublic

Authored by dfaure on Apr 10 2016, 12:53 PM.

Details

Summary

Pure interfaces don't get treated well by C++ compilers, better have a .cpp file for the dtor.
This required moving the header to one of the actual libs (viewer, since it's only used there).

Test Plan

Compiles

Diff Detail

Repository
R94 PIM: Message Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure updated this revision to Diff 3258.Apr 10 2016, 12:53 PM
dfaure retitled this revision from to Fix clang warning about the ObjectTreeSourceIf vtable being emitted in every translation unit..
dfaure updated this object.
dfaure edited the test plan for this revision. (Show Details)
dfaure added a reviewer: KDE PIM.

This is probably not binary compatible though. But is that a problem already for this lib?

dfaure updated this revision to Diff 3259.Apr 10 2016, 1:35 PM
  • Fix mimetreeparser tests leaving tons of temporary dirs behind
dfaure updated this revision to Diff 3261.Apr 10 2016, 1:37 PM

(oops, wrong branch usage, reverting to one single commit)

knauss accepted this revision.Apr 10 2016, 6:54 PM
knauss added a reviewer: knauss.
knauss added a subscriber: knauss.

If you fix the issues feal free to push it.

mimetreeparser/autotests/setupenv.h
25

please move it to interface subdir. This is the place it should go.

mimetreeparser/src/interfaces/objecttreesourceif.h
49–50

please move ctor as well to cpp

mimetreeparser/src/viewer/objecttreesourceif.cpp
1 ↗(On Diff #3258)

remove the mode line as well

23 ↗(On Diff #3258)

Code style:

{
}

not in one line

This revision is now accepted and ready to land.Apr 10 2016, 6:54 PM
dfaure added inline comments.Apr 11 2016, 7:25 AM
mimetreeparser/src/interfaces/objecttreesourceif.h
49–50

Why the ctor? It's not necessary nor useful -- this is an interface so there should never be a member variable, right? The inline empty default ctor could also just be removed.

I'm especially asking because I found 6 more classes with inline dtors so I'm fixing them all (and most of them only have a compiled-generated default-ctor)...

dfaure updated this revision to Diff 3272.Apr 11 2016, 7:30 AM
dfaure edited edge metadata.

same thing in more files

knauss added inline comments.Apr 11 2016, 8:38 PM
mimetreeparser/src/interfaces/objecttreesourceif.cpp
24

still a oneliner please change this to two lines like for other files.

mimetreeparser/src/interfaces/objecttreesourceif.h
49–50

yeah get rid of the unuseful ctor.

mimetreeparser/src/viewer/objecttreeparser.h
61

either #include or class ? both are not needed. if it works use the class forward declarion

dfaure marked 2 inline comments as done.Apr 11 2016, 9:02 PM
dfaure added inline comments.
mimetreeparser/src/viewer/objecttreeparser.h
61

oops yes my idea was to remove the unnecessary include, looks like I forgot.
But doing that turns out to break too many other cpp files, so I'll just revert this forward declaration.

dfaure updated this revision to Diff 3283.Apr 11 2016, 9:03 PM
dfaure marked an inline comment as done.

adjust as requested + add two missing export macros which broke the build

two small issues found - feel free to commit after fix these two.

mimetreeparser/src/CMakeLists.txt
122–123

delete this line too - it is also not more available

mimetreeparser/src/viewer/objecttreeparser.h
40

in exported files it must be "mimetreeparser/objecttreesourceif.h" otherwise dependend packages like kde-addons won't find this include anymore

This revision was automatically updated to reflect the committed changes.