https://bugs.kde.org/show_bug.cgi?id=509891
Bug ID: 509891 Summary: Qt6 build compatibility issue: Q_FOREACH macro still used Classification: I don't know Product: kde Version First unspecified Reported In: Platform: Other OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: general Assignee: unassigned-b...@kde.org Reporter: jshand2...@gmail.com Target Milestone: --- Operating System: openSUSE Tumbleweed 20250923 KDE Plasma Version: 6.4.5 KDE Frameworks Version: 6.18.0 Qt Version: 6.9.2 Kernel Version: 6.16.8-1-default (64-bit) Graphics Platform: Wayland Processors: 12 × Intel® Core™ 7 150U Memory: 16 GiB of RAM (15.3 GiB usable) Graphics Processor: Intel® Graphics Manufacturer: Dell Inc. Product Name: Inspiron 16 5640 Qt6 build compatibility issue: Q_FOREACH macro still used **Severity:** Medium **Area:** Server / SearchManager ## Description Code targets Qt6 (`find_package(Qt6...)`), but still uses `Q_FOREACH` macro in `SearchManager`. This macro was removed in Qt6; compilation may rely on compat headers or fail on some setups. ## Evidence /mnt/data/akonadi_extracted/akonadi/src/server/search/searchmanager.cpp lines 96–101: ``` 96| * and causes crash on Akonadi shutdown (below main). Keeping the plugins 97| * loaded is not really a big issue as this is only invoked on server shutdown 98| * anyway, so we are not leaking any memory. 99| Q_FOREACH (QPluginLoader *loader, mPluginLoaders) { 100| loader->unload(); 101| delete loader; ``` ## Steps to Reproduce 1. Build Akonadi against a strict Qt6 environment without Qt5Compat headers. 2. Compilation errors occur at `Q_FOREACH` usage. ## Expected Behavior Code should compile cleanly under Qt6 without deprecated Qt5 macros. ## Actual Behavior `Q_FOREACH` persists in codebase. ## Suggested Fix / Next Steps - Replace `Q_FOREACH` with C++11 range-based for loop: `for (auto *loader : mPluginLoaders) { ... }`. - Remove any remaining uses of `foreach`/`Q_FOREACH` macros. -- You are receiving this mail because: You are watching all bug changes.