mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-16 19:14:06 +02:00
Remove LinkGeneratorPlugins from LinkGenerator on destruction
This commit is contained in:
@@ -72,6 +72,13 @@ void LinkGenerator::addPlugin( LinkGeneratorPlugin* plugin )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
LinkGenerator::removePlugin( LinkGeneratorPlugin* plugin )
|
||||||
|
{
|
||||||
|
m_plugins.removeAll( plugin );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LinkGenerator::copyScriptJobResultToClipboard( const QVariantMap& data )
|
LinkGenerator::copyScriptJobResultToClipboard( const QVariantMap& data )
|
||||||
{
|
{
|
||||||
|
@@ -41,6 +41,7 @@ public:
|
|||||||
virtual ~LinkGenerator();
|
virtual ~LinkGenerator();
|
||||||
|
|
||||||
void addPlugin( LinkGeneratorPlugin* plugin );
|
void addPlugin( LinkGeneratorPlugin* plugin );
|
||||||
|
void removePlugin( LinkGeneratorPlugin* plugin );
|
||||||
|
|
||||||
// TODO: openLink(QString, QString, QString) is a rather annoying special case. Can we get rid of it?
|
// TODO: openLink(QString, QString, QString) is a rather annoying special case. Can we get rid of it?
|
||||||
ScriptJob* openLink( const QString& title, const QString& artist, const QString& album ) const
|
ScriptJob* openLink( const QString& title, const QString& artist, const QString& album ) const
|
||||||
|
@@ -17,6 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "LinkGeneratorPlugin.h"
|
#include "LinkGeneratorPlugin.h"
|
||||||
|
|
||||||
|
#include "LinkGenerator.h"
|
||||||
|
|
||||||
#include "../Query.h"
|
#include "../Query.h"
|
||||||
#include "../Track.h"
|
#include "../Track.h"
|
||||||
#include "../Artist.h"
|
#include "../Artist.h"
|
||||||
@@ -24,6 +26,8 @@
|
|||||||
|
|
||||||
Tomahawk::Utils::LinkGeneratorPlugin::~LinkGeneratorPlugin()
|
Tomahawk::Utils::LinkGeneratorPlugin::~LinkGeneratorPlugin()
|
||||||
{
|
{
|
||||||
|
// do this on destroyed() if you ever make this a QObject
|
||||||
|
LinkGenerator::instance()->removePlugin( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user