diff options
author | Eike Ziller <[email protected]> | 2025-04-09 15:59:01 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2025-04-10 06:26:06 +0000 |
commit | f4dc189d9b7fe93b674e1f92919870ae5aac9430 (patch) | |
tree | 5630863a29ff66e62a1464a18527246423f74497 | |
parent | 448db4f47cd7b4435759dd7675bf90ebf58872f9 (diff) |
Fix "Send to CodePaster..."v16.0.1
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 <[email protected]>
-rw-r--r-- | src/plugins/cpaster/cpasterplugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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 <coreplugin/messagemanager.h> #include <extensionsystem/iplugin.h> +#include <extensionsystem/pluginmanager.h> #include <utils/algorithm.h> #include <utils/fileutils.h> @@ -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) |