Use URL Handler for Tidal

This commit is contained in:
Jonas Kvinge
2018-09-20 22:13:30 +02:00
parent 25249be37f
commit 17fe201473
12 changed files with 152 additions and 106 deletions

View File

@@ -110,7 +110,6 @@ class InternetModel : public QStandardItemModel {
template <typename T>
static T *Service() {
//return static_cast<T*>(ServiceByName(T::kServiceName));
return static_cast<T*>(ServiceBySource(T::kSource));
}

View File

@@ -27,6 +27,6 @@
#include "internetmodel.h"
#include "internetservice.h"
InternetService::InternetService(Song::Source source, const QString &name, Application *app, InternetModel *model, QObject *parent)
: QObject(parent), app_(app), model_(model), source_(source), name_(name) {
InternetService::InternetService(Song::Source source, const QString &name, const QString &url_scheme, Application *app, InternetModel *model, QObject *parent)
: QObject(parent), app_(app), model_(model), source_(source), name_(name), url_scheme_(url_scheme) {
}

View File

@@ -42,10 +42,11 @@ class InternetService : public QObject {
Q_OBJECT
public:
InternetService(Song::Source source, const QString &name, Application *app, InternetModel *model, QObject *parent = nullptr);
InternetService(Song::Source source, const QString &name, const QString &url_scheme, Application *app, InternetModel *model, QObject *parent = nullptr);
virtual ~InternetService() {}
Song::Source source() const { return source_; }
QString name() const { return name_; }
QString url_scheme() const { return url_scheme_; }
InternetModel *model() const { return model_; }
virtual bool has_initial_load_settings() const { return false; }
virtual void InitialLoadSettings() {}
@@ -61,6 +62,7 @@ class InternetService : public QObject {
InternetModel *model_;
Song::Source source_;
QString name_;
QString url_scheme_;
};
Q_DECLARE_METATYPE(InternetService*);