[education/rkward/add_kate_plugin_wrappers] rkward/windows: Adjust wrappers to signature that was actually added in KTextEditor::MainWindow

Thomas Friedrichsmeier null at kde.org
Fri May 12 21:50:03 BST 2023


Git commit 4a2c5da8ba58e4b099787dfe502ccc7ac909e4c0 by Thomas Friedrichsmeier.
Committed on 12/05/2023 at 20:49.
Pushed by tfry into branch 'add_kate_plugin_wrappers'.

Adjust wrappers to signature that was actually added in KTextEditor::MainWindow

M  +4    -2    rkward/windows/katepluginintegration.cpp
M  +2    -2    rkward/windows/katepluginintegration.h
M  +1    -1    rkward/windows/rkcommandlog.h

https://invent.kde.org/education/rkward/commit/4a2c5da8ba58e4b099787dfe502ccc7ac909e4c0

diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index eb46622f..6d6ceee5 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -414,7 +414,7 @@ QWidget *KatePluginIntegrationWindow::toolviewForName(const QString &toolviewNam
 	return RKToolWindowList::findToolWindowById(toolviewName);
 }
 
-void KatePluginIntegrationWindow::addWidget(QWidget *widget) {
+bool KatePluginIntegrationWindow::addWidget(QWidget *widget) {
 	RK_TRACE(APP);
 
 	RK_DEBUG(APP, DL_DEBUG, "addWidget %p: %s", widget, qPrintable(widget->windowTitle()));
@@ -424,11 +424,12 @@ void KatePluginIntegrationWindow::addWidget(QWidget *widget) {
 	window->setCaption(widget->windowTitle());
 	widget->show();
 	RKWorkplace::mainWorkplace()->addWindow(window);
+	return true;
 }
 
 #include "../rbackend/rcommand.h"
 #include "rkcommandlog.h"
-void KatePluginIntegrationWindow::showMessage(const QVariantMap &map) {
+bool KatePluginIntegrationWindow::showMessage(const QVariantMap &map) {
 	RK_TRACE(APP);
 
 	ROutput::ROutputType severity = ROutput::Output;
@@ -436,6 +437,7 @@ void KatePluginIntegrationWindow::showMessage(const QVariantMap &map) {
 	if (type == QStringLiteral("Error")) severity = ROutput::Error;
 	else if (type == QStringLiteral("Warning")) severity = ROutput::Warning;
 	RKCommandLog::getLog()->addOtherMessage(map["text"].toString(), map["categoryicon"].value<QIcon>(), severity);
+	return true;
 }
 
 void KatePluginIntegrationWindow::insertWidgetInStatusbar(QWidget *widget) {
diff --git a/rkward/windows/katepluginintegration.h b/rkward/windows/katepluginintegration.h
index 66cb2316..cd14e368 100644
--- a/rkward/windows/katepluginintegration.h
+++ b/rkward/windows/katepluginintegration.h
@@ -100,8 +100,8 @@ private slots:
 
 // New in Kate 2023-07, not yet formalized in KTextEditor
 	QWidget *toolviewForName(const QString &toolviewName);
-	void showMessage(const QVariantMap &map);
-	void addWidget(QWidget *widget);
+	bool showMessage(const QVariantMap &map);
+	bool addWidget(QWidget *widget);
 	void insertWidgetInStatusbar(QWidget *widget);
 private:
 friend class KatePluginIntegrationApp;
diff --git a/rkward/windows/rkcommandlog.h b/rkward/windows/rkcommandlog.h
index dba234eb..839e2343 100644
--- a/rkward/windows/rkcommandlog.h
+++ b/rkward/windows/rkcommandlog.h
@@ -30,7 +30,7 @@ public:
 	void addInput (RCommand *command);
 /** Adds output to the log_view-window (i.e. replies received) */
 	void newOutput (RCommand *command, ROutput *output_fragment);
-/** Adds output no originating from R. Note: Currently used from kate plugins, only, see katepluginintegration.cpp */
+/** Adds output not originating from R. Note: Currently used from kate plugins, only, see katepluginintegration.cpp */
 	void addOtherMessage(const QString &message, const QIcon &icon, ROutput::ROutputType severity);
 
 	static RKCommandLog *getLog () { return rkcommand_log; };


More information about the rkward-tracker mailing list