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/kitemviews/private | |
| 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/kitemviews/private')
11 files changed, 22 insertions, 0 deletions
diff --git a/src/kitemviews/private/kdirectorycontentscounter.cpp b/src/kitemviews/private/kdirectorycontentscounter.cpp index 648b20b6f..47f538447 100644 --- a/src/kitemviews/private/kdirectorycontentscounter.cpp +++ b/src/kitemviews/private/kdirectorycontentscounter.cpp @@ -292,3 +292,5 @@ void KDirectoryContentsCounter::stopWorker() } m_currentPath.clear(); } + +#include "moc_kdirectorycontentscounter.cpp" diff --git a/src/kitemviews/private/kdirectorycontentscounterworker.cpp b/src/kitemviews/private/kdirectorycontentscounterworker.cpp index eb456da25..2d60091c6 100644 --- a/src/kitemviews/private/kdirectorycontentscounterworker.cpp +++ b/src/kitemviews/private/kdirectorycontentscounterworker.cpp @@ -156,3 +156,5 @@ void KDirectoryContentsCounterWorker::countDirectoryContents(const QString &path m_stopping = false; Q_EMIT finished(); } + +#include "moc_kdirectorycontentscounterworker.cpp" diff --git a/src/kitemviews/private/kfileitemclipboard.cpp b/src/kitemviews/private/kfileitemclipboard.cpp index 33bf298ed..47718fa02 100644 --- a/src/kitemviews/private/kfileitemclipboard.cpp +++ b/src/kitemviews/private/kfileitemclipboard.cpp @@ -68,3 +68,5 @@ KFileItemClipboard::KFileItemClipboard() connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &KFileItemClipboard::updateCutItems); } + +#include "moc_kfileitemclipboard.cpp" diff --git a/src/kitemviews/private/kitemlistheaderwidget.cpp b/src/kitemviews/private/kitemlistheaderwidget.cpp index 822e9e7a5..850f49406 100644 --- a/src/kitemviews/private/kitemlistheaderwidget.cpp +++ b/src/kitemviews/private/kitemlistheaderwidget.cpp @@ -614,3 +614,5 @@ qreal KItemListHeaderWidget::roleXPosition(const QByteArray &role) const return -1; } + +#include "moc_kitemlistheaderwidget.cpp" diff --git a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp index c74ef1638..c18f87b7d 100644 --- a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp +++ b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp @@ -101,3 +101,5 @@ void KItemListKeyboardSearchManager::slotSelectionChanged(const KItemSet ¤ cancelSearch(); } } + +#include "moc_kitemlistkeyboardsearchmanager.cpp" diff --git a/src/kitemviews/private/kitemlistroleeditor.cpp b/src/kitemviews/private/kitemlistroleeditor.cpp index d3389832b..f305fadac 100644 --- a/src/kitemviews/private/kitemlistroleeditor.cpp +++ b/src/kitemviews/private/kitemlistroleeditor.cpp @@ -169,3 +169,5 @@ void KItemListRoleEditor::emitRoleEditingFinished(EditResultDirection direction) Q_EMIT roleEditingFinished(m_role, ret); } } + +#include "moc_kitemlistroleeditor.cpp" diff --git a/src/kitemviews/private/kitemlistrubberband.cpp b/src/kitemviews/private/kitemlistrubberband.cpp index e572780e7..96f87b431 100644 --- a/src/kitemviews/private/kitemlistrubberband.cpp +++ b/src/kitemviews/private/kitemlistrubberband.cpp @@ -74,3 +74,5 @@ bool KItemListRubberBand::isActive() const { return m_active; } + +#include "moc_kitemlistrubberband.cpp" diff --git a/src/kitemviews/private/kitemlistselectiontoggle.cpp b/src/kitemviews/private/kitemlistselectiontoggle.cpp index bec32b3d3..df61b3073 100644 --- a/src/kitemviews/private/kitemlistselectiontoggle.cpp +++ b/src/kitemviews/private/kitemlistselectiontoggle.cpp @@ -99,3 +99,5 @@ int KItemListSelectionToggle::iconSize() const return iconSize; } + +#include "moc_kitemlistselectiontoggle.cpp" diff --git a/src/kitemviews/private/kitemlistsmoothscroller.cpp b/src/kitemviews/private/kitemlistsmoothscroller.cpp index 19d47aac8..3e325b934 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.cpp +++ b/src/kitemviews/private/kitemlistsmoothscroller.cpp @@ -195,3 +195,5 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent *event) m_smoothScrolling = previous; } + +#include "moc_kitemlistsmoothscroller.cpp" diff --git a/src/kitemviews/private/kitemlistviewanimation.cpp b/src/kitemviews/private/kitemlistviewanimation.cpp index 83a7a2ec6..763f770ff 100644 --- a/src/kitemviews/private/kitemlistviewanimation.cpp +++ b/src/kitemviews/private/kitemlistviewanimation.cpp @@ -234,3 +234,5 @@ void KItemListViewAnimation::slotFinished() } Q_ASSERT(false); } + +#include "moc_kitemlistviewanimation.cpp" diff --git a/src/kitemviews/private/kitemlistviewlayouter.cpp b/src/kitemviews/private/kitemlistviewlayouter.cpp index 027943683..5b0df0bd0 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.cpp +++ b/src/kitemviews/private/kitemlistviewlayouter.cpp @@ -613,3 +613,5 @@ qreal KItemListViewLayouter::minimumGroupHeaderWidth() const { return 100; } + +#include "moc_kitemlistviewlayouter.cpp" |
