Skip to content

Commit 31cb11d

Browse files
committed
chore: enable use of QT_NO_KEYWORDS when compiling newtcloudCore target
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com> Assisted-by: ClaudeCode:claude-sonnet-5
1 parent a002440 commit 31cb11d

348 files changed

Lines changed: 1412 additions & 1384 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/3rdparty/kmessagewidget/kmessagewidget.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ void KMessageWidgetPrivate::slotTimeLineFinished()
241241
content->setGeometry(0, 0, q->width(), bestContentHeight());
242242

243243
// notify about finished animation
244-
emit q->showAnimationFinished();
244+
Q_EMIT q->showAnimationFinished();
245245
} else {
246246
// hide and notify about finished animation
247247
q->hide();
248-
emit q->hideAnimationFinished();
248+
Q_EMIT q->hideAnimationFinished();
249249
}
250250
}
251251

@@ -404,18 +404,18 @@ void KMessageWidget::animatedShow()
404404
// Test before styleHint, as there might have been a style change while animation was running
405405
if (isHideAnimationRunning()) {
406406
d->timeLine->stop();
407-
emit hideAnimationFinished();
407+
Q_EMIT hideAnimationFinished();
408408
}
409409

410410
if (!style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)
411411
|| (parentWidget() && !parentWidget()->isVisible())) {
412412
show();
413-
emit showAnimationFinished();
413+
Q_EMIT showAnimationFinished();
414414
return;
415415
}
416416

417417
if (isVisible() && (d->timeLine->state() == QTimeLine::NotRunning) && (height() == d->bestContentHeight()) && (d->content->pos().y() == 0)) {
418-
emit showAnimationFinished();
418+
Q_EMIT showAnimationFinished();
419419
return;
420420
}
421421

@@ -441,19 +441,19 @@ void KMessageWidget::animatedHide()
441441
// And before styleHint, as there might have been a style change while animation was running
442442
if (isShowAnimationRunning()) {
443443
d->timeLine->stop();
444-
emit showAnimationFinished();
444+
Q_EMIT showAnimationFinished();
445445
}
446446

447447
if (!style()->styleHint(QStyle::SH_Widget_Animate, nullptr, this)) {
448448
hide();
449-
emit hideAnimationFinished();
449+
Q_EMIT hideAnimationFinished();
450450
return;
451451
}
452452

453453
if (!isVisible()) {
454454
// explicitly hide it, so it stays hidden in case it is only not visible due to the parents
455455
hide();
456-
emit hideAnimationFinished();
456+
Q_EMIT hideAnimationFinished();
457457
return;
458458
}
459459

src/cmd/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ target_link_libraries(cmdCore
1717
Qt::Network
1818
)
1919

20+
target_compile_definitions(cmdCore PRIVATE QT_NO_KEYWORDS)
21+
2022
if(UNIX AND NOT APPLE)
2123
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
2224
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
@@ -36,6 +38,8 @@ if(NOT BUILD_LIBRARIES_ONLY)
3638

3739
target_link_libraries(nextcloudcmd cmdCore nextcloudCore)
3840

41+
target_compile_definitions(nextcloudcmd PRIVATE QT_NO_KEYWORDS)
42+
3943
if(BUILD_OWNCLOUD_OSX_BUNDLE)
4044
set_target_properties(nextcloudcmd PROPERTIES
4145
RUNTIME_OUTPUT_DIRECTORY "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS")

src/cmd/cmd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class HttpCredentialsText : public HttpCredentials
146146
_password = ::queryPassword(user());
147147
_ready = true;
148148
persist();
149-
emit asked();
149+
Q_EMIT asked();
150150
}
151151

152152
void setSSLTrusted(bool isTrusted)

src/cmd/cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Cmd : public QObject
2121
: QObject()
2222
{
2323
}
24-
public slots:
24+
public Q_SLOTS:
2525
void transmissionProgressSlot()
2626
{
2727
}

src/common/checksums.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ void ComputeChecksum::slotCalculationDone()
234234
{
235235
QByteArray checksum = _watcher.future().result();
236236
if (!checksum.isNull()) {
237-
emit done(_checksumType, checksum);
237+
Q_EMIT done(_checksumType, checksum);
238238
} else {
239-
emit done(QByteArray(), QByteArray());
239+
Q_EMIT done(QByteArray(), QByteArray());
240240
}
241241
}
242242

@@ -250,13 +250,13 @@ ComputeChecksum *ValidateChecksumHeader::prepareStart(const QByteArray &checksum
250250
{
251251
// If the incoming header is empty no validation can happen. Just continue.
252252
if (checksumHeader.isEmpty()) {
253-
emit validated(QByteArray(), QByteArray());
253+
Q_EMIT validated(QByteArray(), QByteArray());
254254
return nullptr;
255255
}
256256

257257
if (!parseChecksumHeader(checksumHeader, &_expectedChecksumType, &_expectedChecksum)) {
258258
qCWarning(lcChecksums) << "Checksum header malformed:" << checksumHeader;
259-
emit validationFailed(tr("The checksum header is malformed."), _calculatedChecksumType, _calculatedChecksum, ChecksumHeaderMalformed);
259+
Q_EMIT validationFailed(tr("The checksum header is malformed."), _calculatedChecksumType, _calculatedChecksum, ChecksumHeaderMalformed);
260260
return nullptr;
261261
}
262262

@@ -290,16 +290,16 @@ void ValidateChecksumHeader::slotChecksumCalculated(const QByteArray &checksumTy
290290
_calculatedChecksum = checksum;
291291

292292
if (checksumType != _expectedChecksumType) {
293-
emit validationFailed(tr("The checksum header contained an unknown checksum type \"%1\"").arg(QString::fromLatin1(_expectedChecksumType)),
293+
Q_EMIT validationFailed(tr("The checksum header contained an unknown checksum type \"%1\"").arg(QString::fromLatin1(_expectedChecksumType)),
294294
_calculatedChecksumType, _calculatedChecksum, ChecksumTypeUnknown);
295295
return;
296296
}
297297
if (checksum != _expectedChecksum) {
298-
emit validationFailed(tr(R"(The downloaded file does not match the checksum, it will be resumed. "%1" != "%2")").arg(QString::fromUtf8(_expectedChecksum), QString::fromUtf8(checksum)),
298+
Q_EMIT validationFailed(tr(R"(The downloaded file does not match the checksum, it will be resumed. "%1" != "%2")").arg(QString::fromUtf8(_expectedChecksum), QString::fromUtf8(checksum)),
299299
_calculatedChecksumType, _calculatedChecksum, ChecksumMismatch);
300300
return;
301301
}
302-
emit validated(checksumType, checksum);
302+
Q_EMIT validated(checksumType, checksum);
303303
}
304304

305305
CSyncChecksumHook::CSyncChecksumHook() = default;

src/common/checksums.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class OCSYNC_EXPORT ComputeChecksum : public QObject
8181
*/
8282
static QByteArray computeNowOnFile(const QString &filePath, const QByteArray &checksumType);
8383

84-
signals:
84+
Q_SIGNALS:
8585
void done(const QByteArray &checksumType, const QByteArray &checksum);
8686

87-
private slots:
87+
private Q_SLOTS:
8888
void slotCalculationDone();
8989

9090
private:
@@ -128,12 +128,12 @@ class OCSYNC_EXPORT ValidateChecksumHeader : public QObject
128128
[[nodiscard]] QByteArray calculatedChecksumType() const;
129129
[[nodiscard]] QByteArray calculatedChecksum() const;
130130

131-
signals:
131+
Q_SIGNALS:
132132
void validated(const QByteArray &checksumType, const QByteArray &checksum);
133133
void validationFailed(const QString &errMsg, const QByteArray &calculatedChecksumType,
134134
const QByteArray &calculatedChecksum, const OCC::ValidateChecksumHeader::FailureReason reason);
135135

136-
private slots:
136+
private Q_SLOTS:
137137
void slotChecksumCalculated(const QByteArray &checksumType, const QByteArray &checksum);
138138

139139
private:

src/common/ownsql.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ auto SqlQuery::next() -> NextResult
323323
const bool firstStep = !sqlite3_stmt_busy(_stmt);
324324

325325
int n = 0;
326-
forever {
326+
Q_FOREVER {
327327
_errId = sqlite3_step(_stmt);
328328
if (n < SQLITE_REPEAT_COUNT && firstStep && (_errId == SQLITE_LOCKED || _errId == SQLITE_BUSY)) {
329329
sqlite3_reset(_stmt); // not necessary after sqlite version 3.6.23.1

src/common/syncjournaldb.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ bool SyncJournalDb::listAllE2eeFoldersWithEncryptionStatusLessThan(const int sta
11931193
return false;
11941194
}
11951195

1196-
forever {
1196+
Q_FOREVER {
11971197
auto next = query->next();
11981198
if (!next.ok) {
11991199
qCWarning(lcDb) << "database error:" << query->error();
@@ -1513,7 +1513,7 @@ bool SyncJournalDb::getFileRecordsByFileId(const QByteArray &fileId, const std::
15131513
return false;
15141514
}
15151515

1516-
forever {
1516+
Q_FOREVER {
15171517
auto next = query->next();
15181518
if (!next.ok) {
15191519
qCWarning(lcDb) << "database error:" << query->error();
@@ -1548,7 +1548,7 @@ bool SyncJournalDb::getFilesBelowPath(const QByteArray &path, const std::functio
15481548
return false;
15491549
}
15501550

1551-
forever {
1551+
Q_FOREVER {
15521552
auto next = query.next();
15531553
if (!next.ok) {
15541554
qCWarning(lcDb) << "database error:" << query.error();
@@ -1623,7 +1623,7 @@ bool SyncJournalDb::listFilesInPath(const QByteArray& path,
16231623
return false;
16241624
}
16251625

1626-
forever {
1626+
Q_FOREVER {
16271627
auto next = query->next();
16281628
if (!next.ok) {
16291629
qCWarning(lcDb) << "database error:" << query->error();
@@ -1850,7 +1850,7 @@ Optional<SyncJournalDb::HasHydratedDehydrated> SyncJournalDb::hasHydratedOrDehyd
18501850
}
18511851

18521852
HasHydratedDehydrated result;
1853-
forever {
1853+
Q_FOREVER {
18541854
auto next = query->next();
18551855
if (!next.ok) {
18561856
qCWarning(lcDb) << "database error:" << query->error();
@@ -2396,7 +2396,7 @@ QStringList SyncJournalDb::getSelectiveSyncList(SyncJournalDb::SelectiveSyncList
23962396
*ok = false;
23972397
return result;
23982398
}
2399-
forever {
2399+
Q_FOREVER {
24002400
auto next = query->next();
24012401
if (!next.ok) {
24022402
qCWarning(lcDb) << "database error:" << query->error();
@@ -3144,7 +3144,7 @@ Optional<PinState> SyncJournalDb::PinStateInterface::effectiveForPathRecursive(c
31443144
}
31453145

31463146
// Check if they are all identical
3147-
forever {
3147+
Q_FOREVER {
31483148
auto next = query->next();
31493149
if (!next.ok) {
31503150
qCWarning(lcDb) << "database error:" << query->error();
@@ -3226,7 +3226,7 @@ SyncJournalDb::PinStateInterface::rawList()
32263226
}
32273227

32283228
QVector<QPair<QByteArray, PinState>> result;
3229-
forever {
3229+
Q_FOREVER {
32303230
auto next = query.next();
32313231
if (!next.ok) {
32323232
qCWarning(lcDb) << "database error:" << query.error();

src/common/syncjournaldb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ class OCSYNC_EXPORT SyncJournalDb : public QObject
394394
*/
395395
int autotestFailCounter = -1;
396396

397-
public slots:
397+
public Q_SLOTS:
398398
/// Store a new or updated record in the database
399399
void setCaseConflictRecord(const OCC::ConflictRecord &record);
400400

src/common/vfs.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class OCSYNC_EXPORT Vfs : public QObject
286286
*/
287287
[[nodiscard]] virtual AvailabilityResult availability(const QString &folderPath, const AvailabilityRecursivity recursiveCheck) = 0;
288288

289-
public slots:
289+
public Q_SLOTS:
290290
/** Update in-sync state based on SyncFileStatusTracker signal.
291291
*
292292
* For some vfs plugins the icons aren't based on SocketAPI but rather on data shared
@@ -295,7 +295,7 @@ public slots:
295295
*/
296296
virtual void fileStatusChanged(const QString &systemFileName, OCC::SyncFileStatus fileStatus) = 0;
297297

298-
signals:
298+
Q_SIGNALS:
299299
/// Emitted when a user-initiated hydration starts
300300
void beginHydrating();
301301
/// Emitted when the hydration ends
@@ -361,7 +361,7 @@ class OCSYNC_EXPORT VfsOff : public Vfs
361361
Optional<PinState> pinState(const QString &) override { return PinState::AlwaysLocal; }
362362
AvailabilityResult availability(const QString &, const AvailabilityRecursivity) override { return VfsItemAvailability::AlwaysLocal; }
363363

364-
public slots:
364+
public Q_SLOTS:
365365
void fileStatusChanged(const QString &, OCC::SyncFileStatus) override {}
366366

367367
protected:

0 commit comments

Comments
 (0)