diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/core/kauthorized.cpp | 2 | ||||
| -rw-r--r-- | src/core/kauthorized.h | 5 | ||||
| -rw-r--r-- | src/core/kconfig.cpp | 4 | ||||
| -rw-r--r-- | src/core/kconfig.h | 18 | ||||
| -rw-r--r-- | src/core/kconfiggroup.cpp | 4 | ||||
| -rw-r--r-- | src/core/kconfiggroup.h | 15 | ||||
| -rw-r--r-- | src/core/kcoreconfigskeleton.cpp | 28 | ||||
| -rw-r--r-- | src/core/kcoreconfigskeleton.h | 44 | ||||
| -rw-r--r-- | src/core/kdesktopfile.cpp | 2 | ||||
| -rw-r--r-- | src/core/kdesktopfile.h | 5 | ||||
| -rw-r--r-- | src/core/kemailsettings.cpp | 20 | ||||
| -rw-r--r-- | src/core/kemailsettings.h | 16 | 
13 files changed, 106 insertions, 66 deletions
| diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 45f21471..da48ce8f 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -21,8 +21,15 @@ ecm_qt_declare_logging_category(libkconfigcore_SRCS  configure_file(config-kconfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kconfig.h )  add_library(KF5ConfigCore ${libkconfigcore_SRCS}) -generate_export_header(KF5ConfigCore BASE_NAME KConfigCore)  add_library(KF5::ConfigCore ALIAS KF5ConfigCore) +ecm_generate_export_header(KF5ConfigCore +    BASE_NAME KConfigCore +    # 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.0 5.0 5.24 5.42 +    EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} +)  target_compile_definitions(KF5ConfigCore      PRIVATE diff --git a/src/core/kauthorized.cpp b/src/core/kauthorized.cpp index aefd3faf..bf2142f6 100644 --- a/src/core/kauthorized.cpp +++ b/src/core/kauthorized.cpp @@ -229,7 +229,7 @@ bool KAuthorized::authorizeAction(const QString &action)      return authorize(QLatin1String("action/") + action);  } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 24)  bool KAuthorized::authorizeKAction(const QString &action)  {      return authorizeAction(action); diff --git a/src/core/kauthorized.h b/src/core/kauthorized.h index 5ace4db9..5f67b6ec 100644 --- a/src/core/kauthorized.h +++ b/src/core/kauthorized.h @@ -96,6 +96,7 @@ KCONFIGCORE_EXPORT bool authorize(const QString &action);   */  KCONFIGCORE_EXPORT bool authorizeAction(const QString &action); +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 24)  /**   * Returns whether the user is permitted to perform a certain action.   * @@ -121,8 +122,8 @@ KCONFIGCORE_EXPORT bool authorizeAction(const QString &action);   * @see authorize()   * @deprecated since 5.24, use authorizeAction() instead.   */ -#ifndef KDE_NO_DEPRECATED -KCONFIGCORE_DEPRECATED_EXPORT bool authorizeKAction(const QString &action); +KCONFIGCORE_DEPRECATED_VERSION(5, 24, "Use KAuthorized::authorizeAction(const QString&)") +KCONFIGCORE_EXPORT bool authorizeKAction(const QString &action);  #endif  /** diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 1b3f082b..6d6a1ac6 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -847,7 +847,7 @@ bool KConfig::isGroupImmutableImpl(const QByteArray &aGroup) const      return isImmutable() || d->entryMap.getEntryOption(aGroup, nullptr, nullptr, KEntryMap::EntryImmutable);  } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(4, 0)  void KConfig::setForceGlobal(bool b)  {      Q_D(KConfig); @@ -855,7 +855,7 @@ void KConfig::setForceGlobal(bool b)  }  #endif -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(4, 0)  bool KConfig::forceGlobal() const  {      Q_D(const KConfig); diff --git a/src/core/kconfig.h b/src/core/kconfig.h index b771b881..db4fb905 100644 --- a/src/core/kconfig.h +++ b/src/core/kconfig.h @@ -324,29 +324,29 @@ public:      /// @}      /// @{ global +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(4, 0)      /** -     * @deprecated -     *       * Forces all following write-operations to be performed on @c kdeglobals,       * independent of the @c Global flag in writeEntry().       *       * @param force true to force writing to kdeglobals       * @see forceGlobal +     * @deprecated Since 4.0       */ -#ifndef KDE_NO_DEPRECATED -    KCONFIGCORE_DEPRECATED void setForceGlobal(bool force); +    KCONFIGCORE_DEPRECATED_VERSION(4, 0, "Not recommended") +    void setForceGlobal(bool force);  #endif + +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(4, 0)      /** -     * @deprecated -     *       * Returns whether all entries are being written to @c kdeglobals.       *       * @return @c true if all entries are being written to @c kdeglobals       * @see setForceGlobal -     * @deprecated +     * @deprecated Since 4.0       */ -#ifndef KDE_NO_DEPRECATED -    KCONFIGCORE_DEPRECATED bool forceGlobal() const; +    KCONFIGCORE_DEPRECATED_VERSION(4, 0, "Not recommended") +    bool forceGlobal() const;  #endif      /// @} diff --git a/src/core/kconfiggroup.cpp b/src/core/kconfiggroup.cpp index 32dcb458..c9c93d00 100644 --- a/src/core/kconfiggroup.cpp +++ b/src/core/kconfiggroup.cpp @@ -574,7 +574,7 @@ void KConfigGroup::deleteGroup(WriteConfigFlags flags)      config()->deleteGroup(d->fullName(), flags);  } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  void KConfigGroup::changeGroup(const QString &group)  {      Q_ASSERT_X(isValid(), "KConfigGroup::changeGroup", "accessing an invalid group"); @@ -583,7 +583,7 @@ void KConfigGroup::changeGroup(const QString &group)  }  #endif -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  void KConfigGroup::changeGroup(const char *group)  {      Q_ASSERT_X(isValid(), "KConfigGroup::changeGroup", "accessing an invalid group"); diff --git a/src/core/kconfiggroup.h b/src/core/kconfiggroup.h index 0f04b1f7..54946b86 100644 --- a/src/core/kconfiggroup.h +++ b/src/core/kconfiggroup.h @@ -141,23 +141,26 @@ public:       */      const KConfig *config() const; +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /**       * Changes the group of the object       * -     * @deprecated +     * @deprecated Since 5.0       * Create another KConfigGroup from the parent of this group instead.       */ -#ifndef KDE_NO_DEPRECATED -    KCONFIGCORE_DEPRECATED void changeGroup(const QString &group); +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Create another KConfigGroup from the parent of this group") +    void changeGroup(const QString &group);  #endif + +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /**       * Overload for changeGroup(const QString&)       * -     * @deprecated +     * @deprecated Since 5.0.       * Create another KConfigGroup from the parent of this group instead.       */ -#ifndef KDE_NO_DEPRECATED -    KCONFIGCORE_DEPRECATED void changeGroup(const char *group); +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Create another KConfigGroup from the parent of this group") +    void changeGroup(const char *group);  #endif      /** diff --git a/src/core/kcoreconfigskeleton.cpp b/src/core/kcoreconfigskeleton.cpp index 34c58ff6..b9c9f2ac 100644 --- a/src/core/kcoreconfigskeleton.cpp +++ b/src/core/kcoreconfigskeleton.cpp @@ -1162,38 +1162,34 @@ void KCoreConfigSkeleton::usrSetDefaults()  {  } -#ifdef Q_CC_GNU -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif  void KCoreConfigSkeleton::usrRead()  { +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)      usrReadConfig(); -} -#ifdef Q_CC_GNU -#pragma GCC diagnostic pop  #endif +} +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  void KCoreConfigSkeleton::usrReadConfig()  {  } - -#ifdef Q_CC_GNU -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations"  #endif +  bool KCoreConfigSkeleton::usrSave()  { +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)      return usrWriteConfig(); -} -#ifdef Q_CC_GNU -#pragma GCC diagnostic pop +#else +    return true;  #endif +} +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  bool KCoreConfigSkeleton::usrWriteConfig()  {      return true;  } +#endif  void KCoreConfigSkeleton::addItem(KConfigSkeletonItem *item, const QString &name)  { @@ -1315,7 +1311,7 @@ KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemLongLong(const QS      return item;  } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  KCoreConfigSkeleton::ItemLongLong *KCoreConfigSkeleton::addItemInt64(      const QString &name,      qint64 &reference, @@ -1336,7 +1332,7 @@ KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemULongLong(const      return item;  } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  KCoreConfigSkeleton::ItemULongLong *KCoreConfigSkeleton::addItemUInt64(      const QString &name,      quint64 &reference, diff --git a/src/core/kcoreconfigskeleton.h b/src/core/kcoreconfigskeleton.h index 16ff0417..76b78a20 100644 --- a/src/core/kcoreconfigskeleton.h +++ b/src/core/kcoreconfigskeleton.h @@ -684,8 +684,8 @@ public:          qint64 mMin;          qint64 mMax;      }; -#ifndef KDE_NO_DEPRECATED -    typedef KCONFIGCORE_DEPRECATED ItemLongLong ItemInt64; +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0) +    typedef KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Use ItemLongLong") ItemLongLong ItemInt64;  #endif      /** @@ -804,8 +804,8 @@ public:          quint64 mMin;          quint64 mMax;      }; -#ifndef KDE_NO_DEPRECATED -    typedef KCONFIGCORE_DEPRECATED ItemULongLong ItemUInt64; +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0) +    typedef KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Use ItemULongLong") ItemULongLong ItemUInt64;  #endif      /** @@ -1076,12 +1076,13 @@ public:       */      void load(); -#ifndef KCONFIGCORE_NO_DEPRECATED +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /**       * @deprecated since 5.0, call load() instead (to reload from disk) or just read()       * if the underlying KConfig object is already up-to-date.       */ -    KCONFIGCORE_DEPRECATED void readConfig() +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Use KCoreConfigSkeleton::load() or KCoreConfigSkeleton::read()") +    void readConfig()      {          load();      } @@ -1261,12 +1262,12 @@ public:                                    qint64 defaultValue = 0,                                    const QString &key = QString()); +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /** -     * @deprecated -     * Use addItemLongLong(). +     * @deprecated Since 5.0, use addItemLongLong().       */ -#ifndef KDE_NO_DEPRECATED -    KCONFIGCORE_DEPRECATED ItemLongLong *addItemInt64(const QString &name, qint64 &reference, +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Use KCoreConfigSkeleton::addItemLongLong(...)") +    ItemLongLong *addItemInt64(const QString &name, qint64 &reference,              qint64 defaultValue = 0,              const QString &key = QString());  #endif @@ -1286,12 +1287,12 @@ public:                                      quint64 defaultValue = 0,                                      const QString &key = QString()); +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /** -     * @deprecated -     * Use addItemULongLong(). +     * @deprecated Since 5.0, use addItemULongLong().       */ -#ifndef KDE_NO_DEPRECATED -    KCONFIGCORE_DEPRECATED ItemULongLong *addItemUInt64(const QString &name, quint64 &reference, +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Use KCoreConfigSkeleton::addItemULongLong(...)") +    ItemULongLong *addItemUInt64(const QString &name, quint64 &reference,              quint64 defaultValue = 0,              const QString &key = QString());  #endif @@ -1475,11 +1476,12 @@ public Q_SLOTS:       */      bool save(); -#ifndef KCONFIGCORE_NO_DEPRECATED +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /**       * @deprecated since 5.0, call save() instead.       */ -    KCONFIGCORE_DEPRECATED void writeConfig() +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Use KCoreConfigSkeleton::save()") +    void writeConfig()      {          save();      } @@ -1523,17 +1525,23 @@ protected:       */      virtual bool usrSave(); +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)     /**       * @deprecated since 5.0, override usrRead instead.  This method is still called from usrRead       * for compatibility.       */ -    KCONFIGCORE_DEPRECATED virtual void usrReadConfig(); +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Override KCoreConfigSkeleton::usrRead()") +    virtual void usrReadConfig(); +#endif +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)     /**       * @deprecated since 5.0, override usrSave instead.  This method is still called from usrSave       * for compatibility.       */ -    KCONFIGCORE_DEPRECATED virtual bool usrWriteConfig(); +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "Override KCoreConfigSkeleton::usrSave()") +    virtual bool usrWriteConfig(); +#endif  private:      KCoreConfigSkeletonPrivate *const d; diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp index d34400eb..18ef8523 100644 --- a/src/core/kdesktopfile.cpp +++ b/src/core/kdesktopfile.cpp @@ -331,7 +331,7 @@ bool KDesktopFile::tryExec() const  //QString  //KDesktopFile::resource() const { return backEnd->resource(); } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 42)  QStringList  KDesktopFile::sortOrder() const  { diff --git a/src/core/kdesktopfile.h b/src/core/kdesktopfile.h index ca21bc85..28343366 100644 --- a/src/core/kdesktopfile.h +++ b/src/core/kdesktopfile.h @@ -214,7 +214,7 @@ public:       */      QString readDocPath() const; -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 42)      /**       * Returns the entry of the "SortOrder=" entry.       * @return the value of the "SortOrder=" entry. @@ -222,7 +222,8 @@ public:       * SortOrder was used to specify the order of menu items, but       * the Desktop Menu Specification defines another mechanism for it.       */ -    KCONFIGCORE_DEPRECATED QStringList sortOrder() const; +    KCONFIGCORE_DEPRECATED_VERSION(5, 42, "Not recommended, Desktop Menu Specification defines another mechanism") +    QStringList sortOrder() const;  #endif      /** diff --git a/src/core/kemailsettings.cpp b/src/core/kemailsettings.cpp index 0d4028df..c6aa5d20 100644 --- a/src/core/kemailsettings.cpp +++ b/src/core/kemailsettings.cpp @@ -78,6 +78,7 @@ QString KEMailSettings::getSetting(KEMailSettings::Setting s) const      case OutServerPass: {          return cg.readEntry("OutgoingPassword");      } +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)      case OutServerType: {          return cg.readEntry("OutgoingServerType");      } @@ -87,6 +88,12 @@ QString KEMailSettings::getSetting(KEMailSettings::Setting s) const      case OutServerTLS: {          return cg.readEntry("OutgoingServerTLS", QVariant(false)).toString();      } +#else +    case OutServerType_DEPRECATED_DO_NOT_USE: +    case OutServerCommand_DEPRECATED_DO_NOT_USE: +    case OutServerTLS_DEPRECATED_DO_NOT_USE: +        break; +#endif      case InServer: {          return cg.readEntry("IncomingServer");      } @@ -96,6 +103,7 @@ QString KEMailSettings::getSetting(KEMailSettings::Setting s) const      case InServerPass: {          return cg.readEntry("IncomingPassword");      } +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)      case InServerType: {          return cg.readEntry("IncomingServerType");      } @@ -105,6 +113,7 @@ QString KEMailSettings::getSetting(KEMailSettings::Setting s) const      case InServerTLS: {          return cg.readEntry("IncomingServerTLS", QVariant(false)).toString();      } +#endif      };      return QString();  } @@ -148,6 +157,7 @@ void KEMailSettings::setSetting(KEMailSettings::Setting s, const QString  &v)          cg.writeEntry("OutgoingPassword", v);          break;      } +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)      case OutServerType: {          cg.writeEntry("OutgoingServerType", v);          break; @@ -160,6 +170,12 @@ void KEMailSettings::setSetting(KEMailSettings::Setting s, const QString  &v)          cg.writeEntry("OutgoingServerTLS", (v == QLatin1String("true")));          break;      } +#else +    case OutServerType_DEPRECATED_DO_NOT_USE: +    case OutServerCommand_DEPRECATED_DO_NOT_USE: +    case OutServerTLS_DEPRECATED_DO_NOT_USE: +        break; +#endif      case InServer: {          cg.writeEntry("IncomingServer", v);          break; @@ -172,6 +188,7 @@ void KEMailSettings::setSetting(KEMailSettings::Setting s, const QString  &v)          cg.writeEntry("IncomingPassword", v);          break;      } +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)      case InServerType: {          cg.writeEntry("IncomingServerType", v);          break; @@ -184,6 +201,7 @@ void KEMailSettings::setSetting(KEMailSettings::Setting s, const QString  &v)          cg.writeEntry("IncomingServerTLS", (v == QLatin1String("true")));          break;      } +#endif      };      cg.sync();  } @@ -207,7 +225,7 @@ void KEMailSettings::setProfile(const QString &s)      }  } -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_BUILD_DEPRECATED_SINCE(5, 0)  QString KEMailSettings::currentProfileName() const  {      return p->m_sCurrentProfile; diff --git a/src/core/kemailsettings.h b/src/core/kemailsettings.h index 7d4fb8cf..801e63b7 100644 --- a/src/core/kemailsettings.h +++ b/src/core/kemailsettings.h @@ -69,7 +69,7 @@ public:          OutServer,          OutServerLogin,          OutServerPass, -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)          /**           * @deprecated since Frameworks 5.0           */ @@ -82,11 +82,15 @@ public:           * @deprecated since Frameworks 5.0           */          OutServerTLS, +#else +        OutServerType_DEPRECATED_DO_NOT_USE, +        OutServerCommand_DEPRECATED_DO_NOT_USE, +        OutServerTLS_DEPRECATED_DO_NOT_USE,  #endif          InServer,          InServerLogin,          InServerPass, -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)          /**           * @deprecated since Frameworks 5.0           */ @@ -131,13 +135,15 @@ public:        **/      QStringList profiles() const; -#ifndef KDE_NO_DEPRECATED +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 0)      /** -      * @deprecated since Frameworks 5.0        * Returns the name of the current profile.        * @returns what profile we're currently using +      * @deprecated Since 5.0        **/ -    KCONFIGCORE_DEPRECATED QString currentProfileName() const; +    KCONFIGCORE_DEPRECATED_VERSION(5, 0, "API planned to be changed") +    QString currentProfileName() const; +    // see https://git.reviewboard.kde.org/r/111910/  #endif      /** | 
