Request list of URL handlers immediately after connecting.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
disconnected, only reconnect that one. If a reconnect fails, then
|
||||
disconnect both. If we receive an empty reply to a command and socket has
|
||||
been closed - then attempt to reconnect and resend command.
|
||||
13. Request list of URL handlers immediately after connecting.
|
||||
|
||||
0.6.1
|
||||
-----
|
||||
|
||||
@@ -51,9 +51,7 @@ ServerInfoPage::ServerInfoPage(MainWindow *p)
|
||||
connect(updateAction, SIGNAL(triggered(bool)), MPDConnection::self(), SLOT(getStats()));
|
||||
connect(MPDConnection::self(), SIGNAL(statsUpdated(const MPDStats &)), SLOT(statsUpdated(const MPDStats &)));
|
||||
connect(MPDConnection::self(), SIGNAL(version(long)), SLOT(mpdVersion(long)));
|
||||
connect(MPDConnection::self(), SIGNAL(version(long)), SIGNAL(getUrlHandlers()));
|
||||
connect(MPDConnection::self(), SIGNAL(urlHandlers(const QStringList &)), SLOT(urlHandlers(const QStringList &)));
|
||||
connect(this, SIGNAL(getUrlHandlers()), MPDConnection::self(), SLOT(getUrlHandlers()));
|
||||
|
||||
MainWindow::initButton(updateInfo);
|
||||
clear();
|
||||
@@ -90,8 +88,6 @@ void ServerInfoPage::statsUpdated(const MPDStats &stats)
|
||||
// #else
|
||||
lastUpdate->setText(stats.dbUpdate.toString(Qt::SystemLocaleShortDate));
|
||||
// #endif
|
||||
|
||||
emit getUrlHandlers();
|
||||
}
|
||||
|
||||
void ServerInfoPage::mpdVersion(long v)
|
||||
|
||||
@@ -44,10 +44,6 @@ public:
|
||||
return dbUpdate;
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
// These are for communicating with MPD object (which is in its own thread, so need to talk via signal/slots)
|
||||
void getUrlHandlers();
|
||||
|
||||
private Q_SLOTS:
|
||||
void statsUpdated(const MPDStats &stats);
|
||||
void mpdVersion(long v);
|
||||
|
||||
@@ -151,7 +151,6 @@ StreamFetcher::StreamFetcher(QObject *p)
|
||||
, job(0)
|
||||
{
|
||||
handlers.append("http");
|
||||
connect(this, SIGNAL(getUrlHandlers()), MPDConnection::self(), SLOT(getUrlHandlers()));
|
||||
connect(MPDConnection::self(), SIGNAL(urlHandlers(const QStringList &)), SLOT(urlHandlers(const QStringList &)));
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,6 @@ public Q_SLOTS:
|
||||
void urlHandlers(const QStringList &uh);
|
||||
|
||||
Q_SIGNALS:
|
||||
// These are for communicating with MPD object (which is in its own thread, so need to talk via signal/slots)
|
||||
void getUrlHandlers();
|
||||
|
||||
void result(const QStringList &items, int insertRow, bool replace);
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -36,11 +36,8 @@
|
||||
#include <QtCore/QStringList>
|
||||
#include "debugtimer.h"
|
||||
|
||||
// #undef qDebug
|
||||
// #define qDebug qWarning
|
||||
|
||||
// #define DBUG qWarning() << "MPDConnection" << QThread::currentThreadId()
|
||||
#define DBUG qDebug()
|
||||
#define DBUG qWarning() << "MPDConnection" << QThread::currentThreadId()
|
||||
// #define DBUG qDebug()
|
||||
|
||||
#ifdef ENABLE_KDE_SUPPORT
|
||||
K_GLOBAL_STATIC(MPDConnection, conn)
|
||||
@@ -299,6 +296,7 @@ void MPDConnection::setDetails(const QString &host, quint16 p, const QString &pa
|
||||
password=pass;
|
||||
DBUG << "call connectToMPD";
|
||||
if (connectToMPD()) {
|
||||
getUrlHandlers();
|
||||
if (!wasConnected) {
|
||||
emit stateChanged(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user