diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,9 +17,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) - -include(GenerateExportHeader) - +include(ECMGenerateExportHeader) include(ECMMarkAsTest) include(ECMSetupVersion) include(ECMGenerateHeaders) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -130,8 +130,16 @@ RENAME kf5_org.kde.KSlaveLauncher.xml) add_library(KF5KIOCore ${kiocore_SRCS}) -generate_export_header(KF5KIOCore BASE_NAME KIOCore) add_library(KF5::KIOCore ALIAS KF5KIOCore) +ecm_generate_export_header(KF5KIOCore + BASE_NAME KIOCore + # GROUP_BASE_NAME KF <- enable once all of KF modules use ecm_generate_export_header + VERSION ${KF5_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 3.0 3.1 3.4 4.0 4.3 4.5 4.6 5.0 5.2 5.8 5.24 5.45 5.48 5.63 5.61 5.64 +) +# 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(KF5KIOCore PUBLIC "$" # kio_version.h diff --git a/src/core/copyjob.h b/src/core/copyjob.h --- a/src/core/copyjob.h +++ b/src/core/copyjob.h @@ -154,16 +154,18 @@ */ void totalDirs(KJob *job, unsigned long dirs); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 2) /** * Emitted when it is known which files / directories are going * to be created. Note that this may still change e.g. when * existing files with the same name are discovered. * @param job the job that emitted this signal * @param files a list of items that are about to be created. * @deprecated since 5.2 -- this signal is unused since kde 3... */ - + KIOCORE_DEPRECATED_VERSION(5, 2, "To be removed due to no known users") QT_MOC_COMPAT void aboutToCreate(KIO::Job *job, const QList &files); +#endif /** * Sends the number of processed files. diff --git a/src/core/global.h b/src/core/global.h --- a/src/core/global.h +++ b/src/core/global.h @@ -94,17 +94,18 @@ */ KIOCORE_EXPORT QString convertSeconds(unsigned int seconds); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 4) /** * Calculates remaining time from total size, processed size and speed. - * Warning: As QTime is limited to 23:59:59, use calculateRemainingSeconds() instead * * @param totalSize total size in bytes * @param processedSize processed size in bytes * @param speed speed in bytes per second * @return calculated remaining time + * @deprecated Since 3.4, use calculateRemainingSeconds() instead, as QTime is limited to 23:59:59 */ -#ifndef KIOCORE_NO_DEPRECATED -KIOCORE_DEPRECATED_EXPORT QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed); +KIOCORE_DEPRECATED_VERSION(3, 4, "Use KIO::calculateRemainingSeconds(KIO::filesize_t, KIO::filesize_t, KIO::filesize_t") +KIOCORE_EXPORT QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed); #endif /** @@ -135,16 +136,17 @@ */ KIOCORE_EXPORT QString decodeFileName(const QString &str); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 61) /** * Given a directory path and a filename (which usually exists already), * this function returns a suggested name for a file that doesn't exist * in that directory. The existence is only checked for local urls though. * The suggested file name is of the form "foo 1", "foo 2" etc. * @since 5.0 * @deprecated since 5.61, use KFileUtils::suggestName() from KCoreAddons */ -#ifndef KIOCORE_NO_DEPRECATED -KIOCORE_DEPRECATED_EXPORT QString suggestName(const QUrl &baseURL, const QString &oldName); +KIOCORE_DEPRECATED_VERSION(5, 61, "Use KFileUtils::suggestName(const QUrl &, const QString &) from KCoreAddons") +KIOCORE_EXPORT QString suggestName(const QUrl &baseURL, const QString &oldName); #endif /** @@ -172,35 +174,63 @@ ERR_CYCLIC_LINK = KJob::UserDefinedError + 19, ERR_USER_CANCELED = KJob::KilledJobError, ERR_CYCLIC_COPY = KJob::UserDefinedError + 21, - ERR_COULD_NOT_CREATE_SOCKET = KJob::UserDefinedError + 22, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_CREATE_SOCKET = KJob::UserDefinedError + 22, ///< @deprecated Since 5.0, use ERR_CANNOT_CREATE_SOCKET +#endif ERR_CANNOT_CREATE_SOCKET = KJob::UserDefinedError + 22, - ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23, ///< @deprecated Since 5.0, use ERR_CANNOT_CONNECT +#endif ERR_CANNOT_CONNECT = KJob::UserDefinedError + 23, ERR_CONNECTION_BROKEN = KJob::UserDefinedError + 24, ERR_NOT_FILTER_PROTOCOL = KJob::UserDefinedError + 25, - ERR_COULD_NOT_MOUNT = KJob::UserDefinedError + 26, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_MOUNT = KJob::UserDefinedError + 26, ///< @deprecated Since 5.0, use ERR_CANNOT_MOUNT +#endif ERR_CANNOT_MOUNT = KJob::UserDefinedError + 26, - ERR_COULD_NOT_UNMOUNT = KJob::UserDefinedError + 27, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_UNMOUNT = KJob::UserDefinedError + 27, ///< @deprecated Since 5.0, use ERR_CANNOT_UNMOUNT +#endif ERR_CANNOT_UNMOUNT = KJob::UserDefinedError + 27, - ERR_COULD_NOT_READ = KJob::UserDefinedError + 28, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_READ = KJob::UserDefinedError + 28, ///< @deprecated Since 5.0, use ERR_CANNOT_READ +#endif ERR_CANNOT_READ = KJob::UserDefinedError + 28, - ERR_COULD_NOT_WRITE = KJob::UserDefinedError + 29, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_WRITE = KJob::UserDefinedError + 29, ///< @deprecated Since 5.0, use ERR_CANNOT_WRITE +#endif ERR_CANNOT_WRITE = KJob::UserDefinedError + 29, - ERR_COULD_NOT_BIND = KJob::UserDefinedError + 30, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_BIND = KJob::UserDefinedError + 30, ///< @deprecated Since 5.0, use ERR_CANNOT_BIND +#endif ERR_CANNOT_BIND = KJob::UserDefinedError + 30, - ERR_COULD_NOT_LISTEN = KJob::UserDefinedError + 31, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_LISTEN = KJob::UserDefinedError + 31, ///< @deprecated Since 5.0, use ERR_CANNOT_LISTEN +#endif ERR_CANNOT_LISTEN = KJob::UserDefinedError + 31, - ERR_COULD_NOT_ACCEPT = KJob::UserDefinedError + 32, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_ACCEPT = KJob::UserDefinedError + 32, ///< @deprecated Since 5.0, use ERR_CANNOT_ACCEPT +#endif ERR_CANNOT_ACCEPT = KJob::UserDefinedError + 32, - ERR_COULD_NOT_LOGIN = KJob::UserDefinedError + 33, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_LOGIN = KJob::UserDefinedError + 33, ///< @deprecated Since 5.0, use ERR_CANNOT_LOGIN +#endif ERR_CANNOT_LOGIN = KJob::UserDefinedError + 33, - ERR_COULD_NOT_STAT = KJob::UserDefinedError + 34, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_STAT = KJob::UserDefinedError + 34, ///< @deprecated Since 5.0, use ERR_CANNOT_STAT +#endif ERR_CANNOT_STAT = KJob::UserDefinedError + 34, - ERR_COULD_NOT_CLOSEDIR = KJob::UserDefinedError + 35, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_CLOSEDIR = KJob::UserDefinedError + 35, ///< @deprecated Since 5.0, use ERR_CANNOT_CLOSEDIR +#endif ERR_CANNOT_CLOSEDIR = KJob::UserDefinedError + 35, - ERR_COULD_NOT_MKDIR = KJob::UserDefinedError + 37, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_MKDIR = KJob::UserDefinedError + 37, ///< @deprecated Since 5.0, use ERR_CANNOT_MKDIR +#endif ERR_CANNOT_MKDIR = KJob::UserDefinedError + 37, - ERR_COULD_NOT_RMDIR = KJob::UserDefinedError + 38, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_RMDIR = KJob::UserDefinedError + 38, ///< @deprecated Since 5.0, use ERR_CANNOT_RMDIR +#endif ERR_CANNOT_RMDIR = KJob::UserDefinedError + 38, ERR_CANNOT_RESUME = KJob::UserDefinedError + 39, ERR_CANNOT_RENAME = KJob::UserDefinedError + 40, @@ -211,7 +241,9 @@ ERR_SLAVE_DIED = KJob::UserDefinedError + 43, ERR_OUT_OF_MEMORY = KJob::UserDefinedError + 44, ERR_UNKNOWN_PROXY_HOST = KJob::UserDefinedError + 45, - ERR_COULD_NOT_AUTHENTICATE = KJob::UserDefinedError + 46, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_AUTHENTICATE = KJob::UserDefinedError + 46, ///< @deprecated Since 5.0, use ERR_CANNOT_AUTHENTICATE +#endif ERR_CANNOT_AUTHENTICATE = KJob::UserDefinedError + 46, ERR_ABORTED = KJob::UserDefinedError + 47, ///< Action got aborted from application side ERR_INTERNAL_SERVER = KJob::UserDefinedError + 48, @@ -239,7 +271,9 @@ ///< object. For instance, TLS is demanded by ///< the server in order to continue. ERR_POST_DENIED = KJob::UserDefinedError + 65, ///< Issued when trying to POST data to a certain Ports - ERR_COULD_NOT_SEEK = KJob::UserDefinedError + 66, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) + ERR_COULD_NOT_SEEK = KJob::UserDefinedError + 66, ///< @deprecated Since 5.0, use ERR_CANNOT_SEEK +#endif // see job.cpp ERR_CANNOT_SEEK = KJob::UserDefinedError + 66, ERR_CANNOT_SETTIME = KJob::UserDefinedError + 67, ///< Emitted by setModificationTime diff --git a/src/core/global.cpp b/src/core/global.cpp --- a/src/core/global.cpp +++ b/src/core/global.cpp @@ -96,7 +96,6 @@ } } -#ifndef KIOCORE_NO_DEPRECATED KIOCORE_EXPORT QTime KIO::calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed) { QTime remainingTime; @@ -120,7 +119,6 @@ return remainingTime; } -#endif KIOCORE_EXPORT QString KIO::itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize) { @@ -294,9 +292,7 @@ return u.adjusted(QUrl::RemoveFilename); } -#ifndef KIOCORE_NO_DEPRECATED QString KIO::suggestName(const QUrl &baseURL, const QString &oldName) { return KFileUtils::suggestName(baseURL, oldName); } -#endif diff --git a/src/core/job_base.h b/src/core/job_base.h --- a/src/core/job_base.h +++ b/src/core/job_base.h @@ -66,15 +66,16 @@ virtual ~Job(); void start() override {} // Since KIO autostarts its jobs +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** * Retrieves the UI delegate of this job. * - * @deprecated since 5.0, can now be replaced with uiDelegate() - * * @return the delegate used by the job to communicate with the UI + * + * @deprecated since 5.0, can now be replaced with uiDelegate() */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED KJobUiDelegate *ui() const; + KIOCORE_DEPRECATED_VERSION(5, 0, "Use KJob::uiDelegate()") + KJobUiDelegate *ui() const; #endif /** @@ -220,15 +221,16 @@ protected: Q_SIGNALS: +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** - * @deprecated. Don't use ! * Emitted when the job is canceled. * Signal result() is emitted as well, and error() is, * in this case, ERR_USER_CANCELED. * @param job the job that emitted this signal + * @deprecated Since 5.0. Don't use ! */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED void canceled(KJob *job); + KIOCORE_DEPRECATED_VERSION(5, 0, "Do not use") + void canceled(KJob *job); #endif /** diff --git a/src/core/jobuidelegateextension.h b/src/core/jobuidelegateextension.h --- a/src/core/jobuidelegateextension.h +++ b/src/core/jobuidelegateextension.h @@ -47,7 +47,7 @@ Q_DECLARE_FLAGS(RenameDialog_Options, RenameDialog_Option) // For compat -#ifndef KIOCORE_NO_DEPRECATED +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** * @deprecated since 5.0, use the RenameDialog_Option enum values */ @@ -63,9 +63,8 @@ /** * @deprecated since 5.0, use RenameDialog_Options */ -#ifndef KIOCORE_NO_DEPRECATED -KIOCORE_DEPRECATED typedef RenameDialog_Options RenameDialog_Mode; -#endif +KIOCORE_DEPRECATED_VERSION(5, 0, "Use KIO::RenameDialog_Options") +typedef RenameDialog_Options RenameDialog_Mode; #endif /** @@ -94,6 +93,7 @@ Result_Retry = 9, // @deprecated since 5.0, use the RenameDialog_Option enum values +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) R_CANCEL = Result_Cancel, R_RENAME = Result_Rename, R_SKIP = Result_Skip, @@ -109,6 +109,7 @@ S_SKIP = Result_Skip, S_AUTO_SKIP = Result_AutoSkip, S_RETRY = Result_Retry +#endif }; typedef RenameDialog_Result SkipDialog_Result; diff --git a/src/core/kcoredirlister.h b/src/core/kcoredirlister.h --- a/src/core/kcoredirlister.h +++ b/src/core/kcoredirlister.h @@ -550,8 +550,10 @@ void speed(int bytes_per_second); protected: - /// @deprecated and unused, ignore this +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 3) + /// @deprecated Since 4.3, and unused, ignore this enum Changes { NONE = 0, NAME_FILTER = 1, MIME_FILTER = 2, DOT_FILES = 4, DIR_ONLY_MODE = 8 }; +#endif /** * Called for every new item before emitting newItems(). diff --git a/src/core/kfileitem.h b/src/core/kfileitem.h --- a/src/core/kfileitem.h +++ b/src/core/kfileitem.h @@ -92,6 +92,7 @@ bool delayedMimeTypes = false, bool urlIsDirectory = false); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** * Creates an item representing a file, from all the necessary info for it. * @param mode the file mode (according to stat() (e.g. S_IFDIR...) @@ -107,9 +108,9 @@ * @deprecated since 5.0. Most callers gave Unknown for mode and permissions, * so just port to KFileItem(url) and setDelayedMimeTypes(true) if necessary. */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED KFileItem(mode_t mode, mode_t permissions, const QUrl &url, - bool delayedMimeTypes = false); + KIOCORE_DEPRECATED_VERSION(5, 0, "See API docs") + KFileItem(mode_t mode, mode_t permissions, const QUrl &url, + bool delayedMimeTypes = false); #endif /** @@ -357,8 +358,10 @@ * @see time */ QString timeString(FileTimes which = ModificationTime) const; -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED QString timeString(unsigned int which) const; + +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) + KIOCORE_DEPRECATED_VERSION(4, 0, "Use KFileItem::timeString(FileTimes)") + QString timeString(unsigned int which) const; #endif /** @@ -457,18 +460,19 @@ */ QString getStatusBarInfo() const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) /** * Returns true if files can be dropped over this item. * Contrary to popular belief, not only dirs will return true :) * Executables, .desktop files, will do so as well. * @return true if you can drop files over the item * - * @deprecated This logic is application-dependent, the behavior described above + * @deprecated Since 4.0. This logic is application-dependent, the behavior described above * mostly makes sense for file managers only. * KDirModel has setDropsAllowed for similar (but configurable) logic. */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED bool acceptsDrops() const; + KIOCORE_DEPRECATED_VERSION(4, 0, "See API docs") + bool acceptsDrops() const; #endif /** @@ -523,11 +527,12 @@ */ operator QVariant() const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) /** - * @deprecated simply use '=' + * @deprecated Since 4.0, simply use '=' */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED void assign(const KFileItem &item); + KIOCORE_DEPRECATED_VERSION(4, 0, "Use KFileItem::operator=(const KFileItem&)") + void assign(const KFileItem &item); #endif /** @@ -537,10 +542,11 @@ */ QUrl mostLocalUrl(bool *local = nullptr) const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** * @deprecated since 5.0 add '&' in front of your boolean argument */ -#ifndef KIOCORE_NO_DEPRECATED + KIOCORE_DEPRECATED_VERSION(5, 0, "Use KFileItem::mostLocalUrl(bool *)") QUrl mostLocalUrl(bool &local) const { return mostLocalUrl(&local); } #endif diff --git a/src/core/kfileitem.cpp b/src/core/kfileitem.cpp --- a/src/core/kfileitem.cpp +++ b/src/core/kfileitem.cpp @@ -1239,7 +1239,6 @@ return !isDir(); } -#ifndef KIOCORE_NO_DEPRECATED bool KFileItem::acceptsDrops() const { // A directory ? @@ -1263,7 +1262,6 @@ return false; } -#endif QString KFileItem::getStatusBarInfo() const { @@ -1371,7 +1369,6 @@ return d->time(which).toString(); } -#ifndef KIOCORE_NO_DEPRECATED QString KFileItem::timeString(unsigned int which) const { if (!d) { @@ -1388,14 +1385,11 @@ return timeString(ModificationTime); } } -#endif -#ifndef KIOCORE_NO_DEPRECATED void KFileItem::assign(const KFileItem &item) { *this = item; } -#endif QUrl KFileItem::mostLocalUrl(bool *local) const { diff --git a/src/core/krecentdocument.h b/src/core/krecentdocument.h --- a/src/core/krecentdocument.h +++ b/src/core/krecentdocument.h @@ -81,16 +81,17 @@ */ static void add(const QUrl &url, const QString &desktopEntryName); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** * * Add a new item to the Recent Document menu. Calls add( url ). * * @param documentStr The full path to the document or URL to add. * @param isURL Set to @p true if @p documentStr is an URL and not a local file path. - * @deprecated call add(QUrl(str)) if isURL=true, and add(QUrl::fromLocalFile(str)) if isURL=false. + * @deprecated Since 5.0, call add(QUrl(str)) if isURL=true, and add(QUrl::fromLocalFile(str)) if isURL=false. */ -#ifndef KIOCORE_NO_DEPRECATED - static KIOCORE_DEPRECATED void add(const QString &documentStr, bool isUrl = false) + KIOCORE_DEPRECATED_VERSION(5, 0, "Use KRecentDocument::add(const QUrl &)") + static void add(const QString &documentStr, bool isUrl = false) { if (isUrl) { add(QUrl(documentStr)); diff --git a/src/core/ksambashare.h b/src/core/ksambashare.h --- a/src/core/ksambashare.h +++ b/src/core/ksambashare.h @@ -106,16 +106,17 @@ virtual ~KSambaShare(); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 6) /** * Returns the path to the used smb.conf file * or empty string if no file was found * * @return @c the path to the smb.conf file * - * @deprecated + * @deprecated Since 4.6, the conf file is no longer used */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED QString smbConfPath() const; + KIOCORE_DEPRECATED_VERSION(4, 6, "Conf file no longer used") + QString smbConfPath() const; #endif Q_SIGNALS: diff --git a/src/core/ksambashare.cpp b/src/core/ksambashare.cpp --- a/src/core/ksambashare.cpp +++ b/src/core/ksambashare.cpp @@ -466,13 +466,11 @@ delete d_ptr; } -#ifndef KIOCORE_NO_DEPRECATED QString KSambaShare::smbConfPath() const { Q_D(const KSambaShare); return d->smbConf; } -#endif bool KSambaShare::isDirectoryShared(const QString &path) const { diff --git a/src/core/ksslcertificatemanager.h b/src/core/ksslcertificatemanager.h --- a/src/core/ksslcertificatemanager.h +++ b/src/core/ksslcertificatemanager.h @@ -50,27 +50,38 @@ QDateTime expiryDateTime() const; void setRejected(bool rejected); bool isRejected() const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) /** @deprecated since 5.64, use the QSslError variant. */ - KIOCORE_DEPRECATED bool isErrorIgnored(KSslError::Error error) const; + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::isErrorIgnored(QSslError::SslError)") + bool isErrorIgnored(KSslError::Error error) const; +#endif /** * Returns whether @p error is ignored for this certificate. * @since 5.64 */ bool isErrorIgnored(QSslError::SslError error) const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) /** @deprecated since 5.64, use the QSslError variant. */ - KIOCORE_DEPRECATED void setIgnoredErrors(const QList &errors); + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::setIgnoredErrors(const QList &)") + void setIgnoredErrors(const QList &errors); /** @deprecated since 5.64, use the QSslError variant. */ - KIOCORE_DEPRECATED void setIgnoredErrors(const QList &errors); + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::setIgnoredErrors(const QList &)") + void setIgnoredErrors(const QList &errors); +#endif /** * Set the ignored errors for this certificate. * @since 5.64 */ void setIgnoredErrors(const QList &errors); QList ignoredErrors() const; // TODO KF6 return QSslError::SslError list +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) /** @deprecated since 5.64, use the QSslError variant. */ - KIOCORE_DEPRECATED QList filterErrors(const QList &errors) const; + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::filterErrors(const QList &)") + QList filterErrors(const QList &errors) const; /** @deprecated since 5.64, use the QSslError variant. */ - KIOCORE_DEPRECATED QList filterErrors(const QList &errors) const; + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::filterErrors(const QList &)") + QList filterErrors(const QList &errors) const; +#endif /** * Filter out errors that are already ignored. * @since 5.64 @@ -91,20 +102,25 @@ void clearRule(const QSslCertificate &cert, const QString &hostName); KSslCertificateRule rule(const QSslCertificate &cert, const QString &hostName) const; - // use caCertificates() instead -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED QList rootCertificates() const +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 6) + /** @deprecated Since 4.6, use caCertificates() instead */ + KIOCORE_DEPRECATED_VERSION(4, 6, "Use KSslCertificateManager::caCertificates()") + QList rootCertificates() const { return caCertificates(); } #endif QList caCertificates() const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) /** @deprecated since 5.64, use the corresponding QSslError variant. */ - static KIOCORE_DEPRECATED QList nonIgnorableErrors(const QList &); + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateManager::nonIgnorableErrors(const QList &)") + static QList nonIgnorableErrors(const QList &); /** @deprecated since 5.64, use the corresponding QSslError variant. */ - static KIOCORE_DEPRECATED QList nonIgnorableErrors(const QList &); + KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateManager::nonIgnorableErrors(const QList &)") + static QList nonIgnorableErrors(const QList &); +#endif /** * Returns the subset of @p errors that cannot be ignored, ie. that is considered fatal. * @since 5.64 diff --git a/src/core/ktcpsocket.h b/src/core/ktcpsocket.h --- a/src/core/ktcpsocket.h +++ b/src/core/ktcpsocket.h @@ -115,8 +115,12 @@ HostNameMismatch, PathLengthExceeded }; + +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 63) /** @deprecated since 5.63, use the QSslError ctor instead. */ - KIOCORE_DEPRECATED KSslError(KSslError::Error error = NoError, const QSslCertificate &cert = QSslCertificate()); + KIOCORE_DEPRECATED_VERSION(5, 63, "Use KSslError(const QSslError &)") + KSslError(KSslError::Error error = NoError, const QSslCertificate &cert = QSslCertificate()); +#endif KSslError(const QSslError &error); KSslError(const KSslError &other); ~KSslError(); diff --git a/src/core/scheduler.h b/src/core/scheduler.h --- a/src/core/scheduler.h +++ b/src/core/scheduler.h @@ -119,14 +119,16 @@ */ static void doJob(SimpleJob *job); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 5) /** * Schedules @p job scheduled for later execution. * This method is deprecated and just sets the job's priority to 1. It is * recommended to replace calls to scheduleJob(job) with setJobPriority(job, 1). * @param job the job to schedule + * @deprecated Since 4.5, use setJobPriority(SimpleJob *job, int priority) */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED static void scheduleJob(SimpleJob *job); + KIOCORE_DEPRECATED_VERSION(4, 5, "Use Scheduler::setJobPriority(SimpleJob *, int )") + static void scheduleJob(SimpleJob *job); #endif /** diff --git a/src/core/scheduler.cpp b/src/core/scheduler.cpp --- a/src/core/scheduler.cpp +++ b/src/core/scheduler.cpp @@ -693,9 +693,7 @@ SessionData sessionData; void doJob(SimpleJob *job); -#ifndef KIOCORE_NO_DEPRECATED void scheduleJob(SimpleJob *job); -#endif void setJobPriority(SimpleJob *job, int priority); void cancelJob(SimpleJob *job); void jobFinished(KIO::SimpleJob *job, KIO::Slave *slave); @@ -808,12 +806,10 @@ schedulerPrivate()->doJob(job); } -#ifndef KIOCORE_NO_DEPRECATED void Scheduler::scheduleJob(SimpleJob *job) { schedulerPrivate()->scheduleJob(job); } -#endif void Scheduler::setJobPriority(SimpleJob *job, int priority) { @@ -979,13 +975,11 @@ proto->queueJob(job); } -#ifndef KIOCORE_NO_DEPRECATED void SchedulerPrivate::scheduleJob(SimpleJob *job) { //qDebug() << job; setJobPriority(job, 1); } -#endif void SchedulerPrivate::setJobPriority(SimpleJob *job, int priority) { diff --git a/src/core/slavebase.h b/src/core/slavebase.h --- a/src/core/slavebase.h +++ b/src/core/slavebase.h @@ -362,17 +362,20 @@ */ QString configValue(QString key, const QString &defaultValue=QString()) const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) /** * Returns a configuration object to query config/meta-data information * from. * * The application provides the slave with all configuration information * relevant for the current protocol and host. * - * TODO KF6: remove, perhaps rename mapConfig() to config() * @deprecated since 5.64 use mapConfig instead */ - KIOCORE_DEPRECATED KConfigGroup *config(); + KIOCORE_DEPRECATED_VERSION(5, 64, "Use SlaveBase::mapConfig()") + KConfigGroup *config(); + // KF6: perhaps rename mapConfig() to config() when removing this +#endif /** * Returns an object that can translate remote filenames into proper @@ -737,6 +740,7 @@ **/ int readData(QByteArray &buffer); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** * It collects entries and emits them via listEntries * when enough of them are there or a certain time @@ -752,8 +756,8 @@ * You should make sure that finished() is called when the entry * listing is completed and simply remove the call to listEntry(entry, true). */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED void listEntry(const UDSEntry &_entry, bool ready); + KIOCORE_DEPRECATED_VERSION(5, 0, "See API docs") + void listEntry(const UDSEntry &_entry, bool ready); #endif /** @@ -824,15 +828,18 @@ */ int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg = QString()); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 24) /** * @deprecated since KF 5.24, use openPasswordDialogV2. * The return value works differently: * instead of * if (!openPasswordDialog()) { error(USER_CANCELED); } * store and pass the return value to error(), when NOT zero, * as shown documentation for openPasswordDialogV2(). */ - KIOCORE_DEPRECATED bool openPasswordDialog(KIO::AuthInfo &info, const QString &errorMsg = QString()); + KIOCORE_DEPRECATED_VERSION(5, 24, "Use SlaveBase::openPasswordDialogV2(...)") + bool openPasswordDialog(KIO::AuthInfo &info, const QString &errorMsg = QString()); +#endif /** * Checks for cached authentication based on parameters @@ -891,10 +898,8 @@ */ bool cacheAuthentication(const AuthInfo &info); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** - * @deprecated for a very very long time, not implemented anymore - * Probably dates back to model dialup times. - * * Used by the slave to check if it can connect * to a given host. This should be called where the slave is ready * to do a ::connect() on a socket. For each call to @@ -911,14 +916,16 @@ * * @return true in theory, the host is reachable * false the system is offline and the host is in a remote network. + * + * @deprecated Since 5.0, for a very very long time, not implemented anymore + * Probably dates back to model dialup times. */ -#ifndef KIOCORE_NO_DEPRECATED + KIOCORE_DEPRECATED_VERSION(5, 0, "Not implemented & used") bool requestNetwork(const QString &host = QString()); #endif +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) /** - * @deprecated for a very very long time, not implemented anymore - * Probably dates back to model dialup times. * * Used by the slave to withdraw a connection requested by * requestNetwork. This function cancels the last call to @@ -931,8 +938,11 @@ * @param host the host passed to requestNetwork * * A slave should call this function every time it disconnect from a host. + * * + * @deprecated Since 5.0, for a very very long time, not implemented anymore + * Probably dates back to model dialup times. * */ -#ifndef KIOCORE_NO_DEPRECATED + KIOCORE_DEPRECATED_VERSION(5, 0, "Not implemented & used") void dropNetwork(const QString &host = QString()); #endif diff --git a/src/core/slavebase.cpp b/src/core/slavebase.cpp --- a/src/core/slavebase.cpp +++ b/src/core/slavebase.cpp @@ -762,7 +762,6 @@ send(INF_INFOMESSAGE, data); } -#ifndef KIOCORE_NO_DEPRECATED bool SlaveBase::requestNetwork(const QString &host) { KIO_DATA << host << d->slaveid; @@ -783,15 +782,13 @@ KIO_DATA << host << d->slaveid; send(MSG_NET_DROP, data); } -#endif void SlaveBase::statEntry(const UDSEntry &entry) { KIO_DATA << entry; send(MSG_STAT_ENTRY, data); } -#ifndef KIOCORE_NO_DEPRECATED void SlaveBase::listEntry(const UDSEntry &entry, bool _ready) { if (_ready) { @@ -806,7 +803,6 @@ listEntry(entry); } } -#endif void SlaveBase::listEntry(const UDSEntry &entry) { diff --git a/src/core/slaveinterface.h b/src/core/slaveinterface.h --- a/src/core/slaveinterface.h +++ b/src/core/slaveinterface.h @@ -51,7 +51,11 @@ INF_MIME_TYPE = 21, INF_ERROR_PAGE = 22, INF_WARNING = 23, - INF_GETTING_FILE, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 0) + INF_GETTING_FILE, ///< @deprecated Since 3.0 +#else + INF_GETTING_FILE_DEPRECATED_DO_NOT_USE, +#endif INF_UNUSED = 25, ///< now unused INF_INFOMESSAGE, INF_META_DATA, @@ -74,14 +78,23 @@ MSG_LIST_ENTRIES, MSG_RENAMED, ///< unused MSG_RESUME, - MSG_SLAVE_STATUS, ///< only for compatibility, use V2 for KF >= 5.45. TODO KF6: remove +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 45) + MSG_SLAVE_STATUS, ///< @deprecated Since 5.45, use MSG_SLAVE_STATUS_V2 +#else + MSG_SLAVE_STATUS_DEPRECATED_DO_NOT_USE, +#endif MSG_SLAVE_ACK, // 110 MSG_NET_REQUEST, MSG_NET_DROP, MSG_NEED_SUBURL_DATA, MSG_CANRESUME, - MSG_AUTH_KEY, ///< @deprecated - MSG_DEL_AUTH_KEY, ///< @deprecated +#if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 1) + MSG_AUTH_KEY, ///< @deprecated Since 3.1 + MSG_DEL_AUTH_KEY, ///< @deprecated Since 3.1 +#else + MSG_AUTH_KEY_DEPRECATED_DO_NOT_USE, + MSG_DEL_AUTH_KEY_DEPRECATED_DO_NOT_USE, +#endif MSG_OPENED, MSG_WRITTEN, MSG_HOST_INFO_REQ, @@ -109,9 +122,13 @@ virtual ~SlaveInterface(); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) // TODO KF6: remove these methods, Connection isn't an exported class - KIOCORE_DEPRECATED void setConnection(Connection *connection); - KIOCORE_DEPRECATED Connection *connection() const; + KIOCORE_DEPRECATED_VERSION(5, 0, "Do not use") + void setConnection(Connection *connection); + KIOCORE_DEPRECATED_VERSION(5, 0, "Do not use") + Connection *connection() const; +#endif // Send our answer to the MSG_RESUME (canResume) request // (to tell the "put" job whether to resume or not) diff --git a/src/core/statjob.h b/src/core/statjob.h --- a/src/core/statjob.h +++ b/src/core/statjob.h @@ -57,16 +57,17 @@ */ void setSide(StatSide side); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) /** * A stat() can have two meanings. Either we want to read from this URL, * or to check if we can write to it. First case is "source", second is "dest". * It is necessary to know what the StatJob is for, to tune the kioslave's behavior * (e.g. with FTP). * @param source true for "source" mode, false for "dest" mode - * @deprecated use setSide(StatSide side). + * @deprecated Since 4.0, use setSide(StatSide side). */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED void setSide(bool source); + KIOCORE_DEPRECATED_VERSION(4, 0, "Use StatJob::setSide(StatSide)") + void setSide(bool source); #endif /** @@ -184,6 +185,8 @@ */ KIOCORE_EXPORT StatJob *stat(const QUrl &url, KIO::StatJob::StatSide side, short int details, JobFlags flags = DefaultFlags); + +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) /** * Find all details for one file or directory. * This version of the call includes two additional booleans, @p sideIsSource and @p details. @@ -210,10 +213,11 @@ * "it's a file or a directory, or it doesn't exist". This is used by KRun. * @param flags Can be HideProgressInfo here * @return the job handling the operation. + * @deprecated Since 4.0, use stat(const QUrl &, KIO::StatJob::StatSide, short int, JobFlags) */ -#ifndef KIOCORE_NO_DEPRECATED -KIOCORE_DEPRECATED_EXPORT StatJob *stat(const QUrl &url, bool sideIsSource, - short int details, JobFlags flags = DefaultFlags); +KIOCORE_DEPRECATED_VERSION(4, 0, "Use KIO::stat(const QUrl &, KIO::StatJob::StatSide, short int, JobFlags)") +KIOCORE_EXPORT StatJob *stat(const QUrl &url, bool sideIsSource, + short int details, JobFlags flags = DefaultFlags); #endif /** diff --git a/src/core/statjob.cpp b/src/core/statjob.cpp --- a/src/core/statjob.cpp +++ b/src/core/statjob.cpp @@ -74,12 +74,10 @@ { } -#ifndef KIOCORE_NO_DEPRECATED void StatJob::setSide(bool source) { d_func()->m_bSource = source; } -#endif void StatJob::setSide(StatSide side) { @@ -191,7 +189,6 @@ return job; } -#ifndef KIOCORE_NO_DEPRECATED StatJob *KIO::stat(const QUrl &url, bool sideIsSource, short int details, JobFlags flags) { //qCDebug(KIO_CORE) << "stat" << url; @@ -201,7 +198,6 @@ job->setDetails(details); return job; } -#endif StatJob *KIO::stat(const QUrl &url, KIO::StatJob::StatSide side, short int details, JobFlags flags) { diff --git a/src/core/transferjob.h b/src/core/transferjob.h --- a/src/core/transferjob.h +++ b/src/core/transferjob.h @@ -72,27 +72,29 @@ */ void sendAsyncData(const QByteArray &data); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 3) /** * When enabled, the job reports the amount of data that has been sent, * instead of the amount of data that has been received. * @see slotProcessedSize * @see slotSpeed * @deprecated since 4.2.1, this is unnecessary (it is always false for * KIO::get and true for KIO::put) */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED void setReportDataSent(bool enabled); + KIOCORE_DEPRECATED_VERSION(4, 3, "No longer needed") + void setReportDataSent(bool enabled); #endif +#if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 3) /** * Returns whether the job reports the amount of data that has been * sent (true), or whether the job reports the amount of data that * has been received (false) * @deprecated since 4.2.1, this is unnecessary (it is always false for * KIO::get and true for KIO::put) */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED bool reportDataSent() const; + KIOCORE_DEPRECATED_VERSION(4, 3, "No longer needed") + bool reportDataSent() const; #endif /** diff --git a/src/core/transferjob.cpp b/src/core/transferjob.cpp --- a/src/core/transferjob.cpp +++ b/src/core/transferjob.cpp @@ -197,7 +197,6 @@ d->m_extraFlags &= ~JobPrivate::EF_TransferJobNeedData; } -#ifndef KIOCORE_NO_DEPRECATED void TransferJob::setReportDataSent(bool enabled) { Q_D(TransferJob); @@ -207,14 +206,11 @@ d->m_extraFlags &= ~JobPrivate::EF_TransferJobDataSent; } } -#endif -#ifndef KIOCORE_NO_DEPRECATED bool TransferJob::reportDataSent() const { return (d_func()->m_extraFlags & JobPrivate::EF_TransferJobDataSent); } -#endif QString TransferJob::mimetype() const { diff --git a/src/core/udsentry.h b/src/core/udsentry.h --- a/src/core/udsentry.h +++ b/src/core/udsentry.h @@ -151,21 +151,27 @@ */ void reserve(int size); +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 48) /** * insert field with string value * @param field numeric field id * @param value to set * @deprecated since 5.48 in favor of fastInsert or replace */ - KIOCORE_DEPRECATED void insert(uint field, const QString &value); + KIOCORE_DEPRECATED_VERSION(5, 48, "Use UDSEntry::fastInsert(uint, const QString &) or UDSEntry::replace(uint, const QString &)") + void insert(uint field, const QString &value); +#endif +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 48) /** * insert field with numeric value * @param field numeric field id * @param l value to set * @deprecated since 5.48 in favor of fastInsert or replace */ - KIOCORE_DEPRECATED void insert(uint field, long long l); + KIOCORE_DEPRECATED_VERSION(5, 48, "Use UDSEntry::fastInsert(uint, long long) or UDSEntry::replace(uint, long long)") + void insert(uint field, long long l); +#endif /** * insert field with string value, it will assert if the field is already inserted. In that case, use replace() instead. @@ -195,13 +201,14 @@ */ bool contains(uint field) const; +#if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 8) /** * List all fields. * @return all fields. * @deprecated since 5.8. Use fields() instead. */ -#ifndef KIOCORE_NO_DEPRECATED - KIOCORE_DEPRECATED QList listFields() const; + KIOCORE_DEPRECATED_VERSION(5, 8, "Use UDSEntry::fields()") + QList listFields() const; #endif /** diff --git a/src/core/udsentry.cpp b/src/core/udsentry.cpp --- a/src/core/udsentry.cpp +++ b/src/core/udsentry.cpp @@ -46,9 +46,7 @@ int count() const; QString stringValue(uint udsField) const; long long numberValue(uint udsField, long long defaultValue = -1) const; -#ifndef KIOCORE_NO_DEPRECATED QList listFields() const; -#endif QVector fields() const; bool contains(uint udsField) const; void clear(); @@ -145,7 +143,6 @@ return defaultValue; } -#ifndef KIOCORE_NO_DEPRECATED QList UDSEntryPrivate::listFields() const { QList res; @@ -155,7 +152,6 @@ } return res; } -#endif QVector UDSEntryPrivate::fields() const { @@ -417,12 +413,10 @@ d->replace(field, value); } -#ifndef KIOCORE_NO_DEPRECATED QList UDSEntry::listFields() const { return d->listFields(); } -#endif QVector UDSEntry::fields() const { diff --git a/src/filewidgets/CMakeLists.txt b/src/filewidgets/CMakeLists.txt --- a/src/filewidgets/CMakeLists.txt +++ b/src/filewidgets/CMakeLists.txt @@ -47,8 +47,16 @@ qt5_add_resources(kiofilewidgets_SRCS ../new_file_templates/templates.qrc) add_library(KF5KIOFileWidgets ${kiofilewidgets_SRCS}) -generate_export_header(KF5KIOFileWidgets BASE_NAME KIOFileWidgets) add_library(KF5::KIOFileWidgets ALIAS KF5KIOFileWidgets) +ecm_generate_export_header(KF5KIOFileWidgets + BASE_NAME KIOFileWidgets + # 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.3 4.5 5.0 5.33 +) +# 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(KF5KIOFileWidgets INTERFACE "$") diff --git a/src/filewidgets/kfilepreviewgenerator.h b/src/filewidgets/kfilepreviewgenerator.h --- a/src/filewidgets/kfilepreviewgenerator.h +++ b/src/filewidgets/kfilepreviewgenerator.h @@ -78,10 +78,13 @@ void setPreviewShown(bool show); bool isPreviewShown() const; +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 3) /** - * @deprecated Use KFilePreviewGenerator::updateIcons() instead. + * @deprecated Since 4.3, use KFilePreviewGenerator::updateIcons() instead. */ + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 3, "Use KFilePreviewGenerator::updateIcons()") void updatePreviews(); +#endif /** * Sets the list of enabled thumbnail plugins. diff --git a/src/filewidgets/kfilewidget.h b/src/filewidgets/kfilewidget.h --- a/src/filewidgets/kfilewidget.h +++ b/src/filewidgets/kfilewidget.h @@ -143,7 +143,7 @@ */ void setUrl(const QUrl &url, bool clearforward = true); -#if !defined(KIOFILEWIDGETS_NO_DEPRECATED) && !defined(DOXYGEN_SHOULD_SKIP_THIS) +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(5, 33) /** * Sets the file to preselect to @p pathOrUrl * @@ -156,7 +156,8 @@ * @deprecated since 5.33, use setSelectedUrl instead, after ensuring that * construct the QUrl correctly (e.g. use fromLocalFile for local paths). */ - KIOFILEWIDGETS_DEPRECATED void setSelection(const QString &pathOrUrl); + KIOFILEWIDGETS_DEPRECATED_VERSION(5, 33, "Use KFileWidget::setSelectedUrl(const QUrl &)") + void setSelection(const QString &pathOrUrl); #endif /** diff --git a/src/filewidgets/kfilewidget.cpp b/src/filewidgets/kfilewidget.cpp --- a/src/filewidgets/kfilewidget.cpp +++ b/src/filewidgets/kfilewidget.cpp @@ -1593,7 +1593,6 @@ return true; } -#ifndef KIOFILEWIDGETS_NO_DEPRECATED void KFileWidget::setSelection(const QString &url) { // qDebug() << "setSelection " << url; @@ -1611,7 +1610,6 @@ setSelectedUrl(urlFromString(url)); } -#endif void KFileWidget::setSelectedUrl(const QUrl &url) { diff --git a/src/filewidgets/knewfilemenu.h b/src/filewidgets/knewfilemenu.h --- a/src/filewidgets/knewfilemenu.h +++ b/src/filewidgets/knewfilemenu.h @@ -109,7 +109,8 @@ */ void setPopupFiles(const QList &files); -#ifndef KIOFILEWIDGETS_NO_DEPRECATED +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) + KIOFILEWIDGETS_DEPRECATED_VERSION(5, 0, "Use KNewFileMenu::setPopupFiles(const QList &)") void setPopupFiles(const QUrl &file) { setPopupFiles(QList() << file); diff --git a/src/filewidgets/kurlnavigator.h b/src/filewidgets/kurlnavigator.h --- a/src/filewidgets/kurlnavigator.h +++ b/src/filewidgets/kurlnavigator.h @@ -289,48 +289,64 @@ */ QWidget *dropWidget() const; -#if !defined(KIOFILEWIDGETS_NO_DEPRECATED) && !defined(DOXYGEN_SHOULD_SKIP_THIS) +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * @return The current URL of the location. - * @deprecated Use KUrlNavigator::locationUrl() instead. + * @deprecated Since 4.5, use KUrlNavigator::locationUrl() instead. */ - KIOFILEWIDGETS_DEPRECATED const QUrl &url() const; + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::locationUrl(int)") + const QUrl &url() const; +#endif +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * @return The portion of the current URL up to the path part given * by \a index. Assuming that the current URL is /home/peter/Documents/Music, * then the following URLs are returned for an index: * - index <= 0: /home * - index is 1: /home/peter * - index is 2: /home/peter/Documents * - index >= 3: /home/peter/Documents/Music - * @deprecated It should not be necessary for a client of KUrlNavigator to query this information. + * @deprecated Since 4.5. It should not be necessary for a client of KUrlNavigator to query this information. */ - KIOFILEWIDGETS_DEPRECATED QUrl url(int index) const; + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Do not use") + QUrl url(int index) const; +#endif +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * @return URL for the history element with the index \a historyIndex. * The history index 0 represents the most recent URL. * @since 4.3 - * @deprecated Use KUrlNavigator::locationUrl(historyIndex) instead. + * @deprecated Since 4.5, use KUrlNavigator::locationUrl(historyIndex) instead. */ - KIOFILEWIDGETS_DEPRECATED QUrl historyUrl(int historyIndex) const; + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::locationUrl(int)") + QUrl historyUrl(int historyIndex) const; +#endif +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * @return The saved root URL for the current URL (see KUrlNavigator::saveRootUrl()). - * @deprecated Use KUrlNavigator::locationState() instead. + * @deprecated Since 4.5, use KUrlNavigator::locationState() instead. */ - KIOFILEWIDGETS_DEPRECATED const QUrl &savedRootUrl() const; + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::locationState(int)") + const QUrl &savedRootUrl() const; +#endif +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * @return The saved contents position of the upper left corner * for the current URL. - * @deprecated Use KUrlNavigator::locationState() instead. + * @deprecated Since 4.5, use KUrlNavigator::locationState() instead. */ - KIOFILEWIDGETS_DEPRECATED QPoint savedPosition() const; + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::locationState(int)") + QPoint savedPosition() const; +#endif - /** @deprecated Use setHomeUrl(const QUrl& url) instead. */ - KIOFILEWIDGETS_DEPRECATED void setHomeUrl(const QString &homeUrl); +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) + /** @deprecated Since 4.5, use setHomeUrl(const QUrl& url) instead. */ + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::setHomeUrl(const QUrl&)") + void setHomeUrl(const QString &homeUrl); #endif public Q_SLOTS: @@ -355,24 +371,31 @@ void setFocus(); #endif -#if !defined(KIOFILEWIDGETS_NO_DEPRECATED) && !defined(DOXYGEN_SHOULD_SKIP_THIS) +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * Sets the location to \a url. - * @deprecated Use KUrlNavigator::setLocationUrl(url). + * @deprecated Since 4.5, use KUrlNavigator::setLocationUrl(url). */ - KIOFILEWIDGETS_DEPRECATED void setUrl(const QUrl &url); + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::setLocationUrl(const QUrl&))") + void setUrl(const QUrl &url); +#endif +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * Saves the used root URL of the content for the current history element. - * @deprecated Use KUrlNavigator::saveLocationState() instead. + * @deprecated Since 4.5, use KUrlNavigator::saveLocationState() instead. */ - KIOFILEWIDGETS_DEPRECATED void saveRootUrl(const QUrl &url); + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::saveLocationState(const QByteArray &)") + void saveRootUrl(const QUrl &url); +#endif +#if KIOFILEWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * Saves the coordinates of the contents for the current history element. - * @deprecated Use KUrlNavigator::saveLocationState() instead. + * @deprecated Since 4.5, use KUrlNavigator::saveLocationState() instead. */ - KIOFILEWIDGETS_DEPRECATED void savePosition(int x, int y); + KIOFILEWIDGETS_DEPRECATED_VERSION(4, 5, "Use KUrlNavigator::saveLocationState(const QByteArray &)") + void savePosition(int x, int y); #endif Q_SIGNALS: diff --git a/src/filewidgets/kurlnavigator.cpp b/src/filewidgets/kurlnavigator.cpp --- a/src/filewidgets/kurlnavigator.cpp +++ b/src/filewidgets/kurlnavigator.cpp @@ -54,10 +54,8 @@ struct LocationData { QUrl url; -#ifndef KIOFILEWIDGETS_NO_DEPRECATED QUrl rootUrl; // KDE5: remove after the deprecated methods have been removed QPoint pos; // KDE5: remove after the deprecated methods have been removed -#endif QByteArray state; }; @@ -1138,29 +1136,23 @@ } } -#ifndef KIOFILEWIDGETS_NO_DEPRECATED void KUrlNavigator::setUrl(const QUrl &url) { // deprecated setLocationUrl(url); } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED void KUrlNavigator::saveRootUrl(const QUrl &url) { // deprecated d->m_history[d->m_historyIndex].rootUrl = url; } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED void KUrlNavigator::savePosition(int x, int y) { // deprecated d->m_history[d->m_historyIndex].pos = QPoint(x, y); } -#endif void KUrlNavigator::keyPressEvent(QKeyEvent *event) { @@ -1272,7 +1264,6 @@ return d->m_dropWidget; } -#ifndef KIOFILEWIDGETS_NO_DEPRECATED const QUrl &KUrlNavigator::url() const { // deprecated @@ -1283,25 +1274,19 @@ url = locationUrl(); return url; } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED QUrl KUrlNavigator::url(int index) const { // deprecated return d->buttonUrl(index); } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED QUrl KUrlNavigator::historyUrl(int historyIndex) const { // deprecated return locationUrl(historyIndex); } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED const QUrl &KUrlNavigator::savedRootUrl() const { // deprecated @@ -1312,22 +1297,17 @@ rootUrl = d->m_history[d->m_historyIndex].rootUrl; return rootUrl; } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED QPoint KUrlNavigator::savedPosition() const { // deprecated return d->m_history[d->m_historyIndex].pos; } -#endif -#ifndef KIOFILEWIDGETS_NO_DEPRECATED void KUrlNavigator::setHomeUrl(const QString &homeUrl) { // deprecated setLocationUrl(QUrl::fromUserInput(homeUrl)); } -#endif #include "moc_kurlnavigator.cpp" diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -87,8 +87,16 @@ ) add_library(KF5KIOWidgets ${kiowidgets_SRCS}) -generate_export_header(KF5KIOWidgets BASE_NAME KIOWidgets) add_library(KF5::KIOWidgets ALIAS KF5KIOWidgets) +ecm_generate_export_header(KF5KIOWidgets + BASE_NAME KIOWidgets + # 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 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 +) +# 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 "$") diff --git a/src/widgets/accessmanager.h b/src/widgets/accessmanager.h --- a/src/widgets/accessmanager.h +++ b/src/widgets/accessmanager.h @@ -111,6 +111,7 @@ */ bool isExternalContentAllowed() const; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Sets the cookiejar's window id to @p id. * @@ -125,10 +126,10 @@ * * @see KIO::Integration::CookieJar::setWindowId. * @since 4.4 - * @deprecated Use setWindow + * @deprecated Since 5.0, use KIO::Integration::CookieJar::setWindowId */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED void setCookieJarWindowId(WId id); + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KIO::Integration::CookieJar::setWindowId(...)") + void setCookieJarWindowId(WId id); #endif /** @@ -143,6 +144,7 @@ */ void setWindow(QWidget *widget); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Returns the cookiejar's window id. * @@ -153,10 +155,10 @@ * * @see KIO::Integration::CookieJar::windowId. * @since 4.4 - * @deprecated Use KIO::Integration::CookieJar::windowId + * @deprecated Since 5.0, use KIO::Integration::CookieJar::windowId */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED WId cookieJarWindowid() const; + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KIO::Integration::CookieJar::windowId()") + WId cookieJarWindowid() const; #endif /** diff --git a/src/widgets/accessmanager.cpp b/src/widgets/accessmanager.cpp --- a/src/widgets/accessmanager.cpp +++ b/src/widgets/accessmanager.cpp @@ -128,7 +128,6 @@ return d->externalContentAllowed; } -#ifndef KIOWIDGETS_NO_DEPRECATED void AccessManager::setCookieJarWindowId(WId id) { QWidget *window = QWidget::find(id); @@ -143,7 +142,6 @@ d->window = window->isWindow() ? window : window->window(); } -#endif void AccessManager::setWindow(QWidget *widget) { @@ -163,7 +161,6 @@ } } -#ifndef KIOWIDGETS_NO_DEPRECATED WId AccessManager::cookieJarWindowid() const { KIO::Integration::CookieJar *jar = qobject_cast (cookieJar()); @@ -173,7 +170,6 @@ return 0; } -#endif QWidget *AccessManager::window() const { diff --git a/src/widgets/kdirmodel.h b/src/widgets/kdirmodel.h --- a/src/widgets/kdirmodel.h +++ b/src/widgets/kdirmodel.h @@ -74,12 +74,13 @@ */ KFileItem itemForIndex(const QModelIndex &index) const; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 0) /** * Return the index for a given kfileitem. This can be slow. - * @deprecated use the method that takes a KFileItem by value + * @deprecated Since 4.0, use the method that takes a KFileItem by value */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED QModelIndex indexForItem(const KFileItem *) const; + KIOWIDGETS_DEPRECATED_VERSION(4, 0, "Use KDirModel::indexForItem(const KFileItem &)") + QModelIndex indexForItem(const KFileItem *) const; #endif /** diff --git a/src/widgets/kdirmodel.cpp b/src/widgets/kdirmodel.cpp --- a/src/widgets/kdirmodel.cpp +++ b/src/widgets/kdirmodel.cpp @@ -1079,14 +1079,12 @@ } } -#ifndef KIOWIDGETS_NO_DEPRECATED QModelIndex KDirModel::indexForItem(const KFileItem *item) const { // Note that we can only use the URL here, not the pointer. // KFileItems can be copied. return indexForUrl(item->url()); // O(n) } -#endif QModelIndex KDirModel::indexForItem(const KFileItem &item) const { diff --git a/src/widgets/kpropertiesdialog.h b/src/widgets/kpropertiesdialog.h --- a/src/widgets/kpropertiesdialog.h +++ b/src/widgets/kpropertiesdialog.h @@ -234,11 +234,12 @@ */ void insertPlugin(KPropertiesDialogPlugin *plugin); -#ifndef KIOWIDGETS_NO_DEPRECATED +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * @deprecated since 5.0, use url() */ - KIOWIDGETS_DEPRECATED QUrl kurl() const + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KPropertiesDialog::url()") + QUrl kurl() const { return url(); } @@ -336,12 +337,14 @@ * Called when the user presses 'Ok'. * @deprecated since 5.25, use accept() */ - KIOWIDGETS_DEPRECATED virtual void slotOk(); + KIOWIDGETS_DEPRECATED_VERSION(5, 25, "Use KPropertiesDialog::accept()") + virtual void slotOk(); /** * Called when the user presses 'Cancel'. * @deprecated since 5.25, use reject() */ - KIOWIDGETS_DEPRECATED virtual void slotCancel(); + KIOWIDGETS_DEPRECATED_VERSION(5, 25, "Use KPropertiesDialog::reject()") + virtual void slotCancel(); /** * Called when the user presses 'Ok'. @@ -422,13 +425,14 @@ */ virtual void applyChanges(); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1) /** * Convenience method for most ::supports methods * @return true if the file is a local, regular, readable, desktop file - * @deprecated use KFileItem::isDesktopFile + * @deprecated Since 4.1, use KFileItem::isDesktopFile */ -#ifndef KIOWIDGETS_NO_DEPRECATED - static KIOWIDGETS_DEPRECATED bool isDesktopFile(const KFileItem &_item); + KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Use KFileItem::isDesktopFile()") + static bool isDesktopFile(const KFileItem &_item); #endif void setDirty(bool b); diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -709,12 +709,10 @@ delete d; } -#ifndef KIOWIDGETS_NO_DEPRECATED bool KPropertiesDialogPlugin::isDesktopFile(const KFileItem &_item) { return _item.isDesktopFile(); } -#endif void KPropertiesDialogPlugin::setDirty(bool b) { diff --git a/src/widgets/krun.h b/src/widgets/krun.h --- a/src/widgets/krun.h +++ b/src/widgets/krun.h @@ -198,6 +198,7 @@ */ QWidget *window() const; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 6) /** * Open a list of URLs with a certain service (application). * @@ -214,8 +215,8 @@ * @deprecated since 5.6, use runApplication instead. No change needed on the application side, * the only difference is the return value (qint64 instead of bool). */ -#ifndef KIOWIDGETS_NO_DEPRECATED - static KIOWIDGETS_DEPRECATED bool run(const KService &service, const QList &urls, QWidget *window, + KIOWIDGETS_DEPRECATED_VERSION(5, 6, "Use KRun::runApplication(const KService &, const QList &, QWidget *, RunFlags, const QString &, const QByteArray &") + static bool run(const KService &service, const QList &urls, QWidget *window, bool tempFiles = false, const QString &suggestedFileName = QString(), const QByteArray &asn = QByteArray()); #endif @@ -289,6 +290,7 @@ const QString &icon = QString(), const QByteArray &asn = QByteArray()); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 31) /** * Open the given URL. * @@ -308,10 +310,10 @@ * @return @c true on success, @c false on error * @deprecated since 5.31, use runUrl() with RunFlags instead. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - static bool KIOWIDGETS_DEPRECATED runUrl(const QUrl &url, const QString &mimetype, QWidget *window, - bool tempFile = false, bool runExecutables = true, - const QString &suggestedFileName = QString(), const QByteArray &asn = QByteArray()); + KIOWIDGETS_DEPRECATED_VERSION(5, 31, "Use KRun::const QUrl &, const QString &, QWidget *, RunFlags, const QString &, const QByteArray &") + static bool runUrl(const QUrl &url, const QString &mimetype, QWidget *window, + bool tempFile = false, bool runExecutables = true, + const QString &suggestedFileName = QString(), const QByteArray &asn = QByteArray()); #endif /** @@ -391,20 +393,22 @@ bool tempFiles = false, const QString &suggestedFileName = QString(), const QByteArray &asn = QByteArray()); // TODO deprecate and provide RunFlags() overload +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 0) /** * Quotes a string for the shell. * An empty string will @em not be quoted. * - * @deprecated Use KShell::quoteArg() instead. @em Note that this function + * @param str the string to quote. The quoted string will be written here + * + * @deprecated Since 4.0, use KShell::quoteArg() instead. @em Note that this function * behaves differently for empty arguments and returns the result * differently. - * - * @param str the string to quote. The quoted string will be written here */ -#ifndef KIOWIDGETS_NO_DEPRECATED - static KIOWIDGETS_DEPRECATED void shellQuote(QString &str); + KIOWIDGETS_DEPRECATED_VERSION(4, 0, "Use KShell::quoteArg(...)") + static void shellQuote(QString &str); #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Processes a Exec= line as found in .desktop files. * @param _service the service to extract information from. @@ -416,12 +420,13 @@ * @return a list of arguments suitable for QProcess. * @deprecated since 5.0, use KIO::DesktopExecParser */ -#ifndef KIOWIDGETS_NO_DEPRECATED - static KIOWIDGETS_DEPRECATED QStringList processDesktopExec(const KService &_service, const QList &_urls, + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KIO::DesktopExecParser") + static QStringList processDesktopExec(const KService &_service, const QList &_urls, bool tempFiles = false, const QString &suggestedFileName = QString()); #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Given a full command line (e.g. the Exec= line from a .desktop file), * extract the name of the binary being run. @@ -431,7 +436,7 @@ * @deprecated since 5.0, use KIO::DesktopExecParser::executableName if removePath was true, * or KIO::DesktopExecParser::executablePath if removePath was false. */ -#ifndef KIOWIDGETS_NO_DEPRECATED + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "See API docs") static QString binaryName(const QString &execLine, bool removePath); #endif @@ -596,56 +601,62 @@ */ KIO::Job *job(); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 4) /** * Returns the timer object. - * @deprecated setFinished(true) now takes care of the timer().start(0), + * @deprecated Since 4.4. setFinished(true) now takes care of the timer().start(0), * so this can be removed. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED QTimer &timer(); + KIOWIDGETS_DEPRECATED_VERSION(4, 4, "See API docs") + QTimer &timer(); #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1) /** * Indicate that the next action is to scan the file. - * @deprecated not useful in public API + * @deprecated Since 4.1. Not useful in public API */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED void setDoScanFile(bool scanFile); + KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Do not use") + void setDoScanFile(bool scanFile); #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1) /** * Returns whether the file shall be scanned. - * @deprecated not useful in public API + * @deprecated Since 4.1. Not useful in public API */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED bool doScanFile() const; + KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Do not use") + bool doScanFile() const; #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1) /** * Sets whether it is a directory. - * @deprecated typo in the name, and not useful as a public method + * @deprecated Since 4.1. Typo in the name, and not useful as a public method */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED void setIsDirecory(bool isDirectory); + KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Do not use") + void setIsDirecory(bool isDirectory); #endif /** * Returns whether it is a directory. */ bool isDirectory() const; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1) /** - * @deprecated not useful in public API + * @deprecated Since 4.1. Not useful in public API */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED void setInitializeNextAction(bool initialize); + KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Do not use") + void setInitializeNextAction(bool initialize); #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1) /** - * @deprecated not useful in public API + * @deprecated Since 4.1. Not useful in public API */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED bool initializeNextAction() const; + KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Do not use") + bool initializeNextAction() const; #endif /** diff --git a/src/widgets/krun.cpp b/src/widgets/krun.cpp --- a/src/widgets/krun.cpp +++ b/src/widgets/krun.cpp @@ -323,7 +323,6 @@ return true; } -#ifndef KIOWIDGETS_NO_DEPRECATED bool KRun::runUrl(const QUrl &url, const QString &mimetype, QWidget *window, bool tempFile, bool runExecutables, const QString &suggestedFileName, const QByteArray &asn) { RunFlags flags = tempFile ? KRun::DeleteTemporaryFiles : RunFlags(); @@ -333,7 +332,6 @@ return runUrl(url, mimetype, window, flags, suggestedFileName, asn); } -#endif // This is called by foundMimeType, since it knows the mimetype of the URL bool KRun::runUrl(const QUrl &u, const QString &_mimetype, QWidget *window, RunFlags flags, const QString &suggestedFileName, const QByteArray &asn) @@ -468,7 +466,6 @@ return false; } -#ifndef KIOWIDGETS_NO_DEPRECATED void KRun::shellQuote(QString &_str) { // Credits to Walter, says Bernd G. :) @@ -478,7 +475,6 @@ const QChar q = QLatin1Char('\''); _str.replace(q, QLatin1String("'\\''")).prepend(q).append(q); } -#endif QStringList KRun::processDesktopExec(const KService &_service, const QList &_urls, bool tempFiles, const QString &suggestedFileName) { @@ -488,12 +484,10 @@ return parser.resultingArguments(); } -#ifndef KIOWIDGETS_NO_DEPRECATED QString KRun::binaryName(const QString &execLine, bool removePath) { return removePath ? KIO::DesktopExecParser::executableName(execLine) : KIO::DesktopExecParser::executablePath(execLine); } -#endif // This code is also used in klauncher. // TODO: move this to KProcessRunner @@ -717,14 +711,12 @@ return true; } -#ifndef KIOWIDGETS_NO_DEPRECATED bool KRun::run(const KService &_service, const QList &_urls, QWidget *window, bool tempFiles, const QString &suggestedFileName, const QByteArray &asn) { const RunFlags flags = tempFiles ? KRun::DeleteTemporaryFiles : RunFlags(); return runApplication(_service, _urls, window, flags, suggestedFileName, asn) != 0; } -#endif qint64 KRun::runApplication(const KService &service, const QList &urls, QWidget *window, RunFlags flags, const QString &suggestedFileName, @@ -1525,52 +1517,40 @@ return d->m_job; } -#ifndef KIOWIDGETS_NO_DEPRECATED QTimer &KRun::timer() { return *d->m_timer; } -#endif -#ifndef KIOWIDGETS_NO_DEPRECATED void KRun::setDoScanFile(bool scanFile) { d->m_bScanFile = scanFile; } -#endif -#ifndef KIOWIDGETS_NO_DEPRECATED bool KRun::doScanFile() const { return d->m_bScanFile; } -#endif -#ifndef KIOWIDGETS_NO_DEPRECATED void KRun::setIsDirecory(bool isDirectory) { d->m_bIsDirectory = isDirectory; } -#endif bool KRun::isDirectory() const { return d->m_bIsDirectory; } -#ifndef KIOWIDGETS_NO_DEPRECATED void KRun::setInitializeNextAction(bool initialize) { d->m_bInit = initialize; } -#endif -#ifndef KIOWIDGETS_NO_DEPRECATED bool KRun::initializeNextAction() const { return d->m_bInit; } -#endif bool KRun::isLocalFile() const { diff --git a/src/widgets/kurifilter.h b/src/widgets/kurifilter.h --- a/src/widgets/kurifilter.h +++ b/src/widgets/kurifilter.h @@ -644,15 +644,16 @@ Q_OBJECT public: +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 6) /** * List for holding the following search provider information: * ([search provider name], [search query, search query icon name]) * * @since 4.5 - * @deprecated Use @ref KUriFilterSearchProvider instead. See @ref setSearchProviders; + * @deprecated Since 4.6, use @ref KUriFilterSearchProvider instead. See @ref setSearchProviders; */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED typedef QHash > ProviderInfoList; + KIOWIDGETS_DEPRECATED_VERSION(4, 6, "Use KUriFilterSearchProvider") + typedef QHash > ProviderInfoList; #endif /** @@ -949,14 +950,15 @@ */ QString filteredUri(const QString &uri, const QStringList &filters = QStringList()); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 6) /** * See @ref filterSearchUri(KUriFilterData&, SearchFilterTypes) * * @since 4.5 - * @deprecated Use filterSearchUri(KUriFilterData&, SearchFilterTypes) instead. + * @deprecated Since 4.6, use filterSearchUri(KUriFilterData&, SearchFilterTypes) instead. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED bool filterSearchUri(KUriFilterData &data); + KIOWIDGETS_DEPRECATED_VERSION(4, 6, "Use KUriFilter::filterSearchUri(KUriFilterData &, SearchFilterTypes)") + bool filterSearchUri(KUriFilterData &data); #endif /** diff --git a/src/widgets/kurifilter.cpp b/src/widgets/kurifilter.cpp --- a/src/widgets/kurifilter.cpp +++ b/src/widgets/kurifilter.cpp @@ -636,12 +636,10 @@ return data.uri().toString(); } -#ifndef KIOWIDGETS_NO_DEPRECATED bool KUriFilter::filterSearchUri(KUriFilterData &data) { return filterSearchUri(data, (NormalTextFilter | WebShortcutFilter)); } -#endif bool KUriFilter::filterSearchUri(KUriFilterData &data, SearchFilterTypes types) { diff --git a/src/widgets/kurlrequester.h b/src/widgets/kurlrequester.h --- a/src/widgets/kurlrequester.h +++ b/src/widgets/kurlrequester.h @@ -64,9 +64,8 @@ Q_PROPERTY(QString filter READ filter WRITE setFilter) Q_PROPERTY(KFile::Modes mode READ mode WRITE setMode) Q_PROPERTY(QFileDialog::AcceptMode acceptMode READ acceptMode WRITE setAcceptMode) -#ifndef KIOWIDGETS_NO_DEPRECATED + /// @deprecated Since 5.0, use placeholderText Q_PROPERTY(QString clickMessage READ clickMessage WRITE setClickMessage) -#endif Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(Qt::WindowModality fileDialogModality READ fileDialogModality WRITE setFileDialogModality) @@ -180,9 +179,8 @@ * @deprecated since 5.0. The dialog will be created anyway when the user * requests it, and will behave according to the properties of KUrlRequester. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - virtual KIOWIDGETS_DEPRECATED QFileDialog *fileDialog() const; -#endif + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "See API docs") + virtual QFileDialog *fileDialog() const; /** * @returns a pointer to the lineedit, either the default one, or the @@ -222,22 +220,24 @@ */ const KEditListWidget::CustomEditor &customEditor(); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * @returns the message set with setClickMessage * @since 4.2 - * @deprecated use KUrlRequester::placeholderText instead. + * @deprecated Since 5.0, use KUrlRequester::placeholderText instead. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED QString clickMessage() const; + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KUrlRequester::placeholderText()") + QString clickMessage() const; #endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Set a click message @p msg * @since 4.2 - * @deprecated use KUrlRequester::setPlaceholderText instead. + * @deprecated Since 5.0, use KUrlRequester::setPlaceholderText instead. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED void setClickMessage(const QString &msg); + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KUrlRequester::setPlaceholderText(const QString&)") + void setClickMessage(const QString &msg); #endif /** @@ -280,16 +280,17 @@ */ void setStartDir(const QUrl &startDir); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 3) /** * Sets the url in the lineedit to @p QUrl::fromLocalFile(path). * This is only for local paths; do not pass a url here. * This method is mostly for "local paths only" url requesters, * for instance those set up with setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly) * - * @deprecated Use setUrl(QUrl::fromLocalFile(path)) instead. + * @deprecated Since 4.3. Use setUrl(QUrl::fromLocalFile(path)) instead. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED void setPath(const QString &path); + KIOWIDGETS_DEPRECATED_VERSION(4, 3, "Use KUrlRequester::setUrlQUrl::fromLocalFile(path))") + void setPath(const QString &path); #endif /** diff --git a/src/widgets/kurlrequester.cpp b/src/widgets/kurlrequester.cpp --- a/src/widgets/kurlrequester.cpp +++ b/src/widgets/kurlrequester.cpp @@ -384,12 +384,10 @@ d->setText(url.toDisplayString(QUrl::PreferLocalFile)); } -#ifndef KIOWIDGETS_NO_DEPRECATED void KUrlRequester::setPath(const QString &path) { d->setText(path); } -#endif void KUrlRequester::setText(const QString &text) { @@ -571,7 +569,6 @@ return d->mimeTypeFilters; } -#ifndef KIOWIDGETS_NO_DEPRECATED QFileDialog *KUrlRequester::fileDialog() const { if (d->myFileDialog && @@ -597,7 +594,6 @@ return d->myFileDialog; } -#endif void KUrlRequester::clear() { @@ -646,26 +642,22 @@ return d->myCompletion; } -#ifndef KIOWIDGETS_NO_DEPRECATED void KUrlRequester::setClickMessage(const QString &msg) { setPlaceholderText(msg); } -#endif void KUrlRequester::setPlaceholderText(const QString &msg) { if (d->edit) { d->edit->setPlaceholderText(msg); } } -#ifndef KIOWIDGETS_NO_DEPRECATED QString KUrlRequester::clickMessage() const { return placeholderText(); } -#endif QString KUrlRequester::placeholderText() const { diff --git a/src/widgets/kurlrequesterdialog.h b/src/widgets/kurlrequesterdialog.h --- a/src/widgets/kurlrequesterdialog.h +++ b/src/widgets/kurlrequesterdialog.h @@ -83,12 +83,13 @@ static QUrl getUrl(const QUrl &url = QUrl(), QWidget *parent = nullptr, const QString &caption = QString()); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Returns a pointer to the file dialog used by the KUrlRequester. * @deprecated since 5.0, use urlRequester() methods instead. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED QFileDialog *fileDialog(); + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KUrlRequesterDialog::urlRequester() and methods on it") + QFileDialog *fileDialog(); #endif /** diff --git a/src/widgets/kurlrequesterdialog.cpp b/src/widgets/kurlrequesterdialog.cpp --- a/src/widgets/kurlrequesterdialog.cpp +++ b/src/widgets/kurlrequesterdialog.cpp @@ -127,12 +127,10 @@ return url; } -#ifndef KIOWIDGETS_NO_DEPRECATED QFileDialog *KUrlRequesterDialog::fileDialog() { return d->urlRequester->fileDialog(); } -#endif KUrlRequester *KUrlRequesterDialog::urlRequester() { diff --git a/src/widgets/paste.h b/src/widgets/paste.h --- a/src/widgets/paste.h +++ b/src/widgets/paste.h @@ -31,6 +31,7 @@ class Job; class CopyJob; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 4) /** * Pastes the content of the clipboard to the given destination URL. * URLs are treated separately (performing a file copy) @@ -43,8 +44,11 @@ * @return the job that handles the operation * @deprecated since 5.4, use KIO::paste() from (which takes care of undo/redo too) */ -KIOWIDGETS_DEPRECATED_EXPORT Job *pasteClipboard(const QUrl &destURL, QWidget *widget, bool move = false); +KIOWIDGETS_DEPRECATED_VERSION(5, 4, "Use KIO::paste(...) from ") +KIOWIDGETS_EXPORT Job *pasteClipboard(const QUrl &destURL, QWidget *widget, bool move = false); +#endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 4) /** * Save the given mime @p data to the given destination URL * after offering the user to choose a data format. @@ -60,24 +64,29 @@ * @see pasteClipboard() * @deprecated since 5.4, use KIO::paste() from (which takes care of undo/redo too) */ -KIOWIDGETS_DEPRECATED_EXPORT Job *pasteMimeData(const QMimeData *data, const QUrl &destUrl, +KIOWIDGETS_DEPRECATED_VERSION(5, 4, "Use KIO::paste(...) from ") +KIOWIDGETS_EXPORT Job *pasteMimeData(const QMimeData *data, const QUrl &destUrl, const QString &dialogText, QWidget *widget); +#endif /** * Returns true if pasteMimeData will find any interesting format in @p data. * You can use this method to enable/disable the paste action appropriately. * @since 5.0 (was called canPasteMimeSource before) */ KIOWIDGETS_EXPORT bool canPasteMimeData(const QMimeData *data); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 4) /** * Returns the text to use for the Paste action, when the application supports * pasting files, urls, and clipboard data, using pasteClipboard(). * @return a string suitable for QAction::setText, or an empty string if pasting * isn't possible right now. * @deprecated since 5.4, use pasteActionText(const QMimeData *, bool*, const KFileItem &) */ -KIOWIDGETS_DEPRECATED_EXPORT QString pasteActionText(); +KIOWIDGETS_DEPRECATED_VERSION(5, 4, "Use KIO::pasteActionText(const QMimeData *, bool*, const KFileItem &)") +KIOWIDGETS_EXPORT QString pasteActionText(); +#endif /** * Returns the text to use for the Paste action, when the application supports diff --git a/src/widgets/paste.cpp b/src/widgets/paste.cpp --- a/src/widgets/paste.cpp +++ b/src/widgets/paste.cpp @@ -293,8 +293,7 @@ return pasteMimeDataImpl(mimeData, destUrl, QString(), widget, true /*clipboard*/); } -// deprecated. KF6: remove -KIOWIDGETS_DEPRECATED_EXPORT QString KIO::pasteActionText() +QString KIO::pasteActionText() { const QMimeData *mimeData = QApplication::clipboard()->mimeData(); const QList urls = KUrlMimeData::urlsFromMimeData(mimeData); diff --git a/src/widgets/previewjob.h b/src/widgets/previewjob.h --- a/src/widgets/previewjob.h +++ b/src/widgets/previewjob.h @@ -65,7 +65,7 @@ ScaledAndCached }; -#ifndef KIOWIDGETS_NO_DEPRECATED +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 7) /** * Creates a new PreviewJob. * @param items a list of files to create previews for @@ -82,13 +82,14 @@ * the names of the plugins that may be used. If enabledPlugins is zero * all available plugins are used. * - * @deprecated Use PreviewJob(const KFileItemList&, const QSize&, const QStringList*) in combination + * @deprecated Since 4.7, use PreviewJob(const KFileItemList&, const QSize&, const QStringList*) in combination * with the setter-methods instead. Note that the semantics of * \p enabledPlugins has been slightly changed. */ - KIOWIDGETS_DEPRECATED PreviewJob(const KFileItemList &items, int width, int height, - int iconSize, int iconAlpha, bool scale, bool save, - const QStringList *enabledPlugins); + KIOWIDGETS_DEPRECATED_VERSION(4, 7, "Use PreviewJob(const KFileItemList&, const QSize&, const QStringList*)") + PreviewJob(const KFileItemList &items, int width, int height, + int iconSize, int iconAlpha, bool scale, bool save, + const QStringList *enabledPlugins); #endif /** @@ -208,15 +209,16 @@ */ static QStringList supportedMimeTypes(); +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 5) /** * Returns the default "maximum file size", in bytes, used by PreviewJob. * This is useful for applications providing a GUI for letting the user change the size. * @since 4.1 - * @deprecated PreviewJob uses different maximum file sizes dependent on the URL since 4.5. + * @deprecated Since 4.5, PreviewJob uses different maximum file sizes dependent on the URL. * The returned file size is only valid for local URLs. */ -#ifndef KIOWIDGETS_NO_DEPRECATED - KIOWIDGETS_DEPRECATED static KIO::filesize_t maximumFileSize(); + KIOWIDGETS_DEPRECATED_VERSION(4, 5, "See API dox") + static KIO::filesize_t maximumFileSize(); #endif Q_SIGNALS: @@ -244,7 +246,7 @@ Q_DECLARE_PRIVATE(PreviewJob) }; -#ifndef KIOWIDGETS_NO_DEPRECATED +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 7) /** * Creates a PreviewJob to generate or retrieve a preview image * for the given URL. @@ -264,12 +266,15 @@ * the names of the plugins that may be used. * @return the new PreviewJob * @see PreviewJob::availablePlugins() - * @deprecated Use KIO::filePreview(const KFileItemList&, const QSize&, const QStringList*) in combination + * @deprecated Since 4.7, use KIO::filePreview(const KFileItemList&, const QSize&, const QStringList*) in combination * with the setter-methods instead. Note that the semantics of * \p enabledPlugins has been slightly changed. */ -KIOWIDGETS_DEPRECATED_EXPORT PreviewJob *filePreview(const KFileItemList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = nullptr); // KDE5: use enums instead of bool scale + bool save +KIOWIDGETS_DEPRECATED_VERSION(4, 7, "Use KIO::filePreview(const KFileItemList &, const QSize &, const QStringList *") +KIOWIDGETS_EXPORT PreviewJob *filePreview(const KFileItemList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = nullptr); // KDE5: use enums instead of bool scale + bool save +#endif +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 7) /** * Creates a PreviewJob to generate or retrieve a preview image * for the given URL. @@ -289,11 +294,12 @@ * the names of the plugins that may be used. * @return the new PreviewJob * @see PreviewJob::availablePlugins() - * @deprecated Use KIO::filePreview(const KFileItemList&, const QSize&, const QStringList*) in combination + * @deprecated Since 4.7, use KIO::filePreview(const KFileItemList&, const QSize&, const QStringList*) in combination * with the setter-methods instead. Note that the semantics of * \p enabledPlugins has been slightly changed. */ -KIOWIDGETS_DEPRECATED_EXPORT PreviewJob *filePreview(const QList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = nullptr); +KIOWIDGETS_DEPRECATED_VERSION(4, 7, "Use KIO::filePreview(const KFileItemList &, const QSize &, const QStringList *") +KIOWIDGETS_EXPORT PreviewJob *filePreview(const QList &items, int width, int height = 0, int iconSize = 0, int iconAlpha = 70, bool scale = true, bool save = true, const QStringList *enabledPlugins = nullptr); #endif /** diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp --- a/src/widgets/previewjob.cpp +++ b/src/widgets/previewjob.cpp @@ -162,7 +162,6 @@ Q_DECLARE_PUBLIC(PreviewJob) }; -#ifndef KIOWIDGETS_NO_DEPRECATED PreviewJob::PreviewJob(const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins) @@ -178,7 +177,6 @@ // Return to event loop first, determineNextFile() might delete this; QTimer::singleShot(0, this, SLOT(startPreview())); } -#endif PreviewJob::PreviewJob(const KFileItemList &items, const QSize &size, @@ -788,7 +786,6 @@ return result; } -#ifndef KIOWIDGETS_NO_DEPRECATED PreviewJob *KIO::filePreview(const KFileItemList &items, int width, int height, int iconSize, int iconAlpha, bool scale, bool save, const QStringList *enabledPlugins) @@ -810,19 +807,16 @@ return new PreviewJob(fileItems, width, height, iconSize, iconAlpha, scale, save, enabledPlugins); } -#endif PreviewJob *KIO::filePreview(const KFileItemList &items, const QSize &size, const QStringList *enabledPlugins) { return new PreviewJob(items, size, enabledPlugins); } -#ifndef KIOWIDGETS_NO_DEPRECATED KIO::filesize_t PreviewJob::maximumFileSize() { KConfigGroup cg(KSharedConfig::openConfig(), "PreviewSettings"); return cg.readEntry("MaximumSize", 5 * 1024 * 1024LL /* 5MB */); } -#endif #include "moc_previewjob.cpp" diff --git a/src/widgets/renamedialog.h b/src/widgets/renamedialog.h --- a/src/widgets/renamedialog.h +++ b/src/widgets/renamedialog.h @@ -90,15 +90,16 @@ */ QUrl autoDestUrl() const; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * Given a directory path and a filename (which usually exists already), * this function returns a suggested name for a file that doesn't exist * in that directory. The existence is only checked for local urls though. * The suggested file name is of the form "foo 1", "foo 2" etc. - * @deprecated use KFileUtils::suggestName from KCoreAddons + * @deprecated Since 5.0. Use KIO::suggestName, since 5.61, use KFileUtils::suggestName from KCoreAddons */ -#ifndef KIOWIDGETS_NO_DEPRECATED - static KIOWIDGETS_DEPRECATED QString suggestName(const QUrl &baseURL, const QString &oldName); + KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KFileUtils::suggestName(const QUrl &, const QString &) from KCoreAddons >= 5.61, or KIO::suggestName(const QUrl &, const QString &)") + static QString suggestName(const QUrl &baseURL, const QString &oldName); #endif public Q_SLOTS: diff --git a/src/widgets/renamedialog.cpp b/src/widgets/renamedialog.cpp --- a/src/widgets/renamedialog.cpp +++ b/src/widgets/renamedialog.cpp @@ -464,12 +464,10 @@ } } -#ifndef KIOWIDGETS_NO_DEPRECATED QString RenameDialog::suggestName(const QUrl &baseURL, const QString &oldName) { return KFileUtils::suggestName(baseURL, oldName); } -#endif // Propose button clicked void RenameDialog::suggestNewNamePressed() diff --git a/src/widgets/sslui.h b/src/widgets/sslui.h --- a/src/widgets/sslui.h +++ b/src/widgets/sslui.h @@ -23,7 +23,9 @@ #include "kiowidgets_export.h" #include -#include // TODO KF6 remove this include +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 64) +#include +#endif namespace KIO { @@ -38,11 +40,14 @@ RecallAndStoreRules = 3 ///< apply stored rules and store new rules }; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 64) /** * @deprecated since 5.64 use the KSslErrorUiData variant instead. */ -bool KIOWIDGETS_DEPRECATED_EXPORT askIgnoreSslErrors(const KTcpSocket *socket, - RulesStorage storedRules = RecallAndStoreRules); // TODO KF6 remove +KIOWIDGETS_DEPRECATED_VERSION(5, 64, "Use KIO::SslUi::askIgnoreSslErrors(const KSslErrorUiData &, RulesStorage)") +bool KIOWIDGETS_EXPORT askIgnoreSslErrors(const KTcpSocket *socket, + RulesStorage storedRules = RecallAndStoreRules); +#endif /** * If there are errors while establishing an SSL encrypted connection to a peer, usually due to diff --git a/src/widgets/thumbcreator.h b/src/widgets/thumbcreator.h --- a/src/widgets/thumbcreator.h +++ b/src/widgets/thumbcreator.h @@ -104,7 +104,9 @@ */ enum Flags { None = 0, /**< No hints. */ +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 32) DrawFrame = 1, /**< \deprecated since 5.32. Used to paint a frame around the preview, but applications take care of that nowadays. */ +#endif BlendIcon = 2 /**< The mimetype icon should be blended over the preview. */ }; @@ -168,16 +170,19 @@ virtual void writeConfiguration(const QWidget *configurationWidget); }; +#if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0) /** * @class ThumbCreatorV2 thumbcreator.h * @since 4.7 * @deprecated since 5.0, use ThumbCreator */ -class KIOWIDGETS_DEPRECATED_EXPORT ThumbCreatorV2 : public ThumbCreator +class KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use ThumbCreator") +KIOWIDGETS_EXPORT ThumbCreatorV2 : public ThumbCreator { public: virtual ~ThumbCreatorV2(); }; +#endif // KF6 TODO: rename this to something less generic typedef ThumbCreator *(*newCreator)();