diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -107,7 +107,7 @@ GROUP_BASE_NAME KF VERSION ${KF5_VERSION} DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 4.0 4.1 4.3 4.4 4.5 4.6 4.7 5.0 5.4 5.6 5.25 5.31 5.32 5.64 5.66 + DEPRECATION_VERSIONS 4.0 4.1 4.3 4.4 4.5 4.6 4.7 5.0 5.4 5.6 5.25 5.31 5.32 5.64 5.66 5.70 ) # TODO: add support for EXCLUDE_DEPRECATED_BEFORE_AND_AT to all KIO libs # needs fixing of undeprecated API being still implemented using own deprecated API diff --git a/src/widgets/pixmaploader.h b/src/widgets/pixmaploader.h --- a/src/widgets/pixmaploader.h +++ b/src/widgets/pixmaploader.h @@ -28,11 +28,15 @@ namespace KIO { +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 70) /** * Convenience method to find the pixmap for a URL. * * Call this one when you don't know the mimetype. * + * @deprecated since 5.70, use KIO::iconNameForUrl() + * to get the icon name and use QIcon::fromTheme().pixmap() + * * @param url URL for the file. * @param dummy ignored (was a mode_t parameter in kdelibs 4) * @param group The icon group where the icon is going to be used. @@ -44,9 +48,11 @@ * Ignored if null pointer. * @return the pixmap of the URL, can be a default icon if not found */ + +KIOWIDGETS_DEPRECATED_VERSION(5, 70, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme().pixmap()") KIOWIDGETS_EXPORT QPixmap pixmapForUrl(const QUrl &url, int dummy = 0, KIconLoader::Group group = KIconLoader::Desktop, int force_size = 0, int state = 0, QString *path = nullptr); - +#endif } #endif /* KIO_PIXMAPLOADER_H */ diff --git a/src/widgets/pixmaploader.cpp b/src/widgets/pixmaploader.cpp --- a/src/widgets/pixmaploader.cpp +++ b/src/widgets/pixmaploader.cpp @@ -20,10 +20,12 @@ #include #include // iconNameForUrl +#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 70) QPixmap KIO::pixmapForUrl(const QUrl &url, int mode, KIconLoader::Group group, int force_size, int state, QString *path) { Q_UNUSED(mode); const QString iconName = KIO::iconNameForUrl(url); return KIconLoader::global()->loadMimeTypeIcon(iconName, group, force_size, state, QStringList(), path); } +#endif