aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/General/scrobbler/defines.h2
-rw-r--r--src/plugins/General/scrobbler/scrobblerhandler.cpp2
-rw-r--r--src/plugins/General/scrobbler/settingsdialog.cpp38
-rw-r--r--src/plugins/General/scrobbler/settingsdialog.h4
-rw-r--r--src/plugins/General/scrobbler/settingsdialog.ui58
5 files changed, 2 insertions, 102 deletions
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 @@
<x>0</x>
<y>0</y>
<width>376</width>
- <height>362</height>
+ <height>253</height>
</rect>
</property>
<property name="windowTitle">
@@ -124,62 +124,6 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="listenbrainzGroupBox">
- <property name="title">
- <string>ListenBrainz</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="1" column="0">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>189</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="1">
- <widget class="QPushButton" name="newSessionButton_listenbrainz">
- <property name="text">
- <string>Register new session</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Session:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="sessionLineEdit_listenbrainz"/>
- </item>
- <item>
- <widget class="QPushButton" name="checkButton_listenbrainz">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Check</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>