Bug 456975

Summary: src/keychainaccountmanager.cpp:50:16: error: expected primary-expression before ‘const’
Product: [Frameworks and Libraries] kio-gdrive Reporter: Andreas Sturmlechner <asturm>
Component: generalAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 22.07.80   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=439639
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: kde-misc:kio-gdrive-22.07.80:20220721-093859.log

Description Andreas Sturmlechner 2022-07-21 09:51:48 UTC
Created attachment 150786 [details]
kde-misc:kio-gdrive-22.07.80:20220721-093859.log

Build error snippet:

> src/keychainaccountmanager.cpp:50:16: error: expected primary-expression before ‘const’
>    50 |     Q_FOREACH (const QString &scope, scopes) {
>       |                ^~~~~
> src/keychainaccountmanager.cpp:50:5: error: ‘Q_FOREACH’ was not declared in this scope; did you mean ‘Q_FOREVER’?
>    50 |     Q_FOREACH (const QString &scope, scopes) {
>       |     ^~~~~~~~~
>       |     Q_FOREVER
> src/keychainaccountmanager.cpp: In member function ‘void KeychainAccountManager::storeAccount(const AccountPtr&)’:
> src/keychainaccountmanager.cpp:93:16: error: expected primary-expression before ‘const’
>    93 |     Q_FOREACH (const QUrl &scope, account->scopes()) {
>       |                ^~~~~
> src/keychainaccountmanager.cpp:93:5: error: ‘Q_FOREACH’ was not declared in this scope; did you mean ‘Q_FOREVER’?
>    93 |     Q_FOREACH (const QUrl &scope, account->scopes()) {
>       |     ^~~~~~~~~
>       |     Q_FOREVER
> ninja: build stopped: subcommand failed.

STEPS TO REPRODUCE
Try to build kio-gdrive-22.07.80 with:
-DCMAKE_DISABLE_FIND_PACKAGE_KAccounts=ON
-DCMAKE_DISABLE_FIND_PACKAGE_KF5Purpose=ON

Interestingly, 22.04.3 builds fine with that configuration.

Attaching build.log with MAKEOPTS=-j1.
Comment 1 Bug Janitor Service 2022-07-21 12:04:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-gdrive/-/merge_requests/14
Comment 2 Elvis Angelaccio 2022-08-01 20:59:24 UTC
Git commit 1b0ac81dba8aa70bf421cae84c83a6aef6553fb5 by Elvis Angelaccio, on behalf of Nicolas Fella.
Committed on 01/08/2022 at 20:55.
Pushed by nicolasfella into branch 'master'.

Fully port away from Q_FOREACH

M  +1    -1    autotests/listtest.cpp
M  +3    -2    src/keychainaccountmanager.cpp

https://invent.kde.org/network/kio-gdrive/commit/1b0ac81dba8aa70bf421cae84c83a6aef6553fb5
Comment 3 Nicolas Fella 2022-08-01 21:04:24 UTC
Git commit 3d86169c6ba7d40ea35a45c4a0b71e95f54d11f1 by Nicolas Fella.
Committed on 01/08/2022 at 21:04.
Pushed by nicolasfella into branch 'release/22.08'.

Fully port away from Q_FOREACH
(cherry picked from commit 1b0ac81dba8aa70bf421cae84c83a6aef6553fb5)

M  +1    -1    autotests/listtest.cpp
M  +3    -2    src/keychainaccountmanager.cpp

https://invent.kde.org/network/kio-gdrive/commit/3d86169c6ba7d40ea35a45c4a0b71e95f54d11f1