1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-19 23:41:51 +02:00

Parse the "+" of a Tomahawk link as a space. Adium plugin defaults to using toma.hk links now.

This commit is contained in:
Alejandro Wainzinger 2011-06-08 01:37:52 -07:00
parent 8ca84e9ba2
commit 3277ad7802
3 changed files with 6 additions and 5 deletions

View File

@ -78,9 +78,9 @@ GlobalActionManager::openLinkFromQuery( const Tomahawk::query_ptr& query ) const
}
QUrl
GlobalActionManager::openLink( const QString& title, const QString& artist, const QString& album ) const
GlobalActionManager::openLink( const QString& title, const QString& artist, const QString& album, bool tomahk ) const
{
QUrl link( "tomahawk://open/track/" );
QUrl link( tomahk ? "http://toma.hk/open/track/" : "tomahawk://open/track/" );
if( !title.isEmpty() )
link.addQueryItem( "title", title );
@ -172,8 +172,9 @@ GlobalActionManager::copyToClipboard( const Tomahawk::query_ptr& query ) const
bool
GlobalActionManager::parseTomahawkLink( const QString& url )
{
if( url.contains( "tomahawk://" ) ) {
if( url.contains( "tomahawk://" ) ) {
QString cmd = url.mid( 11 );
cmd.replace( "%2B", "%20" );
qDebug() << "Parsing tomahawk link command" << cmd;
QString cmdType = cmd.split( "/" ).first();

View File

@ -36,7 +36,7 @@ public:
virtual ~GlobalActionManager();
QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const;
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
QUrl openLink( const QString& title, const QString& artist, const QString& album, bool tomahk=false ) const;
void copyToClipboard( const Tomahawk::query_ptr& query ) const;
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );

View File

@ -157,7 +157,7 @@ AdiumPlugin::openLinkFromHash( const Tomahawk::InfoSystem::InfoCriteriaHash& has
album = hash["album"];
}
return GlobalActionManager::instance()->openLink( title, artist, album );
return GlobalActionManager::instance()->openLink( title, artist, album, true );
}
void