mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 13:17:34 +02:00
First work at shorten-link stuff, does not compile.
This commit is contained in:
@@ -104,6 +104,14 @@ GlobalActionManager::openLink( const QString& title, const QString& artist, cons
|
|||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUrl
|
||||||
|
GlobalActionManager::openShortTomahawkLink( const QString& title, const QString& artist, const QString& album ) const
|
||||||
|
{
|
||||||
|
QUrl longLink = openLink( title, artist, album );
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
GlobalActionManager::copyPlaylistToClipboard( const dynplaylist_ptr& playlist )
|
GlobalActionManager::copyPlaylistToClipboard( const dynplaylist_ptr& playlist )
|
||||||
{
|
{
|
||||||
|
@@ -25,8 +25,11 @@
|
|||||||
#include "playlist/dynamic/DynamicPlaylist.h"
|
#include "playlist/dynamic/DynamicPlaylist.h"
|
||||||
#include "dllmacro.h"
|
#include "dllmacro.h"
|
||||||
|
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QWeakPointer>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles global actions such as parsing and creation of links, mime data handling, etc
|
* 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 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 ) const;
|
||||||
|
|
||||||
|
QUrl shortenLink( const QString& link );
|
||||||
|
|
||||||
/// Takes a spotify link and performs the default open action on it
|
/// Takes a spotify link and performs the default open action on it
|
||||||
bool openSpotifyLink( const QString& link );
|
bool openSpotifyLink( const QString& link );
|
||||||
|
|
||||||
@@ -59,6 +64,9 @@ public slots:
|
|||||||
|
|
||||||
void handleOpenTrack( const Tomahawk::query_ptr& qry );
|
void handleOpenTrack( const Tomahawk::query_ptr& qry );
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void shortLinkReady( QUrl url );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void bookmarkPlaylistCreated( const Tomahawk::playlist_ptr& pl );
|
void bookmarkPlaylistCreated( const Tomahawk::playlist_ptr& pl );
|
||||||
void showPlaylist();
|
void showPlaylist();
|
||||||
@@ -93,6 +101,8 @@ private:
|
|||||||
Tomahawk::query_ptr m_waitingToBookmark;
|
Tomahawk::query_ptr m_waitingToBookmark;
|
||||||
Tomahawk::query_ptr m_waitingToPlay;
|
Tomahawk::query_ptr m_waitingToPlay;
|
||||||
|
|
||||||
|
QWeakPointer<QNetworkAccessManager> m_nam;
|
||||||
|
|
||||||
static GlobalActionManager* s_instance;
|
static GlobalActionManager* s_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -130,6 +130,18 @@ AdiumPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVar
|
|||||||
m_pauseTimer->stop();
|
m_pauseTimer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AdiumPlugin::namChangedSlot( QNetworkAccessManager* nam )
|
||||||
|
{
|
||||||
|
m_nam = QWeakPointer<QNetworkAccessManager>( nam );
|
||||||
|
|
||||||
|
if( !m_nam.isNull() )
|
||||||
|
{
|
||||||
|
connect( m_nam.data(), SIGNAL( finished( QNetworkReply* ) ),
|
||||||
|
this, SLOT( replyFinished( QNetworkReply* ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Audio state slots */
|
/** Audio state slots */
|
||||||
void
|
void
|
||||||
AdiumPlugin::audioStarted( const QVariant &input )
|
AdiumPlugin::audioStarted( const QVariant &input )
|
||||||
|
@@ -21,8 +21,10 @@
|
|||||||
|
|
||||||
#include "infosystem/infosystem.h"
|
#include "infosystem/infosystem.h"
|
||||||
|
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <QWeakPointer>
|
||||||
|
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ protected slots:
|
|||||||
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input );
|
void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input );
|
||||||
|
|
||||||
public slots:
|
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 )
|
virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||||
{
|
{
|
||||||
@@ -75,6 +77,7 @@ private:
|
|||||||
QString m_afterStatus;
|
QString m_afterStatus;
|
||||||
|
|
||||||
QTimer* m_pauseTimer;
|
QTimer* m_pauseTimer;
|
||||||
|
QWeakPointer<QNetworkAccessManager> m_nam;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user