diff options
| author | Friedrich W. H. Kossebau <[email protected]> | 2023-07-04 22:07:48 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-07-05 07:59:18 +0000 |
| commit | ed2d352c42a6d517d4f29b3582c0e00aa34fe647 (patch) | |
| tree | d1b487efb15e1d1a6b9ad8c07c3fe2a01f19a505 /src/panels/information | |
| parent | 7fcf4e084debda4bddc82de563fbacdabc6a87ef (diff) | |
Add explicit moc includes to sources for moc-covered headers
* speeds up incremental builds as changes to a header will not always
need the full mocs_compilation.cpp for all the target's headers rebuild,
while having a moc file sourced into a source file only adds minor
extra costs, due to small own code and the used headers usually
already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
resulting in those quickly processed, while the minor extra cost of the
sourced moc files does not outweigh that in summary.
Measured times actually improved by some percent points.
(ideally CMake would just skip empty mocs_compilation.cpp & its object
file one day)
* enables compiler to see all methods of a class in same compilation unit
to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
moc code being sourced into the cpp file there definitions can be ensured
and often are already for the needs of the normal class methods
Diffstat (limited to 'src/panels/information')
| -rw-r--r-- | src/panels/information/informationpanel.cpp | 2 | ||||
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 2 | ||||
| -rw-r--r-- | src/panels/information/phononwidget.cpp | 1 | ||||
| -rw-r--r-- | src/panels/information/pixmapviewer.cpp | 2 |
4 files changed, 7 insertions, 0 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index 55b734cf0..7367f1d13 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -419,3 +419,5 @@ void InformationPanel::init() m_initialized = true; } + +#include "moc_informationpanel.cpp" diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 725ef785b..d93457b27 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -489,3 +489,5 @@ void InformationPanelContent::adjustWidgetSizes(int width) m_phononWidget->setVideoSize(QSize(maxWidth, maxWidth)); } } + +#include "moc_informationpanelcontent.cpp" diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index 2993e826e..77d55da8b 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -261,4 +261,5 @@ void PhononWidget::applyVideoSize() } } +#include "moc_phononwidget.cpp" #include "phononwidget.moc" diff --git a/src/panels/information/pixmapviewer.cpp b/src/panels/information/pixmapviewer.cpp index 7eca876c8..11c13e348 100644 --- a/src/panels/information/pixmapviewer.cpp +++ b/src/panels/information/pixmapviewer.cpp @@ -174,3 +174,5 @@ bool PixmapViewer::isAnimatedMimeType(const QString &mimeType) return QMovie::supportedFormats().contains(format); }); } + +#include "moc_pixmapviewer.cpp" |
