Skip to content

Commit b7bb725

Browse files
committed
fix(warnings): ensure compilation without warnings with gcc 16
the new gcc 16 will trigger new warnings related to https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wsfinae-incomplete makes sure to fix them cleaned come include to ensure logical order of inclusions (from most specific to most generic ones) also makes incremental compilation faster by spliting MOC generated code into files related to each headers instead of a big one see https://forum.qt.io/topic/164690/gcc-16-warnings-about-incomplete-types-in-an-sfinae-context/2?_=1786535933996 also https://www.kdab.com/save-re-compile-time-include-moc-files-in-source-files-video/ Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
1 parent 019fa47 commit b7bb725

29 files changed

Lines changed: 71 additions & 13 deletions

src/common/syncjournaldb.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
* SPDX-License-Identifier: LGPL-2.1-or-later
55
*/
66

7+
8+
#include "syncjournaldb.h"
9+
10+
#include "version.h"
11+
#include "filesystembase.h"
12+
#include "common/asserts.h"
13+
#include "common/checksums.h"
14+
#include "common/preparedsqlquerymanager.h"
15+
#include "common/c_jhash.h"
16+
717
#include <QCryptographicHash>
818
#include <QFile>
919
#include <QJsonArray>
@@ -13,17 +23,10 @@
1323
#include <QElapsedTimer>
1424
#include <QUrl>
1525
#include <QDir>
16-
#include <sqlite3.h>
17-
#include <cstring>
1826

19-
#include "common/syncjournaldb.h"
20-
#include "version.h"
21-
#include "filesystembase.h"
22-
#include "common/asserts.h"
23-
#include "common/checksums.h"
24-
#include "common/preparedsqlquerymanager.h"
27+
#include <sqlite3.h>
2528

26-
#include "common/c_jhash.h"
29+
#include <cstring>
2730

2831
// SQL expression to check whether path.startswith(prefix + '/')
2932
// Note: '/' + 1 == '0'
@@ -3314,3 +3317,5 @@ QDebug& operator<<(QDebug &stream, const SyncJournalFileRecord::EncryptionStatus
33143317
}
33153318

33163319
} // namespace OCC
3320+
3321+
#include "moc_syncjournaldb.cpp"

src/gui/socketapi/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
target_sources(nextcloudCore PRIVATE
55
${CMAKE_CURRENT_SOURCE_DIR}/socketapi.h
66
${CMAKE_CURRENT_SOURCE_DIR}/socketapi.cpp
7+
${CMAKE_CURRENT_SOURCE_DIR}/socketapi_p.h
78
)
89

910
if( APPLE )

src/gui/socketapi/socketapi.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,3 +1764,4 @@ void SocketApiJob::reject(const QString &response)
17641764
} // namespace OCC
17651765

17661766
#include "socketapi.moc"
1767+
#include "moc_socketapi_p.cpp"

src/gui/socketapi/socketapi_p.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
#ifndef SOCKETAPI_P_H
88
#define SOCKETAPI_P_H
99

10-
#include <functional>
1110
#include <QBitArray>
1211
#include <QIODevice>
1312
#include <QPointer>
14-
1513
#include <QJsonDocument>
1614
#include <QJsonObject>
15+
#include <QTimer>
16+
#include <QLoggingCategory>
1717

18+
#include <functional>
1819
#include <memory>
19-
#include <QTimer>
2020

2121
namespace OCC {
2222

src/libsync/basepropagateremotedeleteencrypted.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,5 @@ const QByteArray BasePropagateRemoteDeleteEncrypted::folderToken() const
197197
}
198198

199199
} // namespace OCC
200+
201+
#include "moc_basepropagateremotedeleteencrypted.cpp"

src/libsync/bulkpropagatordownloadjob.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,5 @@ void BulkPropagatorDownloadJob::abortWithError(SyncFileItemPtr item, SyncFileIte
165165
}
166166

167167
}
168+
169+
#include "moc_bulkpropagatordownloadjob.cpp"

src/libsync/bulkpropagatorjob.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,3 +819,5 @@ void BulkPropagatorJob::handleJobDoneErrors(SyncFileItemPtr item,
819819
}
820820

821821
}
822+
823+
#include "moc_bulkpropagatorjob.cpp"

src/libsync/creds/abstractcredentials.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* SPDX-License-Identifier: GPL-2.0-or-later
55
*/
66

7+
#include "abstractcredentials.h"
8+
79
#include <QLoggingCategory>
810
#include <QString>
911
#include <QCoreApplication>
1012

1113
#include "common/asserts.h"
12-
#include "creds/abstractcredentials.h"
1314

1415
namespace OCC {
1516

@@ -59,3 +60,5 @@ QString AbstractCredentials::keychainKey(const QString &url, const QString &user
5960
return key;
6061
}
6162
} // namespace OCC
63+
64+
#include "moc_abstractcredentials.cpp"

src/libsync/creds/dummycredentials.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ void DummyCredentials::persist()
5858
}
5959

6060
} // namespace OCC
61+
62+
#include "moc_dummycredentials.cpp"

src/libsync/creds/httpcredentials.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,5 @@ bool HttpCredentials::unpackClientCertBundle()
555555
}
556556

557557
} // namespace OCC
558+
559+
#include "moc_httpcredentials.cpp"

0 commit comments

Comments
 (0)