git: 76b77437de64 - main - www/ladybird: Fix build with Qt 6.8.x

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Tue, 17 Dec 2024 06:09:04 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=76b77437de642cdf13a24cb518b15d1bb81ba528

commit 76b77437de642cdf13a24cb518b15d1bb81ba528
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2024-12-17 05:47:26 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-12-17 05:54:56 +0000

    www/ladybird: Fix build with Qt 6.8.x
    
    While not offically deprecated until Qt 6.9, use of the
    QCheckBox::stateChanged() signal fails with -Werror due to the
    deprecation warnings added in Qt 6.8. This signal has been replaced
    by QCheckBox::checkStateChanged().
    
    PR:             283290
    Approved by:    portmgr (blanket)
---
 .../files/patch-Ladybird_Qt_SettingsDialog.cpp     | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/www/ladybird/files/patch-Ladybird_Qt_SettingsDialog.cpp b/www/ladybird/files/patch-Ladybird_Qt_SettingsDialog.cpp
new file mode 100644
index 000000000000..ea5fa8f1dd0c
--- /dev/null
+++ b/www/ladybird/files/patch-Ladybird_Qt_SettingsDialog.cpp
@@ -0,0 +1,28 @@
+While not offically deprecated until Qt 6.9, use of the
+QCheckBox::stateChanged() signal fails with -Werror due to the
+deprecation warnings added in Qt 6.8. This signal has been replaced
+by QCheckBox::checkStateChanged().
+
+--- Ladybird/Qt/SettingsDialog.cpp.orig	2024-05-05 05:45:42 UTC
++++ Ladybird/Qt/SettingsDialog.cpp
+@@ -99,12 +99,20 @@ void SettingsDialog::setup_search_engines()
+     m_autocomplete_engine_dropdown->setMenu(autocomplete_engine_menu);
+     m_autocomplete_engine_dropdown->setEnabled(Settings::the()->enable_autocomplete());
+ 
++#if (QT_VERSION > QT_VERSION_CHECK(6, 7, 0))
++    connect(m_enable_search, &QCheckBox::checkStateChanged, this, [&](int state) {
++#else
+     connect(m_enable_search, &QCheckBox::stateChanged, this, [&](int state) {
++#endif
+         Settings::the()->set_enable_search(state == Qt::Checked);
+         m_search_engine_dropdown->setEnabled(state == Qt::Checked);
+     });
+ 
++#if (QT_VERSION > QT_VERSION_CHECK(6, 7, 0))
++    connect(m_enable_autocomplete, &QCheckBox::checkStateChanged, this, [&](int state) {
++#else
+     connect(m_enable_autocomplete, &QCheckBox::stateChanged, this, [&](int state) {
++#endif
+         Settings::the()->set_enable_autocomplete(state == Qt::Checked);
+         m_autocomplete_engine_dropdown->setEnabled(state == Qt::Checked);
+     });