From 800dddc394c98ed01e5bbfe4cef05ad703a42e81 Mon Sep 17 00:00:00 2001 From: craig Date: Tue, 17 Apr 2012 15:51:40 +0000 Subject: [PATCH] Request list of URL handlers immediately after connecting. --- ChangeLog | 1 + gui/serverinfopage.cpp | 4 ---- gui/serverinfopage.h | 4 ---- models/streamfetcher.cpp | 1 - models/streamfetcher.h | 3 --- mpd/mpdconnection.cpp | 8 +++----- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index d523ed11b..be087d224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 ----- diff --git a/gui/serverinfopage.cpp b/gui/serverinfopage.cpp index e1fa2cae3..9025abd1e 100644 --- a/gui/serverinfopage.cpp +++ b/gui/serverinfopage.cpp @@ -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) diff --git a/gui/serverinfopage.h b/gui/serverinfopage.h index 30922272d..498a69291 100644 --- a/gui/serverinfopage.h +++ b/gui/serverinfopage.h @@ -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); diff --git a/models/streamfetcher.cpp b/models/streamfetcher.cpp index 70e180434..97745bee8 100644 --- a/models/streamfetcher.cpp +++ b/models/streamfetcher.cpp @@ -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 &))); } diff --git a/models/streamfetcher.h b/models/streamfetcher.h index 0675b310b..b5af9a458 100644 --- a/models/streamfetcher.h +++ b/models/streamfetcher.h @@ -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: diff --git a/mpd/mpdconnection.cpp b/mpd/mpdconnection.cpp index 15f04b126..f4b716ee1 100644 --- a/mpd/mpdconnection.cpp +++ b/mpd/mpdconnection.cpp @@ -36,11 +36,8 @@ #include #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); }