aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2015-08-17 10:48:25 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2015-08-17 10:48:25 +0200
commit2ecdd17e4e273d4385113b6742a86e98153413e2 (patch)
treeb8836f592a310410d59ba06d3687c4b3b5e9878c
parent496d7e9c1a763124ec99039c150a96ceac595b6b (diff)
downloadqxmpp-2ecdd17e4e273d4385113b6742a86e98153413e2.tar.gz
QXmppJingleCandidate : add accessors for "generation"
-rw-r--r--src/base/QXmppJingleIq.cpp16
-rw-r--r--src/base/QXmppJingleIq.h3
-rw-r--r--tests/qxmppjingleiq/tst_qxmppjingleiq.cpp1
3 files changed, 20 insertions, 0 deletions
diff --git a/src/base/QXmppJingleIq.cpp b/src/base/QXmppJingleIq.cpp
index ee6ccc23..99388f9e 100644
--- a/src/base/QXmppJingleIq.cpp
+++ b/src/base/QXmppJingleIq.cpp
@@ -471,6 +471,22 @@ void QXmppJingleCandidate::setFoundation(const QString &foundation)
m_foundation = foundation;
}
+/// Returns the candidate's generation.
+
+int QXmppJingleCandidate::generation() const
+{
+ return m_generation;
+}
+
+/// Sets the candidate's generation.
+///
+/// \param generation
+
+void QXmppJingleCandidate::setGeneration(int generation)
+{
+ m_generation = generation;
+}
+
/// Returns the candidate's host address.
///
diff --git a/src/base/QXmppJingleIq.h b/src/base/QXmppJingleIq.h
index 7dc68d32..c3d59307 100644
--- a/src/base/QXmppJingleIq.h
+++ b/src/base/QXmppJingleIq.h
@@ -102,6 +102,9 @@ public:
QString foundation() const;
void setFoundation(const QString &foundation);
+ int generation() const;
+ void setGeneration(int generation);
+
QHostAddress host() const;
void setHost(const QHostAddress &host);
diff --git a/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp b/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp
index c6f6ec6c..bd856a9d 100644
--- a/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp
+++ b/tests/qxmppjingleiq/tst_qxmppjingleiq.cpp
@@ -55,6 +55,7 @@ void tst_QXmppJingleIq::testCandidate()
QXmppJingleCandidate candidate;
parsePacket(candidate, xml);
QCOMPARE(candidate.foundation(), QLatin1String("1"));
+ QCOMPARE(candidate.generation(), 0);
QCOMPARE(candidate.id(), QLatin1String("el0747fg11"));
QCOMPARE(candidate.host(), QHostAddress("10.0.1.1"));
QCOMPARE(candidate.network(), 1);