diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,13 +19,13 @@ set(REQUIRED_QT_VERSION 5.11.0) find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) - -include(GenerateExportHeader) - +include(ECMGenerateExportHeader) include(ECMSetupVersion) include(ECMGenerateHeaders) include(ECMAddQch) +set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") + option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,8 +15,20 @@ ecm_qt_declare_logging_category(kitemmodels_SRCS HEADER kitemmodels_debug.h IDENTIFIER KITEMMODELS_LOG CATEGORY_NAME kf5.kitemmodels) add_library(KF5ItemModels ${kitemmodels_SRCS}) -generate_export_header(KF5ItemModels BASE_NAME KItemModels) add_library(KF5::ItemModels ALIAS KF5ItemModels) +ecm_generate_export_header(KF5ItemModels + BASE_NAME KItemModels + # GROUP_BASE_NAME KF <- enable once all of KF modules use ecm_generate_export_header + VERSION ${KF5_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 4.8 + EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} +) +# reminder trigger to apply KITEMMODELS_ENABLE_DEPRECATED_SINCE & friends to KConcatenateRowsProxyModel when the time is there +if (REQUIRED_QT_VERSION VERSION_GREATER 5.12.0) + message(WARNING "With Qt 5.13 as min dep, mark KConcatenateRowsProxyModel as deprecated to the compiler & remove this warning") +endif() + target_include_directories(KF5ItemModels INTERFACE "$") diff --git a/src/kdescendantsproxymodel.h b/src/kdescendantsproxymodel.h --- a/src/kdescendantsproxymodel.h +++ b/src/kdescendantsproxymodel.h @@ -104,12 +104,15 @@ */ void setSourceModel(QAbstractItemModel *model) override; +#if KITEMMODELS_ENABLE_DEPRECATED_SINCE(4, 8) /** - * @deprecated + * @deprecated Since 4.8 * * This method does nothing. */ + KITEMMODELS_DEPRECATED_VERSION(4, 8, "Method is a no-op.") void setRootIndex(const QModelIndex &index); +#endif /** * Set whether to show ancestor data in the model. If @p display is true, then diff --git a/src/kdescendantsproxymodel.cpp b/src/kdescendantsproxymodel.cpp --- a/src/kdescendantsproxymodel.cpp +++ b/src/kdescendantsproxymodel.cpp @@ -208,10 +208,12 @@ delete d_ptr; } +#if KITEMMODELS_BUILD_DEPRECATED_SINCE(4, 8) void KDescendantsProxyModel::setRootIndex(const QModelIndex &index) { Q_UNUSED(index) } +#endif QModelIndexList KDescendantsProxyModel::match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const {