From f4dc189d9b7fe93b674e1f92919870ae5aac9430 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 9 Apr 2025 15:59:01 +0200 Subject: [PATCH] Fix "Send to CodePaster..." This vanished from the context menu in the diff editors with c9ceed697ff288c2c0abcddc9f02e6958ea9d5cd The CodePaster::Service needs to be added to the plugin manager object pool because it is retrieved by other plugins while avoiding the runtime dependency on the Code Paster plugin. Change-Id: I021a06264298729fdd3271e0805d34a742b06369 Reviewed-by: hjk --- src/plugins/cpaster/cpasterplugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 2f3c4561960..a2aedfb39d8 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -74,6 +75,7 @@ class CodePasterPluginPrivate : public QObject { public: CodePasterPluginPrivate(); + ~CodePasterPluginPrivate(); void post(PasteSource pasteSources); void post(QString data, const QString &mimeType); @@ -173,6 +175,13 @@ CodePasterPluginPrivate::CodePasterPluginPrivate() .setText(Tr::tr("Fetch from URL...")) .addToContainer(menu) .addOnTriggered(this, &CodePasterPluginPrivate::fetchUrl); + + ExtensionSystem::PluginManager::addObject(&m_service); +} + +CodePasterPluginPrivate::~CodePasterPluginPrivate() +{ + ExtensionSystem::PluginManager::removeObject(&m_service); } static inline void textFromCurrentEditor(QString *text, QString *mimeType)