Skip to content

Commit

Permalink
Merge pull request gamenet#7 from n-gorbunov/master
Browse files Browse the repository at this point in the history
Added error code to QmlQXmppClient::error() signal
  • Loading branch information
misterion committed Jun 4, 2014
2 parents de23e40 + 3928060 commit 3c1dc74
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
9 changes: 9 additions & 0 deletions QmlClient/plugins/QXmpp/plugins.qmltypes
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ Module {
"Invisible": 5
}
}
Enum {
name: "Error"
values: {
"NoError": 0,
"SocketError": 1,
"KeepAliveError": 2,
"XmppStreamError": 3
}
}
Property {
name: "configuration"
type: "QmlQXmppConfiguration"
Expand Down
Binary file modified QmlClient/plugins/QXmpp/qxmpp-declarative.dll
Binary file not shown.
20 changes: 14 additions & 6 deletions qxmpp-declarative/include/QmlQXmppClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class QmlQXmppClient : public QObject
{
Q_OBJECT
Q_ENUMS(StatusType)
Q_ENUMS(Error)
Q_PROPERTY(QmlQXmppConfiguration *configuration READ configuration CONSTANT)
Q_PROPERTY(QmlQXmppArchiveManager* archiveManager READ archiveManager CONSTANT)
Q_PROPERTY(QmlQXmppRosterManager* rosterManager READ rosterManager CONSTANT)
Expand All @@ -49,14 +50,21 @@ class QmlQXmppClient : public QObject

public:
enum StatusType {
Online = QXmppPresence::Online,
Away,
XA,
DND,
Chat,
Online = QXmppPresence::Online,
Away,
XA,
DND,
Chat,
Invisible
};

enum Error {
NoError = QXmppClient::NoError, ///< No error.
SocketError, ///< Error due to TCP socket.
KeepAliveError, ///< Error due to no response to a keep alive.
XmppStreamError, ///< Error due to XML stream.
};

QmlQXmppClient(QObject *parent = 0);
~QmlQXmppClient();

Expand Down Expand Up @@ -99,7 +107,7 @@ class QmlQXmppClient : public QObject
/// It could be due to TCP socket or the xml stream or the stanza.
/// Depending upon the type of error occurred use the respective get function to
/// know the error.
void error(QXmppClient::Error);
void error(QXmppClient::Error code);

void messageReceived(QmlQXmppMessage* message);

Expand Down

0 comments on commit 3c1dc74

Please sign in to comment.