[education/rkward] rkward/windows: Silence some valgrind warnings

Thomas Friedrichsmeier null at kde.org
Sat Mar 26 14:38:33 GMT 2022


Git commit 1a54ce75ccb488d470aa27cbf5c45929c2ea4333 by Thomas Friedrichsmeier.
Committed on 26/03/2022 at 14:15.
Pushed by tfry into branch 'master'.

Silence some valgrind warnings

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

https://invent.kde.org/education/rkward/commit/1a54ce75ccb488d470aa27cbf5c45929c2ea4333

diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index 002113b5..bc753724 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -57,7 +57,7 @@ KatePluginIntegrationApp::KatePluginIntegrationApp(QObject *parent) : QObject (p
 
 	// enumerate all available kate plugins
 	QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral ("ktexteditor"), [](const KPluginMetaData &md) { return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin")); });
-    for (int i = plugins.size() -1; i >= 0; --i) {
+	for (int i = plugins.size() -1; i >= 0; --i) {
 		PluginInfo info;
 		info.plugin = 0;
 		info.data = plugins[i];
@@ -589,7 +589,7 @@ QObject* KatePluginIntegrationWindow::createPluginView(KTextEditor::Plugin* plug
 	active_plugin = 0;
 	disconnect(factory(), &KXMLGUIFactory::clientAdded, this, &KatePluginIntegrationWindow::catchXMLGUIClientsHack);
 	fixUpPluginUI(app->idForPlugin(plugin), resources);
-	connect(plugin, &QObject::destroyed, [&]() { plugin_resources.remove(plugin); });
+	connect(plugin, &QObject::destroyed, [this, plugin]() { plugin_resources.remove(plugin); });
 	return resources.view;
 }
 
diff --git a/rkward/windows/katepluginintegration.h b/rkward/windows/katepluginintegration.h
index 98c4b038..79fcf5d3 100644
--- a/rkward/windows/katepluginintegration.h
+++ b/rkward/windows/katepluginintegration.h
@@ -117,7 +117,7 @@ friend class KatePluginIntegrationApp;
 		QList<KXMLGUIClient*> clients;
 		QList<RKMDIWindow*> windows;
 	};
-	QHash<KTextEditor::Plugin*, PluginResources> plugin_resources;
+	QHash<QObject*, PluginResources> plugin_resources;
 
 	KatePluginIntegrationApp *app;
 	KXMLGUIClient *dynamic_actions_client;


More information about the rkward-tracker mailing list