Execute upon T12309. The KServiceOffer still takes a 'bool allowedAsDefault', that needs an overload, but in a different patch
This should be BUILD, not ENABLE.
*BUILD* macros are controlled by the EXCLUDE_DEPRECATED_BEFORE_AND_AT value, which iis what is used at build time of the library itself, and then hardcoded with the installed headers.
#if KSERVICE_ENABLE_DEPRECATED_SINCE(5, 65) AND KSERVICE_BUILD_DEPRECATED_SINCE(5, 65)
While it works to use *ENABLE* also in the sources, like the reuse works in the headers, it is bad practice as it blurs the purposes of the ENABLE vs the BUILD macros, where the latter is only to be set at build time of the library itself. So to not give people wrong ideas, the BUILD macros should be used everywhere where only in the build of the library itself it is deciced via the EXCLUDE_DEPRECATED_BEFORE_AND_AT value whether code should be part of the created library.
This makes kde-cli-tools fail to build for me with Qt 5.14 on openSUSE Tumbleweed:
[ 43%] Linking CXX executable ../bin/kioclient5 /home/nate/kde/src/kde-cli-tools/keditfiletype/mimetypedata.cpp: In member function ‘QStringList MimeTypeData::getAppOffers() const’: /home/nate/kde/src/kde-cli-tools/keditfiletype/mimetypedata.cpp:217:20: error: ‘class KService’ has no member named ‘allowAsDefault’ 217 | if ((*it)->allowAsDefault()) | ^~~~~~~~~~~~~~
I guess we found a use case. :)
(also merged to master)
It's not an actual use case for the feature when zero desktop file sets this field :)