[education/rkward] rkward/misc: Remove deprecated KPasteTextAction

Thomas Friedrichsmeier null at kde.org
Sat Mar 26 20:32:58 GMT 2022


Git commit e71a1f08c91cefd802ca942a190208a7bfe03238 by Thomas Friedrichsmeier.
Committed on 26/03/2022 at 20:32.
Pushed by tfry into branch 'master'.

Remove deprecated KPasteTextAction

M  +14   -12   rkward/misc/rkspecialactions.cpp
M  +3    -3    rkward/misc/rkspecialactions.h

https://invent.kde.org/education/rkward/commit/e71a1f08c91cefd802ca942a190208a7bfe03238

diff --git a/rkward/misc/rkspecialactions.cpp b/rkward/misc/rkspecialactions.cpp
index 547f96c8..d9b8bbee 100644
--- a/rkward/misc/rkspecialactions.cpp
+++ b/rkward/misc/rkspecialactions.cpp
@@ -2,7 +2,7 @@
                           rkspecialactions  -  description
                              -------------------
     begin                : Mon Mar 15 2010
-    copyright            : (C) 2010 by Thomas Friedrichsmeier
+    copyright            : (C) 2010-2022 by Thomas Friedrichsmeier
     email                : thomas.friedrichsmeier at kdemail.net
  ***************************************************************************/
 
@@ -21,26 +21,28 @@
 
 #include "../debug.h"
 
-RKPasteSpecialAction::RKPasteSpecialAction (QObject* parent) : KPasteTextAction (parent) {
-	RK_TRACE (MISC);
+RKPasteSpecialAction::RKPasteSpecialAction(QObject* parent) : QAction(parent) {
+	RK_TRACE(MISC);
 
-	setText (i18n ("Paste special..."));
-	connect (this, &QAction::triggered, this, &RKPasteSpecialAction::doSpecialPaste);
+	setText(i18n("Paste special..."));
+	connect(this, &QAction::triggered, this, &RKPasteSpecialAction::doSpecialPaste);
 }
 
-RKPasteSpecialAction::~RKPasteSpecialAction () {
-	RK_TRACE (MISC);
+RKPasteSpecialAction::~RKPasteSpecialAction() {
+	RK_TRACE(MISC);
 }
 
-void RKPasteSpecialAction::doSpecialPaste () {
-	RK_TRACE (MISC);
+void RKPasteSpecialAction::doSpecialPaste() {
+	RK_TRACE(MISC);
 
-	RKPasteSpecialDialog* dialog = new RKPasteSpecialDialog (associatedWidgets ().first ());
-	int res = dialog->exec ();
+	QWidget *pwin = nullptr;
+	if (!associatedWidgets().isEmpty()) pwin = associatedWidgets().at(0);
+	RKPasteSpecialDialog* dialog = new RKPasteSpecialDialog(pwin);
+	int res = dialog->exec();
 	if (res == QDialog::Accepted) {
 		emit pasteText(dialog->resultingText());
 	}
-	dialog->deleteLater ();
+	dialog->deleteLater();
 }
 
 #include <QCheckBox>
diff --git a/rkward/misc/rkspecialactions.h b/rkward/misc/rkspecialactions.h
index 31b363a8..3b306acb 100644
--- a/rkward/misc/rkspecialactions.h
+++ b/rkward/misc/rkspecialactions.h
@@ -2,7 +2,7 @@
                           rkspecialactions  -  description
                              -------------------
     begin                : Mon Mar 15 2010
-    copyright            : (C) 2010 by Thomas Friedrichsmeier
+    copyright            : (C) 2010-2022 by Thomas Friedrichsmeier
     email                : thomas.friedrichsmeier at kdemail.net
  ***************************************************************************/
 
@@ -18,12 +18,12 @@
 #ifndef RKSPECIALACTIONS_H
 #define RKSPECIALACTIONS_H
 
-#include <kpastetextaction.h>
+#include <QAction>
 
 /** This namespace provides functions to generate some standard actions, i.e. actions which are needed at more than one place.
 
 @author Thomas Friedrichsmeier */
-class RKPasteSpecialAction : public KPasteTextAction {
+class RKPasteSpecialAction : public QAction {
 	Q_OBJECT
 public:
 	explicit RKPasteSpecialAction (QObject* parent);


More information about the rkward-tracker mailing list