1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 02:54:33 +02:00

Remove LinkGeneratorPlugins from LinkGenerator on destruction

This commit is contained in:
Dominik Schmidt
2014-12-09 00:07:46 +01:00
parent f751aa501c
commit 2890190c82
3 changed files with 12 additions and 0 deletions

View File

@@ -72,6 +72,13 @@ void LinkGenerator::addPlugin( LinkGeneratorPlugin* plugin )
}
void
LinkGenerator::removePlugin( LinkGeneratorPlugin* plugin )
{
m_plugins.removeAll( plugin );
}
void
LinkGenerator::copyScriptJobResultToClipboard( const QVariantMap& data )
{

View File

@@ -41,6 +41,7 @@ public:
virtual ~LinkGenerator();
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?
ScriptJob* openLink( const QString& title, const QString& artist, const QString& album ) const

View File

@@ -17,6 +17,8 @@
*/
#include "LinkGeneratorPlugin.h"
#include "LinkGenerator.h"
#include "../Query.h"
#include "../Track.h"
#include "../Artist.h"
@@ -24,6 +26,8 @@
Tomahawk::Utils::LinkGeneratorPlugin::~LinkGeneratorPlugin()
{
// do this on destroyed() if you ever make this a QObject
LinkGenerator::instance()->removePlugin( this );
}