From df548b174bb19d39fb5492c18710fd2f61c478ca Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 3 Jul 2019 18:03:18 +0000 Subject: scrobbler: removed listenbrainz support git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8986 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/scrobbler/defines.h | 2 - src/plugins/General/scrobbler/scrobblerhandler.cpp | 2 - src/plugins/General/scrobbler/settingsdialog.cpp | 38 +------------- src/plugins/General/scrobbler/settingsdialog.h | 4 -- src/plugins/General/scrobbler/settingsdialog.ui | 58 +--------------------- 5 files changed, 2 insertions(+), 102 deletions(-) (limited to 'src/plugins/General/scrobbler') diff --git a/src/plugins/General/scrobbler/defines.h b/src/plugins/General/scrobbler/defines.h index aabab79d9..54edbcdbb 100644 --- a/src/plugins/General/scrobbler/defines.h +++ b/src/plugins/General/scrobbler/defines.h @@ -23,10 +23,8 @@ #define SCROBBLER_LASTFM_URL "http://ws.audioscrobbler.com/2.0/" #define SCROBBLER_LIBREFM_URL "https://libre.fm/2.0/" -#define SCROBBLER_LISTENBRAINZ_URL "https://api.listenbrainz.org/2.0/" #define LASTFM_AUTH_URL "http://www.last.fm/api/auth/" #define LIBREFM_AUTH_URL "https://libre.fm/api/auth/" -#define LISTENBRAINZ_AUTH_URL "https://listenbrainz.org/api/auth/" #endif // DEFINES_H diff --git a/src/plugins/General/scrobbler/scrobblerhandler.cpp b/src/plugins/General/scrobbler/scrobblerhandler.cpp index 2ef15f668..35619c09d 100644 --- a/src/plugins/General/scrobbler/scrobblerhandler.cpp +++ b/src/plugins/General/scrobbler/scrobblerhandler.cpp @@ -31,8 +31,6 @@ ScrobblerHandler::ScrobblerHandler(QObject *parent) : QObject(parent) new Scrobbler(SCROBBLER_LASTFM_URL, "lastfm", this); if(settings.value("use_librefm", false).toBool()) new Scrobbler(SCROBBLER_LIBREFM_URL, "librefm", this); - if(settings.value("use_listenbrainz", false).toBool()) - new Scrobbler(SCROBBLER_LISTENBRAINZ_URL, "listenbrainz", this); settings.endGroup(); } diff --git a/src/plugins/General/scrobbler/settingsdialog.cpp b/src/plugins/General/scrobbler/settingsdialog.cpp index 060b7099d..8896c8f8c 100644 --- a/src/plugins/General/scrobbler/settingsdialog.cpp +++ b/src/plugins/General/scrobbler/settingsdialog.cpp @@ -30,25 +30,19 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) m_ui.setupUi(this); m_lastfmAuth = new ScrobblerAuth(SCROBBLER_LASTFM_URL, LASTFM_AUTH_URL, "lastfm", this); m_librefmAuth = new ScrobblerAuth(SCROBBLER_LIBREFM_URL, LIBREFM_AUTH_URL, "librefm", this); - m_listenbrainzAuth = new ScrobblerAuth(SCROBBLER_LISTENBRAINZ_URL, LISTENBRAINZ_AUTH_URL, "listenbrainz", this); connect(m_lastfmAuth, SIGNAL(tokenRequestFinished(int)), SLOT(processTokenResponse(int))); connect(m_lastfmAuth, SIGNAL(sessionRequestFinished(int)), SLOT(processSessionResponse(int))); connect(m_lastfmAuth, SIGNAL(checkSessionFinished(int)), SLOT(processCheckResponse(int))); connect(m_librefmAuth, SIGNAL(tokenRequestFinished(int)), SLOT(processTokenResponse(int))); connect(m_librefmAuth, SIGNAL(sessionRequestFinished(int)), SLOT(processSessionResponse(int))); connect(m_librefmAuth, SIGNAL(checkSessionFinished(int)), SLOT(processCheckResponse(int))); - connect(m_listenbrainzAuth, SIGNAL(tokenRequestFinished(int)), SLOT(processTokenResponse(int))); - connect(m_listenbrainzAuth, SIGNAL(sessionRequestFinished(int)), SLOT(processSessionResponse(int))); - connect(m_listenbrainzAuth, SIGNAL(checkSessionFinished(int)), SLOT(processCheckResponse(int))); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Scrobbler"); m_ui.lastfmGroupBox->setChecked(settings.value("use_lastfm", false).toBool()); m_ui.librefmGroupBox->setChecked(settings.value("use_librefm", false).toBool()); - m_ui.listenbrainzGroupBox->setChecked(settings.value("use_listenbrainz", false).toBool()); m_ui.sessionLineEdit_lastfm->setText(settings.value("lastfm_session").toString()); m_ui.sessionLineEdit_librefm->setText(settings.value("librefm_session").toString()); - m_ui.sessionLineEdit_listenbrainz->setText(settings.value("listenbrainz_session").toString()); settings.endGroup(); } @@ -61,10 +55,8 @@ void SettingsDialog::accept() settings.beginGroup("Scrobbler"); settings.setValue("use_lastfm", m_ui.lastfmGroupBox->isChecked()); settings.setValue("use_librefm", m_ui.librefmGroupBox->isChecked()); - settings.setValue("use_listenbrainz", m_ui.listenbrainzGroupBox->isChecked()); settings.setValue("lastfm_session",m_ui.sessionLineEdit_lastfm->text()); settings.setValue("librefm_session",m_ui.sessionLineEdit_librefm->text()); - settings.setValue("listenbrainz_session",m_ui.sessionLineEdit_listenbrainz->text()); settings.endGroup(); QDialog::accept(); } @@ -81,20 +73,13 @@ void SettingsDialog::on_newSessionButton_librefm_clicked() m_librefmAuth->getToken(); } -void SettingsDialog::on_newSessionButton_listenbrainz_clicked() -{ - m_ui.newSessionButton_listenbrainz->setEnabled(false); - m_listenbrainzAuth->getToken(); -} - void SettingsDialog::processTokenResponse(int error) { if(sender() == m_lastfmAuth) m_ui.newSessionButton_lastfm->setEnabled(true); else if(sender() == m_librefmAuth) m_ui.newSessionButton_librefm->setEnabled(true); - else if(sender() == m_listenbrainzAuth) - m_ui.newSessionButton_listenbrainz->setEnabled(true); + switch(error) { case ScrobblerAuth::NO_ERROR: @@ -112,11 +97,6 @@ void SettingsDialog::processTokenResponse(int error) m_ui.newSessionButton_librefm->setEnabled(false); name = QLatin1String("Libre.fm"); } - else if(auth == m_listenbrainzAuth) - { - m_ui.newSessionButton_listenbrainz->setEnabled(false); - name = QLatin1String("ListenBrainz"); - } else { qWarning("SettingsDialog: invalid sender"); @@ -161,11 +141,6 @@ void SettingsDialog::processSessionResponse(int error) m_ui.sessionLineEdit_librefm->setText(m_librefmAuth->session()); settings.setValue("Scrobbler/librefm_session",m_ui.sessionLineEdit_librefm->text()); } - else if(sender() == m_listenbrainzAuth) - { - m_ui.sessionLineEdit_listenbrainz->setText(m_listenbrainzAuth->session()); - settings.setValue("Scrobbler/listenbrainz_session",m_ui.sessionLineEdit_listenbrainz->text()); - } break; } case ScrobblerAuth::NETWORK_ERROR: @@ -195,15 +170,6 @@ void SettingsDialog::on_checkButton_librefm_clicked() } } -void SettingsDialog::on_checkButton_listenbrainz_clicked() -{ - if(!m_ui.sessionLineEdit_listenbrainz->text().isEmpty()) - { - m_ui.checkButton_listenbrainz->setEnabled(false); - m_listenbrainzAuth->checkSession(m_ui.sessionLineEdit_listenbrainz->text()); - } -} - void SettingsDialog::processCheckResponse(int error) { if(sender() == m_lastfmAuth) @@ -219,8 +185,6 @@ void SettingsDialog::processCheckResponse(int error) m_ui.sessionLineEdit_lastfm->setText(m_lastfmAuth->session()); else if(sender() == m_librefmAuth) m_ui.sessionLineEdit_librefm->setText(m_librefmAuth->session()); - else if(sender() == m_listenbrainzAuth) - m_ui.sessionLineEdit_listenbrainz->setText(m_listenbrainzAuth->session()); break; } case ScrobblerAuth::NETWORK_ERROR: diff --git a/src/plugins/General/scrobbler/settingsdialog.h b/src/plugins/General/scrobbler/settingsdialog.h index a198b5fc7..7e381c6b7 100644 --- a/src/plugins/General/scrobbler/settingsdialog.h +++ b/src/plugins/General/scrobbler/settingsdialog.h @@ -42,20 +42,16 @@ public slots: private slots: void on_newSessionButton_lastfm_clicked(); void on_newSessionButton_librefm_clicked(); - void on_newSessionButton_listenbrainz_clicked(); void processTokenResponse(int error); void processSessionResponse(int error); void on_checkButton_lastfm_clicked(); void on_checkButton_librefm_clicked(); - void on_checkButton_listenbrainz_clicked(); void processCheckResponse(int error); private: Ui::SettingsDialog m_ui; ScrobblerAuth *m_lastfmAuth; ScrobblerAuth *m_librefmAuth; - ScrobblerAuth *m_listenbrainzAuth; - }; #endif diff --git a/src/plugins/General/scrobbler/settingsdialog.ui b/src/plugins/General/scrobbler/settingsdialog.ui index 3d3ab4f2f..05e52c9ca 100644 --- a/src/plugins/General/scrobbler/settingsdialog.ui +++ b/src/plugins/General/scrobbler/settingsdialog.ui @@ -7,7 +7,7 @@ 0 0 376 - 362 + 253 @@ -123,62 +123,6 @@ - - - - ListenBrainz - - - true - - - - - - Qt::Horizontal - - - - 189 - 20 - - - - - - - - Register new session - - - - - - - - - Session: - - - - - - - - - - false - - - Check - - - - - - - - -- cgit v1.2.3-13-gbd6f