From 5b4e1339866db3be97b00ee11cd19dfa0596efe1 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Tue, 20 Oct 2009 19:30:50 +0000 Subject: fix for Issue 18: Class XXX has virtual functions but non-virtual destructor -warnings and other warnings --- source/QXmppClient.cpp | 3 +-- source/QXmppConfiguration.cpp | 4 ++-- source/QXmppMessage.cpp | 2 +- source/QXmppPacket.h | 2 +- source/QXmppReconnectionManager.cpp | 4 +++- source/QXmppRoster.cpp | 2 ++ source/QXmppStream.cpp | 2 +- source/QXmppVCardManager.cpp | 2 +- 8 files changed, 12 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/QXmppClient.cpp b/source/QXmppClient.cpp index 5c6f892b..4618da55 100644 --- a/source/QXmppClient.cpp +++ b/source/QXmppClient.cpp @@ -191,8 +191,7 @@ void QXmppClient::disconnect() QXmppRoster& QXmppClient::getRoster() { - if(m_stream) - return m_stream->getRoster(); + return m_stream->getRoster(); } /// Utility function to send message to all the resources associated with the diff --git a/source/QXmppConfiguration.cpp b/source/QXmppConfiguration.cpp index 20336a93..4ac43607 100644 --- a/source/QXmppConfiguration.cpp +++ b/source/QXmppConfiguration.cpp @@ -24,11 +24,11 @@ #include "QXmppConfiguration.h" -QXmppConfiguration::QXmppConfiguration() : m_resource("QXmpp"), +QXmppConfiguration::QXmppConfiguration() : m_port(5222), + m_resource("QXmpp"), m_autoAcceptSubscriptions(true), m_sendIntialPresence(true), m_sendRosterRequest(true), - m_port(5222), m_keepAlivePingsInterval(100), m_autoReconnectionEnabled(true), m_useSASLAuthentication(true) { diff --git a/source/QXmppMessage.cpp b/source/QXmppMessage.cpp index 65d5bece..54836729 100644 --- a/source/QXmppMessage.cpp +++ b/source/QXmppMessage.cpp @@ -28,7 +28,7 @@ QXmppMessage::QXmppMessage(const QString& from, const QString& to, const QString& body, const QString& thread) - : QXmppStanza(from, to), m_type(Chat), m_thread(thread), m_body(body) + : QXmppStanza(from, to), m_type(Chat), m_body(body), m_thread(thread) { } diff --git a/source/QXmppPacket.h b/source/QXmppPacket.h index 95f698fb..c123899f 100644 --- a/source/QXmppPacket.h +++ b/source/QXmppPacket.h @@ -32,7 +32,7 @@ class QXmppPacket { public: QXmppPacket(); - ~QXmppPacket(); + virtual ~QXmppPacket(); QByteArray getXmlReceived() const; virtual void toXml( QXmlStreamWriter *writer ) const = 0; diff --git a/source/QXmppReconnectionManager.cpp b/source/QXmppReconnectionManager.cpp index 31183abc..32edf41c 100644 --- a/source/QXmppReconnectionManager.cpp +++ b/source/QXmppReconnectionManager.cpp @@ -27,8 +27,10 @@ #include "QXmppUtils.h" QXmppReconnectionManager::QXmppReconnectionManager(QXmppClient* client) : + QObject(client), + m_reconnectionTries(0), m_timer(this), - m_reconnectionTries(0), m_client(client), QObject(client) + m_client(client) { m_timer.setSingleShot(true); bool check = connect(&m_timer, SIGNAL(timeout()), SLOT(reconnect())); diff --git a/source/QXmppRoster.cpp b/source/QXmppRoster.cpp index 13f38925..eb5fc737 100644 --- a/source/QXmppRoster.cpp +++ b/source/QXmppRoster.cpp @@ -77,6 +77,8 @@ void QXmppRoster::rosterIqReceived(const QXmppRosterIq& rosterIq) } break; } + default: + break; } } diff --git a/source/QXmppStream.cpp b/source/QXmppStream.cpp index 65b4e843..cd5a52a9 100644 --- a/source/QXmppStream.cpp +++ b/source/QXmppStream.cpp @@ -49,7 +49,7 @@ static const QByteArray streamRootElementStart = "