Solved qt5-style-plugins patch to install with qt 5.15.0

These simple patches will help to compile x11-themes/qt5-style-plugins with devel/qt5 version 5.15.0
Works well, so we could unset BROKEN flag on current port after approving patches.

To install with currently setted BROKEN flag:

cd /usr/ports/x11-themes/qt5-style-plugins && make -DTRYBROKEN install clean

These patches are taken from Arch Linux user repository.

patch-src_plugins_styles_gtk2_qgtkstyle.cpp.txt
Code:
--- src/qplugins/styles/gtk2/gtkstyle.cpp.orig    2020-07-07 23:02:40 UTC
+++ src/plugins/styles/gtk2/qgtkstyle.cpp
@@ -440,7 +440,11 @@ void QGtkStyle::polish(QApplication *app)
     // not supported as these should be entirely determined by
     // current Gtk settings
     if (app->desktopSettingsAware() && d->isThemeAvailable()) {
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
         QApplicationPrivate::setSystemPalette(standardPalette());
+#else
+        QApplication::setPalette(standardPalette());
+#endif
         QApplicationPrivate::setSystemFont(d->getThemeFont());
         d->applyCustomPaletteHash();
         if (!d->isKDE4Session())

patch-src_plugins_styles_gtk2_qgtkstyle_p.cpp.txt
Code:
--- src/plugins/styles/gtk2/qgtkstyle_p.cpp.orig    2020-07-07 23:06:26 UTC
+++ src/plugins/styles/gtk2/qgtkstyle_p.cpp
@@ -508,7 +508,9 @@ void QGtkStyleUpdateScheduler::updateTheme()
       if (oldTheme != QGtkStylePrivate::getThemeName()) {
           oldTheme = QGtkStylePrivate::getThemeName();
           QPalette newPalette = qApp->style()->standardPalette();
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
           QApplicationPrivate::setSystemPalette(newPalette);
+#endif
           QApplication::setPalette(newPalette);
           if (!QGtkStylePrivate::instances.isEmpty()) {
               QGtkStylePrivate::instances.last()->initGtkWidgets();
 

Attachments

  • patch-src_plugins_styles_gtk2_qgtkstyle.cpp.txt
    651 bytes · Views: 169
  • patch-src_plugins_styles_gtk2_qgtkstyle_p.cpp.txt
    654 bytes · Views: 170
I see you've added them to the PR and they've now been committed. Excellent.

It's OK if you want to ask about patches or ask for advice on how to patch here. But the actual patches should be attached to the PR. A committer isn't going to browse to the forums looking for them.
 
Back
Top