mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 17:14:00 +02:00
Use just openLink in GAM to avoid including InfoSystem, and deal with the InfoCriteriaHash in the plguin.
This commit is contained in:
@@ -77,22 +77,6 @@ GlobalActionManager::openLinkFromQuery( const Tomahawk::query_ptr& query ) const
|
|||||||
return openLink( title, artist, album );
|
return openLink( title, artist, album );
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl
|
|
||||||
GlobalActionManager::openLinkFromHash( const Tomahawk::InfoSystem::InfoCriteriaHash& hash ) const
|
|
||||||
{
|
|
||||||
QString title, artist, album;
|
|
||||||
|
|
||||||
if( !hash.isEmpty() && hash.contains( "title" ) && hash.contains( "artist" ) )
|
|
||||||
{
|
|
||||||
title = hash["title"];
|
|
||||||
artist = hash["artist"];
|
|
||||||
if( hash.contains( "album" ) )
|
|
||||||
album = hash["album"];
|
|
||||||
}
|
|
||||||
|
|
||||||
return openLink( title, artist, album );
|
|
||||||
}
|
|
||||||
|
|
||||||
QUrl
|
QUrl
|
||||||
GlobalActionManager::openLink( const QString& title, const QString& artist, const QString& album ) const
|
GlobalActionManager::openLink( const QString& title, const QString& artist, const QString& album ) const
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#include "playlist.h"
|
#include "playlist.h"
|
||||||
#include "query.h"
|
#include "query.h"
|
||||||
#include "playlist/dynamic/DynamicPlaylist.h"
|
#include "playlist/dynamic/DynamicPlaylist.h"
|
||||||
#include "infosystem/infosystem.h"
|
|
||||||
#include "dllmacro.h"
|
#include "dllmacro.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -37,7 +36,7 @@ public:
|
|||||||
virtual ~GlobalActionManager();
|
virtual ~GlobalActionManager();
|
||||||
|
|
||||||
QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const;
|
QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const;
|
||||||
QUrl openLinkFromHash( const Tomahawk::InfoSystem::InfoCriteriaHash& hash ) const;
|
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
|
||||||
|
|
||||||
void copyToClipboard( const Tomahawk::query_ptr& query ) const;
|
void copyToClipboard( const Tomahawk::query_ptr& query ) const;
|
||||||
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
||||||
@@ -70,8 +69,6 @@ private:
|
|||||||
|
|
||||||
bool doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
bool doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
||||||
|
|
||||||
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
|
|
||||||
|
|
||||||
Tomahawk::playlist_ptr m_toShow;
|
Tomahawk::playlist_ptr m_toShow;
|
||||||
Tomahawk::query_ptr m_waitingToBookmark;
|
Tomahawk::query_ptr m_waitingToBookmark;
|
||||||
Tomahawk::query_ptr m_waitingToPlay;
|
Tomahawk::query_ptr m_waitingToPlay;
|
||||||
|
@@ -140,10 +140,26 @@ AdiumPlugin::audioStarted( const QVariant &input )
|
|||||||
nowPlaying.append(" - ");
|
nowPlaying.append(" - ");
|
||||||
nowPlaying.append( hash["artist"] );
|
nowPlaying.append( hash["artist"] );
|
||||||
nowPlaying.append( " " );
|
nowPlaying.append( " " );
|
||||||
nowPlaying.append( GlobalActionManager::instance()->openLinkFromHash( hash ).toEncoded() );
|
nowPlaying.append( openLinkFromHash( hash ).toEncoded() );
|
||||||
setStatus( nowPlaying );
|
setStatus( nowPlaying );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUrl
|
||||||
|
AdiumPlugin::openLinkFromHash( const Tomahawk::InfoSystem::InfoCriteriaHash& hash ) const
|
||||||
|
{
|
||||||
|
QString title, artist, album;
|
||||||
|
|
||||||
|
if( !hash.isEmpty() && hash.contains( "title" ) && hash.contains( "artist" ) )
|
||||||
|
{
|
||||||
|
title = hash["title"];
|
||||||
|
artist = hash["artist"];
|
||||||
|
if( hash.contains( "album" ) )
|
||||||
|
album = hash["album"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return GlobalActionManager::instance()->openLink( title, artist, album );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AdiumPlugin::audioFinished( const QVariant &input )
|
AdiumPlugin::audioFinished( const QVariant &input )
|
||||||
{
|
{
|
||||||
|
@@ -41,6 +41,10 @@ protected slots:
|
|||||||
void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input );
|
void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void namChangedSlot( QNetworkAccessManager *nam ) {} // unused
|
||||||
|
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) {} // unused
|
||||||
|
|
||||||
|
private:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
void audioStarted( const QVariant &input );
|
void audioStarted( const QVariant &input );
|
||||||
@@ -49,10 +53,8 @@ public slots:
|
|||||||
void audioPaused();
|
void audioPaused();
|
||||||
void audioResumed( const QVariant &input );
|
void audioResumed( const QVariant &input );
|
||||||
|
|
||||||
void namChangedSlot( QNetworkAccessManager *nam ) {} // unused
|
QUrl openLinkFromHash( const InfoCriteriaHash& hash ) const;
|
||||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) {} // unused
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_active;
|
bool m_active;
|
||||||
QString m_beforeStatus;
|
QString m_beforeStatus;
|
||||||
QString m_afterStatus;
|
QString m_afterStatus;
|
||||||
|
2
thirdparty/jreen
vendored
2
thirdparty/jreen
vendored
Submodule thirdparty/jreen updated: 8f995f2466...2957d0ff03
Reference in New Issue
Block a user