[education/rkward] rkward: Fix more deprecation warnings.

Thomas Friedrichsmeier null at kde.org
Sun Jul 3 22:00:59 BST 2022


Git commit a3121f0f0c145ee78752f3d647b919550979bdcf by Thomas Friedrichsmeier.
Committed on 03/07/2022 at 21:00.
Pushed by tfry into branch 'master'.

Fix more deprecation warnings.

M  +1    -1    rkward/dataeditor/rkvareditmodel.cpp
M  +1    -0    rkward/misc/rkprogresscontrol.cpp
M  +4    -0    rkward/plugin/rkcomponentproperties.cpp
M  +8    -1    rkward/windows/katepluginintegration.cpp
M  +9    -0    rkward/windows/rkcommandeditorwindow.cpp
M  +1    -1    rkward/windows/rkdebugconsole.cpp

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

diff --git a/rkward/dataeditor/rkvareditmodel.cpp b/rkward/dataeditor/rkvareditmodel.cpp
index 2af5b972..6dc6be09 100644
--- a/rkward/dataeditor/rkvareditmodel.cpp
+++ b/rkward/dataeditor/rkvareditmodel.cpp
@@ -577,7 +577,7 @@ QVariant RKVarEditMetaModel::data (const QModelIndex& index, int role) const {
 Qt::ItemFlags RKVarEditMetaModel::flags (const QModelIndex& index) const {
 	RK_TRACE (EDITOR);
 
-	Qt::ItemFlags flags = 0;
+	Qt::ItemFlags flags(Qt::NoItemFlags);
 
 	if (!index.isValid ()) return flags;
 	int row = index.row ();
diff --git a/rkward/misc/rkprogresscontrol.cpp b/rkward/misc/rkprogresscontrol.cpp
index 1f2b9bef..6fc1547d 100644
--- a/rkward/misc/rkprogresscontrol.cpp
+++ b/rkward/misc/rkprogresscontrol.cpp
@@ -518,6 +518,7 @@ void RKInlineProgressControl::show(int delay_ms) {
 
 bool RKInlineProgressControl::eventFilter(QObject *w, QEvent *e) {
 	RK_TRACE(MISC);
+	Q_UNUSED(w); // we only installed filter on one object (logical_parent)
 	if (e->type() == QEvent::Resize || e->type() == QEvent::Show) {
 		QTimer::singleShot(0, this, [this]() {
 			wrapper->resize(display_area->size());
diff --git a/rkward/plugin/rkcomponentproperties.cpp b/rkward/plugin/rkcomponentproperties.cpp
index 79691e81..36337954 100644
--- a/rkward/plugin/rkcomponentproperties.cpp
+++ b/rkward/plugin/rkcomponentproperties.cpp
@@ -881,7 +881,11 @@ bool RKComponentPropertyRObjects::setObjectValueSilent (RObject* object) {
 	RK_TRACE (PLUGIN);
 
 	problems.clear ();
+#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
+	QSet<RObject*> unique(object_list.constBegin(), object_list.constEnd());
+#else
 	QSet<RObject*> unique = object_list.toSet ();
+#endif
 	foreach (RObject *obj, unique) {
 		stopListenForObject (obj);
 	}
diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index a0d2c21d..7e874abe 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -24,6 +24,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
 #include <KConfigGroup>
 #include <KXMLGUIFactory>
 #include <KLocalizedString>
+#include <kcoreaddons_version.h>
 
 #include "../rkward.h"
 #include "rkworkplace.h"
@@ -46,7 +47,11 @@ KatePluginIntegrationApp::KatePluginIntegrationApp(QObject *parent) : QObject (p
 	KTextEditor::Editor::instance()->setApplication(app);
 
 	// enumerate all available kate plugins
-	QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral ("ktexteditor"), [](const KPluginMetaData &md) { return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin")); });
+#if KCOREADDONS_VERSION >= QT_VERSION_CHECK(5,89,0)
+	QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("ktexteditor"), [](const KPluginMetaData &md) { return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin")); });
+#else
+	QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("ktexteditor"), [](const KPluginMetaData &md) { return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin")); });
+#endif
 	for (int i = plugins.size() -1; i >= 0; --i) {
 		PluginInfo info;
 		info.plugin = 0;
@@ -529,6 +534,8 @@ bool KatePluginIntegrationWindow::viewsInSameSplitView(KTextEditor::View* view1,
 	RK_TRACE (APP);
 	// TODO not sure what the semantics of this really are. The two views are in the same view area (not visible, simultaneously), or in two areas split side-by-side?
 	// However, this is essentially unused in kate.
+	Q_UNUSED(view1);
+	Q_UNUSED(view2);
 	return false;
 }
 
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index cd9b9d23..d5643ab5 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -40,6 +40,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
 #include <kconfiggroup.h>
 #include <krandom.h>
 #include <kwidgetsaddons_version.h>
+#include <ktexteditor_version.h>
 
 #include "../misc/rkcommonfunctions.h"
 #include "../misc/rkstandardicons.h"
@@ -83,12 +84,16 @@ QMap<QString, KTextEditor::Document*> RKCommandEditorWindow::unnamed_documents;
 
 KTextEditor::Document* createDocument(bool with_signals) {
 	if (with_signals) {
+#if KTEXTEDITOR_VERSION < QT_VERSION_CHECK(5,80,0)
 		emit KTextEditor::Editor::instance()->application()->aboutToCreateDocuments();
+#endif
 	}
 	KTextEditor::Document* ret = KTextEditor::Editor::instance()->createDocument (RKWardMainWindow::getMain ());
 	if (with_signals) {
 		emit KTextEditor::Editor::instance()->application()->documentCreated(ret);
+#if KTEXTEDITOR_VERSION < QT_VERSION_CHECK(5,80,0)
 		emit KTextEditor::Editor::instance()->application()->documentsCreated(QList<KTextEditor::Document*>() << ret);
+#endif
 	}
 	return ret;
 }
@@ -307,12 +312,16 @@ RKCommandEditorWindow::~RKCommandEditorWindow () {
 	if (views.isEmpty ()) {
 		if (visible_to_kateplugins) {
 			emit KTextEditor::Editor::instance()->application()->documentWillBeDeleted(m_doc);
+#if KTEXTEDITOR_VERSION < QT_VERSION_CHECK(5,80,0)
 			emit KTextEditor::Editor::instance()->application()->aboutToDeleteDocuments(QList<KTextEditor::Document*>() << m_doc);
+#endif
 		}
 		delete m_doc;
 		if (visible_to_kateplugins) {
 			emit KTextEditor::Editor::instance()->application()->documentDeleted(m_doc);
+#if KTEXTEDITOR_VERSION < QT_VERSION_CHECK(5,80,0)
 			emit KTextEditor::Editor::instance()->application()->documentsDeleted(QList<KTextEditor::Document*>() << m_doc);
+#endif
 		}
 		if (!delete_on_close.isEmpty ()) KIO::del (delete_on_close)->start ();
 		unnamed_documents.remove (_id);
diff --git a/rkward/windows/rkdebugconsole.cpp b/rkward/windows/rkdebugconsole.cpp
index 15eb9c30..f5ffedb4 100644
--- a/rkward/windows/rkdebugconsole.cpp
+++ b/rkward/windows/rkdebugconsole.cpp
@@ -61,7 +61,7 @@ RKDebugConsole::RKDebugConsole (QWidget *parent, bool tool_window, const char *n
 	lower_layout->addWidget (prompt_label);
 	reply_edit = new KHistoryComboBox (this);
 	reply_edit->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
-	connect (reply_edit, static_cast<void (KHistoryComboBox::*)()>(&KHistoryComboBox::returnPressed), this, &RKDebugConsole::sendReplySlot);
+	connect (reply_edit, static_cast<void (KHistoryComboBox::*)(const QString&)>(&KHistoryComboBox::returnPressed), this, &RKDebugConsole::sendReplySlot);
 	lower_layout->addWidget (reply_edit);
 	setFocusProxy (reply_edit);
 


More information about the rkward-tracker mailing list