Changeset View
Changeset View
Standalone View
Standalone View
src/services/kservice.cpp
Show First 20 Lines • Show All 973 Lines • ▼ Show 20 Line(s) | 973 | for (; it < d->m_serviceTypes.end(); ++it) { | |||
---|---|---|---|---|---|
974 | const QString sv = (*it).serviceType; | 974 | const QString sv = (*it).serviceType; | ||
975 | if (db.mimeTypeForName(sv).isValid()) { // keep only mimetypes, filter out servicetypes | 975 | if (db.mimeTypeForName(sv).isValid()) { // keep only mimetypes, filter out servicetypes | ||
976 | ret.append(sv); | 976 | ret.append(sv); | ||
977 | } | 977 | } | ||
978 | } | 978 | } | ||
979 | return ret; | 979 | return ret; | ||
980 | } | 980 | } | ||
981 | 981 | | |||
982 | #if KSERVICE_BUILD_DEPRECATED_SINCE(5, 67) | ||||
kossebau: This should be BUILD, not ENABLE.
*BUILD* macros are controlled by the… | |||||
982 | bool KService::allowAsDefault() const | 983 | bool KService::allowAsDefault() const | ||
983 | { | 984 | { | ||
984 | Q_D(const KService); | 985 | Q_D(const KService); | ||
985 | return d->m_bAllowAsDefault; | 986 | return d->m_bAllowAsDefault; | ||
986 | } | 987 | } | ||
988 | #endif | ||||
987 | 989 | | |||
988 | int KService::initialPreference() const | 990 | int KService::initialPreference() const | ||
989 | { | 991 | { | ||
990 | Q_D(const KService); | 992 | Q_D(const KService); | ||
991 | return d->m_initialPreference; | 993 | return d->m_initialPreference; | ||
992 | } | 994 | } | ||
993 | 995 | | |||
994 | void KService::setTerminal(bool b) | 996 | void KService::setTerminal(bool b) | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
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.
*ENABLE* macros are controlled by KF_DISABLE_DEPRECATED_BEFORE_AND_AT value, which is used when building against the library, and can be controlled by the user of the library.
To avoid duplication, the *ENABLE* macros are also reused in the headers during the build time of the library itself, to not to have to write
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.