Skip to content

(RetroPie old image) Build failure due to Qt deprecated func. #243

@cmitu

Description

@cmitu

Description

On the old Buster image - still - used in RetroPie, the latest version fails to build due to the Qt::SkipEmptyParts usage (in src/strtools.cpp). The 1st occurence is guarded by a QT_VERSION check, but it seems that is not working, while the 2nd one is not guarded and it would fail anyway.

Technical information

  • Skyscraper version: 3.19
  • RetroPie 4.8.11 on the old Buster image

Additional context

The following patch fixes the build:

diff --git a/src/strtools.cpp b/src/strtools.cpp
index b8b5833..cb55500 100644
--- a/src/strtools.cpp
+++ b/src/strtools.cpp
@@ -270,7 +270,7 @@ QString StrTools::conformReleaseDate(QString str) {

 QString StrTools::conformTags(const QString str) {
     QString tags = "";
-#if QT_VERSION >= 0x050e00
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     QList<QString> tagList = str.split(',', Qt::SkipEmptyParts);
 #else
     // RP on Buster
@@ -419,7 +419,13 @@ QString StrTools::wrapText(const QString &inText, int width) {
     QStringList wrappedLines;
     int ptr = 0;
     QString line;
-    for (auto const &ws : inText.split(' ', Qt::SkipEmptyParts)) {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+    auto text = inText.split(' ', Qt::SkipEmptyParts);
+#else
+    // RP on Buster
+    auto text = inText.split(' ', QString::SkipEmptyParts);
+#endif
+    for (auto const &ws : text) {
         for (auto const &wn : ws.split('\n')) {
             bool nl = wn.isEmpty() || (wn != ws && !ws.endsWith(wn));
             if (nl || ptr + wn.length() >= width) {
@@ -443,4 +449,4 @@ QString StrTools::wrapText(const QString &inText, int width) {
     line.chop(1);
     wrappedLines.append(line);
     return wrappedLines.join("\n");
-}
\ No newline at end of file
+}

Do you want me to open a PR with the changes ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions