diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 7fa889e5..60204a41 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -1,212 +1,212 @@ project(KIOWidgets) #include (ConfigureChecks.cmake) # Device desktop files aren't really used anymore set(KIO_NO_SOLID TRUE) find_package(ACL) set(HAVE_LIBACL ${ACL_FOUND}) set(HAVE_POSIX_ACL ${ACL_FOUND}) set_package_properties(ACL PROPERTIES DESCRIPTION "LibACL" URL "ftp://oss.sgi.com/projects/xfs/cmd_tars" TYPE RECOMMENDED PURPOSE "Support for manipulating access control lists") configure_file(config-kiowidgets.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kiowidgets.h) set(kiowidgets_SRCS accessmanager.cpp accessmanagerreply_p.cpp fileundomanager.cpp kacleditwidget.cpp kpropertiesdialog.cpp kurlrequesterdialog.cpp kurlcombobox.cpp kfileitemactions.cpp delegateanimationhandler.cpp imagefilter.cpp kfileitemdelegate.cpp kdesktopfileactions.cpp kopenwithdialog.cpp kfile.cpp pastedialog.cpp paste.cpp clipboardupdater.cpp kabstractfileitemactionplugin.cpp koverlayiconplugin.cpp kbuildsycocaprogressdialog.cpp kurlrequester.cpp krun.cpp sslui.cpp kurlpixmapprovider.cpp pixmaploader.cpp thumbsequencecreator.cpp thumbcreator.cpp kshellcompletion.cpp kurlcompletion.cpp kurifilter.cpp dropjob.cpp openfilemanagerwindowjob.cpp pastejob.cpp previewjob.cpp renamedialog.cpp ksslcertificatebox.cpp kdynamicjobtracker.cpp ksslinfodialog.cpp joburlcache.cpp skipdialog.cpp jobuidelegate.cpp kdirlister.cpp kdirmodel.cpp executablefileopendialog.cpp dndpopupmenuplugin.cpp kurifiltersearchprovideractions.cpp ) if (WIN32) list(APPEND kiowidgets_SRCS krun_win.cpp ) else() list(APPEND kiowidgets_SRCS kautomount.cpp ) endif() ecm_qt_declare_logging_category(kiowidgets_SRCS HEADER kio_widgets_debug.h IDENTIFIER KIO_WIDGETS CATEGORY_NAME kf5.kio.widgets) qt5_add_dbus_adaptor(kiowidgets_SRCS org.kde.kio.FileUndoManager.xml fileundomanager_p.h KIO::FileUndoManagerPrivate fileundomanager_adaptor KIOFileUndoManagerAdaptor) qt5_add_dbus_interface(kiowidgets_SRCS org.kde.kuiserver.xml kuiserver_interface) ki18n_wrap_ui(kiowidgets_SRCS checksumswidget.ui certificateparty.ui sslinfo.ui kpropertiesdesktopadvbase.ui kpropertiesdesktopbase.ui ) add_library(KF5KIOWidgets ${kiowidgets_SRCS}) add_library(KF5::KIOWidgets ALIAS KF5KIOWidgets) ecm_generate_export_header(KF5KIOWidgets BASE_NAME KIOWidgets 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 + 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 ) # 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 target_include_directories(KF5KIOWidgets INTERFACE "$") target_link_libraries(KF5KIOWidgets PUBLIC KF5::KIOCore KF5::JobWidgets KF5::Service Qt5::Network # SSL KF5::Completion # KUrlCompletion uses KCompletion KF5::WidgetsAddons # keditlistwidget PRIVATE Qt5::Concurrent Qt5::DBus KF5::I18n KF5::IconThemes # KIconLoader KF5::WindowSystem # KStartupInfo KF5::ConfigWidgets # KColorScheme ) if(ACL_FOUND) target_link_libraries(KF5KIOWidgets PRIVATE ${ACL_LIBS}) endif() set_target_properties(KF5KIOWidgets PROPERTIES VERSION ${KIO_VERSION_STRING} SOVERSION ${KIO_SOVERSION} EXPORT_NAME KIOWidgets ) # Headers not prefixed with KIO/ ecm_generate_headers(KIOWidgets_HEADERS HEADER_NAMES KPropertiesDialog KUrlRequesterDialog KUrlComboBox KFileItemActions KFileItemDelegate KAutoMount KDesktopFileActions KOpenWithDialog KAbstractFileItemActionPlugin KOverlayIconPlugin KBuildSycocaProgressDialog KFile KUrlRequester KRun KUrlPixmapProvider KSslCertificateBox KSslInfoDialog KDirLister KDirModel KShellCompletion KUrlCompletion KUriFilter REQUIRED_HEADERS KIOWidgets_HEADERS ) # Headers prefixed with KIO/ ecm_generate_headers(KIOWidgets_CamelCase_HEADERS HEADER_NAMES AccessManager SslUi ThumbSequenceCreator ThumbCreator DropJob DndPopupMenuPlugin OpenFileManagerWindowJob PasteJob PreviewJob RenameDialog SkipDialog JobUiDelegate FileUndoManager Paste PixmapLoader KUriFilterSearchProviderActions # KF6: fix and move to non-KIO prefixed install folder PREFIX KIO REQUIRED_HEADERS KIO_namespaced_widgets_HEADERS ) install(FILES ${KIOWidgets_CamelCase_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KIOWidgets/KIO COMPONENT Devel) install(TARGETS KF5KIOWidgets EXPORT KF5KIOTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES org.kde.kio.FileUndoManager.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} RENAME kf5_org.kde.kio.FileUndoManager.xml) install(FILES ${KIO_namespaced_widgets_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KIOWidgets/kio COMPONENT Devel) install(FILES ${KIOWidgets_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/kiowidgets_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KIOWidgets COMPONENT Devel) install(FILES kfileitemactionplugin.desktop kpropertiesdialogplugin.desktop kurifilterplugin.desktop konqpopupmenuplugin.desktop kiodndpopupmenuplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR} ) # make available to ecm_add_qch in parent folder set(KIOWidgets_QCH_SOURCES ${KIOWidgets_HEADERS} ${KIO_namespaced_widgets_HEADERS} PARENT_SCOPE) include(ECMGeneratePriFile) ecm_generate_pri_file(BASE_NAME KIOWidgets LIB_NAME KF5KIOWidgets DEPS "KIOCore KBookmarks KXmlGui Solid" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KIOWidgets) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff --git a/src/widgets/kurlpixmapprovider.cpp b/src/widgets/kurlpixmapprovider.cpp index aa72d694..ccc54f6a 100644 --- a/src/widgets/kurlpixmapprovider.cpp +++ b/src/widgets/kurlpixmapprovider.cpp @@ -1,44 +1,48 @@ /* This file is part of the KDE libraries Copyright (c) 2000 Carsten Pfeiffer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License (LGPL) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kurlpixmapprovider.h" #include #include #include +#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 66) + KUrlPixmapProvider::KUrlPixmapProvider() : d(nullptr) { } KUrlPixmapProvider::~KUrlPixmapProvider() { } QPixmap KUrlPixmapProvider::pixmapFor(const QString &url, int size) { const QUrl u = QUrl::fromUserInput(url); // absolute path or URL return KIO::pixmapForUrl(u, 0, KIconLoader::Desktop, size); } void KUrlPixmapProvider::virtual_hook(int id, void *data) { KPixmapProvider::virtual_hook(id, data); } + +#endif diff --git a/src/widgets/kurlpixmapprovider.h b/src/widgets/kurlpixmapprovider.h index 94bd12d5..1011d4b9 100644 --- a/src/widgets/kurlpixmapprovider.h +++ b/src/widgets/kurlpixmapprovider.h @@ -1,76 +1,85 @@ /* This file is part of the KDE libraries Copyright (c) 2000 Carsten Pfeiffer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License (LGPL) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KURLPIXMAPPROVIDER_H #define KURLPIXMAPPROVIDER_H #include "kiowidgets_export.h" #include /** * @class KUrlPixmapProvider kurlpixmapprovider.h * * Implementation of KPixmapProvider. * * Uses KMimeType::pixmapForURL() to resolve icons. * * Instantiate this class and supply it to the desired class, e.g. * \code * KHistoryComboBox *combo = new KHistoryComboBox(this); * combo->setPixmapProvider(new KUrlPixmapProvider); * [...] * \endcode * * @short Resolves pixmaps for URLs * @author Carsten Pfeiffer + * + * @deprecated since 5.66, use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme */ +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 66) + class KIOWIDGETS_EXPORT KUrlPixmapProvider : public KPixmapProvider { public: /** * Creates a new url pixmap provider. */ + KIOWIDGETS_DEPRECATED_VERSION(5, 66, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme") KUrlPixmapProvider(); /** * Destroys the url pixmap provider. */ + KIOWIDGETS_DEPRECATED_VERSION(5, 66, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme") ~KUrlPixmapProvider(); /** * Returns a pixmap for @p url with size @p size. * * Uses KMimeType::pixmapForURL(). * * @param url the URL to fetch a pixmap for * @param size the size of the pixmap in pixels, or 0 for default. * @return the resulting pixmap * @see KIconLoader::StdSizes */ + KIOWIDGETS_DEPRECATED_VERSION(5, 66, "Use KIO::iconNameForUrl to get the icon name and use QIcon::fromTheme") QPixmap pixmapFor(const QString &url, int size = 0) override; protected: void virtual_hook(int id, void *data) override; private: class Private; Private *const d; }; +#endif + #endif // KURLPIXMAPPROVIDER_H