mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
support and fix search tomahawk link
This commit is contained in:
@@ -50,6 +50,7 @@
|
|||||||
#include "utils/spotifyparser.h"
|
#include "utils/spotifyparser.h"
|
||||||
#include "utils/shortenedlinkparser.h"
|
#include "utils/shortenedlinkparser.h"
|
||||||
#include "utils/rdioparser.h"
|
#include "utils/rdioparser.h"
|
||||||
|
#include "widgets/searchwidget.h"
|
||||||
|
|
||||||
GlobalActionManager* GlobalActionManager::s_instance = 0;
|
GlobalActionManager* GlobalActionManager::s_instance = 0;
|
||||||
|
|
||||||
@@ -500,6 +501,11 @@ bool
|
|||||||
GlobalActionManager::handleSearchCommand( const QUrl& url )
|
GlobalActionManager::handleSearchCommand( const QUrl& url )
|
||||||
{
|
{
|
||||||
// open the super collection and set this as the search filter
|
// open the super collection and set this as the search filter
|
||||||
|
QString queryStr;
|
||||||
|
if ( url.hasQueryItem( "query" ) )
|
||||||
|
queryStr = url.queryItemValue( "query" );
|
||||||
|
else
|
||||||
|
{
|
||||||
QStringList query;
|
QStringList query;
|
||||||
if( url.hasQueryItem( "artist" ) )
|
if( url.hasQueryItem( "artist" ) )
|
||||||
query << url.queryItemValue( "artist" );
|
query << url.queryItemValue( "artist" );
|
||||||
@@ -507,13 +513,14 @@ GlobalActionManager::handleSearchCommand( const QUrl& url )
|
|||||||
query << url.queryItemValue( "album" );
|
query << url.queryItemValue( "album" );
|
||||||
if( url.hasQueryItem( "title" ) )
|
if( url.hasQueryItem( "title" ) )
|
||||||
query << url.queryItemValue( "title" );
|
query << url.queryItemValue( "title" );
|
||||||
QString queryStr = query.join( " " );
|
queryStr = query.join( " " );
|
||||||
|
}
|
||||||
|
|
||||||
if( queryStr.isEmpty() )
|
if( queryStr.trimmed().isEmpty() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ViewManager::instance()->showSuperCollection();
|
ViewManager::instance()->show( new SearchWidget( queryStr.trimmed() ) );
|
||||||
// ViewManager::instance()->topbar()->setFilter( queryStr );
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user