1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Add internet_service to SpotifySearchProvider so custom context menu is correctly shown on playlist items created from the global search

This commit is contained in:
Arnaud Bienner 2014-12-03 22:27:43 +01:00
parent 20e626a9ab
commit 05d43e27a9
4 changed files with 16 additions and 15 deletions

View File

@ -32,11 +32,11 @@ class GroovesharkSearchProvider : public SearchProvider {
void Init(GroovesharkService* service);
// SearchProvider
void SearchAsync(int id, const QString& query);
void LoadArtAsync(int id, const Result& result);
bool IsLoggedIn();
void ShowConfig();
InternetService* internet_service() { return service_; }
void SearchAsync(int id, const QString& query) override;
void LoadArtAsync(int id, const Result& result) override;
bool IsLoggedIn() override;
void ShowConfig() override;
InternetService* internet_service() override { return service_; }
private slots:
void SearchDone(int id, const SongList& songs);

View File

@ -23,7 +23,6 @@
#include "core/logging.h"
#include "internet/internetmodel.h"
#include "internet/spotifyserver.h"
#include "internet/spotifyservice.h"
#include "playlist/songmimedata.h"
namespace {

View File

@ -20,9 +20,9 @@
#include "searchprovider.h"
#include "spotifymessages.pb.h"
#include "internet/spotifyservice.h"
class SpotifyServer;
class SpotifyService;
class SpotifySearchProvider : public SearchProvider {
Q_OBJECT
@ -34,8 +34,10 @@ class SpotifySearchProvider : public SearchProvider {
void LoadArtAsync(int id, const Result& result);
QStringList GetSuggestions(int count);
bool IsLoggedIn();
void ShowConfig();
// SearchProvider
bool IsLoggedIn() override;
void ShowConfig() override;
InternetService* internet_service() override { return service_; }
private slots:
void ServerDestroyed();

View File

@ -49,13 +49,13 @@ class SpotifyService : public InternetService {
static const char* kBlobDownloadUrl;
static const int kSearchDelayMsec;
void ReloadSettings();
void ReloadSettings() override;
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* parent);
void ShowContextMenu(const QPoint& global_pos);
void ItemDoubleClicked(QStandardItem* item);
void DropMimeData(const QMimeData* data, const QModelIndex& index);
QStandardItem* CreateRootItem() override;
void LazyPopulate(QStandardItem* parent) override;
void ShowContextMenu(const QPoint& global_pos) override;
void ItemDoubleClicked(QStandardItem* item) override;
void DropMimeData(const QMimeData* data, const QModelIndex& index) override;
QList<QAction*> playlistitem_actions(const Song& song) override;
PlaylistItem::Options playlistitem_options() const;
QWidget* HeaderWidget() const;