Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTBFS with Qt 6.9.0 #310

Open
tsimonq2 opened this issue Dec 3, 2024 · 3 comments · May be fixed by #311
Open

FTBFS with Qt 6.9.0 #310

tsimonq2 opened this issue Dec 3, 2024 · 3 comments · May be fixed by #311

Comments

@tsimonq2
Copy link
Member

tsimonq2 commented Dec 3, 2024

libqtxdg FTBFS against the tip of qtbase upstream with the following error:

In file included from /root/libqtxdg/src/xdgiconloader/xdgiconloader.cpp:37:
/root/libqtxdg/src/xdgiconloader/xdgiconloader_p.h:64:8: error: cannot derive from ‘final’ base ‘ScalableEntry’ in derived type ‘ScalableFollowsColorEntry’
   64 | struct ScalableFollowsColorEntry : public ScalableEntry
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~

This is due to https://code.qt.io/cgit/qt/qtbase.git/commit/?id=aa38df53b977d8c04123f8c0994d041d183a7971

At the top of the header file there is:

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

I'm not exactly sure how to address this.

@palinek
Copy link
Contributor

palinek commented Dec 3, 2024

Can you give a try this patch?

diff --git a/src/xdgiconloader/xdgiconloader.cpp b/src/xdgiconloader/xdgiconloader.cpp
index c299cca..2353ba4 100644
--- a/src/xdgiconloader/xdgiconloader.cpp
+++ b/src/xdgiconloader/xdgiconloader.cpp
@@ -439,7 +439,11 @@ QThemeIconInfo XdgIconLoader::findIconHelper(const QString &themeName,
                 } else if (gSupportsSvg) {
                     const QString svgPath = subDir + svgIconName;
                     if (QFile::exists(svgPath)) {
-                        std::unique_ptr<ScalableEntry> iconEntry = (followColorScheme() && theme.followsColorScheme()) ? std::make_unique<ScalableFollowsColorEntry>() : std::make_unique<ScalableEntry>();
+                        std::unique_ptr<QIconLoaderEngineEntry> iconEntry;
+                        if (followColorScheme() && theme.followsColorScheme())
+                            iconEntry = std::make_unique<ScalableFollowsColorEntry>();
+                        else
+                            iconEntry = std::make_unique<ScalableEntry>();
                         iconEntry->dir = dirInfo;
                         iconEntry->filename = svgPath;
                         info.entries.push_back(std::move(iconEntry));
diff --git a/src/xdgiconloader/xdgiconloader_p.h b/src/xdgiconloader/xdgiconloader_p.h
index 6c5f17f..cb990a9 100644
--- a/src/xdgiconloader/xdgiconloader_p.h
+++ b/src/xdgiconloader/xdgiconloader_p.h
@@ -61,13 +61,14 @@
 
 class XdgIconLoader;
 
-struct ScalableFollowsColorEntry : public ScalableEntry
+struct ScalableFollowsColorEntry : public QIconLoaderEngineEntry
 {
 #if (QT_VERSION >= QT_VERSION_CHECK(6,8,0))
     QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale) override;
 #else
     QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
 #endif
+    QIcon svgIcon;
 };
 
 //class QIconLoaderEngine : public QIconEngine

@tsimonq2
Copy link
Member Author

tsimonq2 commented Dec 9, 2024

@palinek Yes, that patch allows it to build. Thank you!

I will make sure the reverse dependencies build correctly with this change, but it should be good enough for a PR if you agree.

@palinek palinek linked a pull request Dec 10, 2024 that will close this issue
@palinek
Copy link
Contributor

palinek commented Dec 10, 2024

Created PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants