From cbe41aeebf8866af4ef1cc05ef9b2bc48aefb6fc Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Sun, 18 Oct 2026 15:50:03 +0200 Subject: [PATCH] Previous versions: avoid the trigraph warnings of the file name pattern The glob "????-??-?? ??-??-??" contains the trigraph "??-", which GCC reports with -Wtrigraphs (8 warnings). The pattern is now written with "\?" escapes, in one place; it is the same string. --- sources/utils/previousversions.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sources/utils/previousversions.cpp b/sources/utils/previousversions.cpp index 9d741d3d0..b77950fc4 100644 --- a/sources/utils/previousversions.cpp +++ b/sources/utils/previousversions.cpp @@ -67,8 +67,11 @@ QStringList PreviousVersions::kept(const QString &file_path) const QDir dir(folder(file_path)); //Each copy has the time its version was saved (keep()); a .qet and //a .qetz of the same project are versions of it alike - QStringList names = dir.entryList({versionPrefix(info) + QStringLiteral("????-??-?? ??-??-??*.qet"), - versionPrefix(info) + QStringLiteral("????-??-?? ??-??-??*.qetz")}, + //"????-??-?? ??-??-??" written with "\?", so that the compiler doesn't + //see the trigraph "??-" in it (-Wtrigraphs) + const QString stamp_ = QStringLiteral("?\?\?\?-?\?-?\? ?\?-?\?-?\?"); + QStringList names = dir.entryList({versionPrefix(info) + stamp_ + QStringLiteral("*.qet"), + versionPrefix(info) + stamp_ + QStringLiteral("*.qetz")}, QDir::Files, QDir::Time); QStringList paths; for (const QString &name : std::as_const(names))