--- a/upqo/ohplaylist_qo.h
+++ b/upqo/ohplaylist_qo.h
@@ -41,9 +41,7 @@
public:
OHPlaylistQO(UPnPClient::OHPLH ohp, QObject *parent = 0)
- : QObject(parent), m_curid(-1), m_forceUpdate(false),
- m_discardArrayEvents(false),
- m_srv(ohp), m_timer(0), m_errcnt(0)
+ : QObject(parent), m_srv(ohp)
{
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()), this, SLOT(testconn()));
@@ -134,9 +132,11 @@
// Ping renderer to check it's still there.
virtual void testconn() {
- int val;
- if (m_srv->id(&val) != 0) {
+ int val, code;
+ if ((code = m_srv->id(&val)) != 0) {
+ //qDebug() << "testconn: id command failed with code " << code;
if (m_errcnt++ > 2) {
+ // Tried 3 times, 6 S
emit connectionLost();
}
return;
@@ -256,19 +256,19 @@
protected:
std::vector<int> m_idsv;
std::unordered_map<int, UPnPClient::UPnPDirObject> m_metapool;
- int m_curid;
+ int m_curid{-1};
UPnPClient::OHPlaylist::TPState m_curtpstate{
UPnPClient::OHPlaylist::TPS_Unknown};
- bool m_forceUpdate;
- bool m_discardArrayEvents;
+ bool m_forceUpdate{false};
+ bool m_discardArrayEvents{false};
private:
virtual bool idArray(std::vector<int> *ids, int *tokp) {
return m_srv->idArray(ids, tokp) == 0;
}
UPnPClient::OHPLH m_srv;
- QTimer *m_timer;
- int m_errcnt;
+ QTimer *m_timer{nullptr};
+ int m_errcnt{0};
};
#endif // _OHPLAYLIST_QO_INCLUDED