diff --git a/src/kpastetextaction.h b/src/kpastetextaction.h --- a/src/kpastetextaction.h +++ b/src/kpastetextaction.h @@ -41,8 +41,10 @@ * with the clipboard history if klipper is running. * If klipper is not running, the menu has only one * item: the current clipboard content. + * @deprecated since 5.39 */ -class KCONFIGWIDGETS_EXPORT KPasteTextAction: public QAction +#ifndef KDE_NO_DEPRECATED +class KCONFIGWIDGETS_DEPRECATED_EXPORT KPasteTextAction: public QAction { Q_OBJECT public: @@ -100,5 +102,6 @@ Q_PRIVATE_SLOT(d, void _k_menuAboutToShow()) Q_PRIVATE_SLOT(d, void _k_slotTriggered(QAction *)) }; +#endif // KDE_NO_DEPRECATED #endif diff --git a/src/kpastetextaction.cpp b/src/kpastetextaction.cpp --- a/src/kpastetextaction.cpp +++ b/src/kpastetextaction.cpp @@ -33,6 +33,7 @@ #include #include +#ifndef KDE_NO_DEPRECATED class KPasteTextActionPrivate { public: @@ -136,5 +137,6 @@ // qDebug() << "Clipboard: " << qApp->clipboard()->text(QClipboard::Clipboard); } } +#endif // KDE_NO_DEPRECATED #include "moc_kpastetextaction.cpp" diff --git a/src/kstandardaction.h b/src/kstandardaction.h --- a/src/kstandardaction.h +++ b/src/kstandardaction.h @@ -201,7 +201,7 @@ ConfigureNotifications, ///< Display the notifications configuration dialog. FullScreen, ///< Switch to/from full screen mode. Clear, ///< Clear the content of the focus widget. - PasteText, ///< Paste the contents of clipboard and adds a Klipper button on the toolbar. + PasteText, ///< @deprecated since 5.39. Use Paste instead. SwitchApplicationLanguage, ///< Display the Switch Application Language dialog. DeleteFile, ///< Permanently deletes files or folders. @since 5.25 RenameFile, ///< Renames files or folders. @since 5.25 @@ -555,19 +555,25 @@ KSTANDARDACTION_WITH_NEW_STYLE_CONNECT(paste, Paste) /** - * Paste the contents of clipboard at the current mouse or cursor - * position. Provide a button on the toolbar with the clipboard history - * menu if Klipper is running. + * @deprecated since 5.39. Use paste() instead. */ -KCONFIGWIDGETS_EXPORT QAction *pasteText(const QObject *recvr, const char *slot, QObject *parent); +#ifndef KDE_NO_DEPRECATED +KCONFIGWIDGETS_DEPRECATED_EXPORT QAction *pasteText(const QObject *recvr, const char *slot, QObject *parent); +#endif /** - * Paste the contents of clipboard at the current mouse or cursor - * position. Provide a button on the toolbar with the clipboard history - * menu if Klipper is running. * @since 5.23 + * @deprecated since 5.39. Use paste() instead. */ -KSTANDARDACTION_WITH_NEW_STYLE_CONNECT(pasteText, PasteText) +#ifndef KDE_NO_DEPRECATED +#ifdef DOXYGEN_SHOULD_SKIP_THIS + inline QAction *pasteText(const QObject *recvr, Func slot, QObject *parent); +#else +template +KCONFIGWIDGETS_DEPRECATED_EXPORT inline typename std::enable_if::value, QAction>::type *pasteText(const Receiver *recvr, Func slot, QObject *parent) +{ return create(PasteText, recvr, slot, parent); } +#endif // DOXYGEN_SHOULD_SKIP_THIS +#endif // KDE_NO_DEPRECATED /** * Clear the content of the focus widget diff --git a/src/kstandardaction.cpp b/src/kstandardaction.cpp --- a/src/kstandardaction.cpp +++ b/src/kstandardaction.cpp @@ -231,9 +231,11 @@ pAction = new KToggleFullScreenAction(parent); pAction->setCheckable(true); break; +#ifndef KDE_NO_DEPRECATED case PasteText: pAction = new KPasteTextAction(parent); break; +#endif // Same as default, but with the app icon case AboutApp: { @@ -400,10 +402,12 @@ return KStandardAction::create(Paste, recvr, slot, parent); } +#ifndef KDE_NO_DEPRECATED QAction *pasteText(const QObject *recvr, const char *slot, QObject *parent) { return KStandardAction::create(PasteText, recvr, slot, parent); } +#endif QAction *clear(const QObject *recvr, const char *slot, QObject *parent) {