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.
This commit is contained in:
Laurent Trinques
2026-10-18 15:50:03 +02:00
parent ea2acfcaeb
commit cbe41aeebf
+5 -2
View File
@@ -67,8 +67,11 @@ QStringList PreviousVersions::kept(const QString &file_path)
const QDir dir(folder(file_path)); const QDir dir(folder(file_path));
//Each copy has the time its version was saved (keep()); a .qet and //Each copy has the time its version was saved (keep()); a .qet and
//a .qetz of the same project are versions of it alike //a .qetz of the same project are versions of it alike
QStringList names = dir.entryList({versionPrefix(info) + QStringLiteral("????-??-?? ??-??-??*.qet"), //"????-??-?? ??-??-??" written with "\?", so that the compiler doesn't
versionPrefix(info) + QStringLiteral("????-??-?? ??-??-??*.qetz")}, //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); QDir::Files, QDir::Time);
QStringList paths; QStringList paths;
for (const QString &name : std::as_const(names)) for (const QString &name : std::as_const(names))