diff --git a/src/libtomahawk/globalactionmanager.cpp b/src/libtomahawk/globalactionmanager.cpp index 83c5105a6..417730883 100644 --- a/src/libtomahawk/globalactionmanager.cpp +++ b/src/libtomahawk/globalactionmanager.cpp @@ -104,6 +104,14 @@ GlobalActionManager::openLink( const QString& title, const QString& artist, cons return link; } +QUrl +GlobalActionManager::openShortTomahawkLink( const QString& title, const QString& artist, const QString& album ) const +{ + QUrl longLink = openLink( title, artist, album ); + + +} + QString GlobalActionManager::copyPlaylistToClipboard( const dynplaylist_ptr& playlist ) { diff --git a/src/libtomahawk/globalactionmanager.h b/src/libtomahawk/globalactionmanager.h index 5c04502be..901b89b46 100644 --- a/src/libtomahawk/globalactionmanager.h +++ b/src/libtomahawk/globalactionmanager.h @@ -25,8 +25,11 @@ #include "playlist/dynamic/DynamicPlaylist.h" #include "dllmacro.h" +#include #include #include +#include + /** * Handles global actions such as parsing and creation of links, mime data handling, etc @@ -41,6 +44,8 @@ public: QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const; QUrl openLink( const QString& title, const QString& artist, const QString& album ) const; + QUrl shortenLink( const QString& link ); + /// Takes a spotify link and performs the default open action on it bool openSpotifyLink( const QString& link ); @@ -59,6 +64,9 @@ public slots: void handleOpenTrack( const Tomahawk::query_ptr& qry ); +signals: + void shortLinkReady( QUrl url ); + private slots: void bookmarkPlaylistCreated( const Tomahawk::playlist_ptr& pl ); void showPlaylist(); @@ -93,6 +101,8 @@ private: Tomahawk::query_ptr m_waitingToBookmark; Tomahawk::query_ptr m_waitingToPlay; + QWeakPointer m_nam; + static GlobalActionManager* s_instance; }; diff --git a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp index ea927931b..d29e3484e 100644 --- a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp @@ -130,6 +130,18 @@ AdiumPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVar m_pauseTimer->stop(); } +void +AdiumPlugin::namChangedSlot( QNetworkAccessManager* nam ) +{ + m_nam = QWeakPointer( nam ); + + if( !m_nam.isNull() ) + { + connect( m_nam.data(), SIGNAL( finished( QNetworkReply* ) ), + this, SLOT( replyFinished( QNetworkReply* ) ) ); + } +} + /** Audio state slots */ void AdiumPlugin::audioStarted( const QVariant &input ) diff --git a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h index 208891164..06b831018 100644 --- a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h @@ -21,8 +21,10 @@ #include "infosystem/infosystem.h" +#include #include #include +#include class QTimer; @@ -48,7 +50,7 @@ protected slots: void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input ); public slots: - void namChangedSlot( QNetworkAccessManager* /*nam*/ ) {} // unused + void namChangedSlot( QNetworkAccessManager* nam ); virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { @@ -75,6 +77,7 @@ private: QString m_afterStatus; QTimer* m_pauseTimer; + QWeakPointer m_nam; };