diff --git a/src/internet/core/cloudfileservice.cpp b/src/internet/core/cloudfileservice.cpp index 054799805..936353fc6 100644 --- a/src/internet/core/cloudfileservice.cpp +++ b/src/internet/core/cloudfileservice.cpp @@ -107,15 +107,6 @@ void CloudFileService::PopulateContextMenu() { SLOT(ShowSettingsDialog())); } -void CloudFileService::ShowContextMenu(const QPoint& global_pos) { - if (!context_menu_) { - context_menu_.reset(new QMenu); - PopulateContextMenu(); - } - UpdateContextMenu(); - context_menu_->popup(global_pos); -} - void CloudFileService::ShowCoverManager() { if (!cover_manager_) { cover_manager_.reset(new AlbumCoverManager(app_, library_backend_.get())); diff --git a/src/internet/core/cloudfileservice.h b/src/internet/core/cloudfileservice.h index efc18faab..3363d6d3e 100644 --- a/src/internet/core/cloudfileservice.h +++ b/src/internet/core/cloudfileservice.h @@ -45,7 +45,6 @@ class CloudFileService : public InternetService { // InternetService virtual QStandardItem* CreateRootItem(); virtual void LazyPopulate(QStandardItem* item); - virtual void ShowContextMenu(const QPoint& point); virtual bool has_credentials() const = 0; bool is_indexing() const { return indexing_task_id_ != -1; } @@ -68,9 +67,7 @@ class CloudFileService : public InternetService { void AbortReadTagsReplies(); // Called once when context menu is created - virtual void PopulateContextMenu(); - // Called every time context menu is shown - virtual void UpdateContextMenu(){}; + virtual void PopulateContextMenu() override; protected slots: void ShowCoverManager(); diff --git a/src/internet/core/internetservice.cpp b/src/internet/core/internetservice.cpp index ed9e07e61..22e05c7e3 100644 --- a/src/internet/core/internetservice.cpp +++ b/src/internet/core/internetservice.cpp @@ -88,6 +88,15 @@ void InternetService::ShowUrlBox(const QString& title, const QString& url) { } } +void InternetService::ShowContextMenu(const QPoint& global_pos) { + if (!context_menu_) { + context_menu_.reset(new QMenu); + PopulateContextMenu(); + } + UpdateContextMenu(); + context_menu_->popup(global_pos); +} + QList InternetService::GetPlaylistActions() { return QList() << GetAppendToPlaylistAction() << GetReplacePlaylistAction() diff --git a/src/internet/core/internetservice.h b/src/internet/core/internetservice.h index 6552b5b22..1704e2803 100644 --- a/src/internet/core/internetservice.h +++ b/src/internet/core/internetservice.h @@ -64,7 +64,8 @@ class InternetService : public QObject { virtual void LazyPopulate(QStandardItem* parent) = 0; virtual bool has_initial_load_settings() const { return false; } virtual void InitialLoadSettings() {} - virtual void ShowContextMenu(const QPoint& global_pos) {} + virtual void ShowContextMenu(const QPoint& global_pos); + // Create a generator for smart playlists virtual smart_playlists::GeneratorPtr CreateGenerator(QStandardItem* item) { return smart_playlists::GeneratorPtr(); @@ -103,6 +104,11 @@ class InternetService : public QObject { void OpenInNewPlaylist(); protected: + // Called once when context menu is created + virtual void PopulateContextMenu(){}; + // Called every time context menu is shown + virtual void UpdateContextMenu(){}; + // Returns all the playlist insertion related QActions (see below). QList GetPlaylistActions();