Bug 503282

Summary: ktextaddons-1.5.4 fails compile
Product: [Frameworks and Libraries] ktextaddons Reporter: Taurnil <taurnil.oronar>
Component: generalAssignee: Laurent Montel <montel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: ktextaddons-1.5.4 compile log

Description Taurnil 2025-04-24 11:39:20 UTC
Created attachment 180607 [details]
ktextaddons-1.5.4 compile log

Operating System: Lunar Linux 1.8.0-future-20250414-x86_64
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.2 (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7 CPU       X 980  @ 3.33GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060/PCIe/SSE2


***

SUMMARY
The compile fails at this point;

 54%] Building CXX object texttranslator/translator/plugins/google/CMakeFiles/translator_google.dir/googleengineplugin.cpp.o
/usr/src/ktextaddons-1.5.4/texttranslator/translator/plugins/google/googleengineplugin.cpp: In member function 'void GoogleEnginePlugin::slotTranslateFinished(QNetworkReply*)':
/usr/src/ktextaddons-1.5.4/texttranslator/translator/plugins/google/googleengineplugin.cpp:73:66: error: invalid use of incomplete type 'class QRegularExpression'
   73 |     mJsonData.replace(QRegularExpression(QStringLiteral(",{3,3}")), QStringLiteral(",\"\",\"\","));
      |                                                                  ^
In file included from /usr/lib/include/qt6/QtCore/qbytearrayview.h:9,
                 from /usr/lib/include/qt6/QtCore/qbytearray.h:15,
                 from /usr/lib/include/qt6/QtCore/qstringview.h:10,
                 from /usr/lib/include/qt6/QtCore/qchar.h:728,
                 from /usr/lib/include/qt6/QtCore/qstring.h:14,
                 from /usr/lib/include/qt6/QtCore/qobject.h:11,
                 from /usr/lib/include/qt6/QtCore/qiodevice.h:10,
                 from /usr/lib/include/qt6/QtCore/QIODevice:1,
                 from /usr/lib/include/qt6/QtNetwork/qnetworkreply.h:8,
                 from /usr/lib/include/qt6/QtNetwork/QNetworkReply:1,
                 from /usr/src/ktextaddons-1.5.4/ktextaddons-oosb/texttranslator/texttranslator/../../../texttranslator/translator/translatorengineplugin.h:10,
                 from /usr/src/ktextaddons-1.5.4/ktextaddons-oosb/texttranslator/texttranslator/translatorengineplugin.h:1,
                 from /usr/src/ktextaddons-1.5.4/ktextaddons-oosb/texttranslator/TextTranslator/TranslatorEnginePlugin:1,
                 from /usr/src/ktextaddons-1.5.4/texttranslator/translator/plugins/google/googleengineplugin.h:9,
                 from /usr/src/ktextaddons-1.5.4/texttranslator/translator/plugins/google/googleengineplugin.cpp:7:
/usr/lib/include/qt6/QtCore/qstringfwd.h:44:7: note: forward declaration of 'class QRegularExpression'
   44 | class QRegularExpression;
      |       ^~~~~~~~~~~~~~~~~~
/usr/src/ktextaddons-1.5.4/texttranslator/translator/plugins/google/googleengineplugin.cpp:74:66: error: invalid use of incomplete type 'class QRegularExpression'
   74 |     mJsonData.replace(QRegularExpression(QStringLiteral(",{2,2}")), QStringLiteral(",\"\","));
      |                                                                  ^
/usr/lib/include/qt6/QtCore/qstringfwd.h:44:7: note: forward declaration of 'class QRegularExpression'
   44 | class QRegularExpression;
      |       ^~~~~~~~~~~~~~~~~~
make[2]: *** [texttranslator/translator/plugins/google/CMakeFiles/translator_google.dir/build.make:127: texttranslator/translator/plugins/google/CMakeFiles/translator_google.dir/googleengineplugin.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:18793: texttranslator/translator/plugins/google/CMakeFiles/translator_google.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

ADDITIONAL INFORMATION
ktextaddson-1.5.2 fails in the same way. I'm guessing this has to do with some change in the "latest" qt-6.9.0.
Comment 1 Laurent Montel 2025-04-24 11:46:53 UTC
already fixed in ktextaddon 1.5.5 (not released yet)
Comment 2 Taurnil 2025-04-24 12:48:05 UTC
(In reply to Laurent Montel from comment #1)
> already fixed in ktextaddon 1.5.5 (not released yet)

Thanks. Is there a patch available, if so where?
Comment 3 Laurent Montel 2025-04-24 12:50:22 UTC
git show 5db06890d8ccc3ef49db09c684bc3ed3982dab6f
commit 5db06890d8ccc3ef49db09c684bc3ed3982dab6f
Author: Laurent Montel <montel@kde.org>
Date:   Sun Apr 20 10:40:28 2025 +0200

    Add missing include

diff --git a/texttranslator/translator/plugins/google/googleengineplugin.cpp b/texttranslator/translator/plugins/google/googleengineplugin.cpp
index f7400dd3..41c35ea1 100644
--- a/texttranslator/translator/plugins/google/googleengineplugin.cpp
+++ b/texttranslator/translator/plugins/google/googleengineplugin.cpp
@@ -12,6 +12,7 @@
 #include <QNetworkAccessManager>
 #include <QNetworkReply>
 #include <QNetworkRequest>
+#include <QRegularExpression>
 #include <QUrlQuery>
 #include <TextTranslator/TranslatorEngineAccessManager>