[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:07:19 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=4e6c266
The following commit has been merged in the master branch:
commit 4e6c266cf9768324cb1896c4f78f39f284a07df1
Author: George Goldberg <george.goldberg at collabora.co.uk>
Date: Sun Apr 3 18:50:08 2011 +0100
Modify the telepathy ontology to use maxCardinality=1 in a similar way to upstream NCO. Also fix the nepomuk service and tests to take this into account.
---
kpeople/nepomuk-feeder/nepomuk-storage.cpp | 12 +++----
kpeople/nepomuk-feeder/telepathy.trig | 6 ++--
kpeople/nepomuk-feeder/tests/storage-test.cpp | 51 ++++++++++-----------------
3 files changed, 26 insertions(+), 43 deletions(-)
diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.cpp b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
index 6ac4fc1..7d15449 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -261,12 +261,8 @@ void NepomukStorage::createAccount(const QString &path, const QString &id, const
// See if the Account has the same Telepathy Account Identifier as the account this
// TelepathyAccount instance has been created to look after.
- QStringList accountIdentifiers = foundImAccount.accountIdentifiers();
-
- if (accountIdentifiers.size() != 1) {
- kDebug() << "Account does not have 1 Telepathy Account Identifier. Oops. Ignoring."
- << "Number of Identifiers: "
- << accountIdentifiers.size();
+ if (foundImAccount.accountIdentifier().isEmpty()) {
+ kDebug() << "Account does not have a Telepathy Account Identifier. Oops. Ignoring.";
continue;
}
@@ -428,7 +424,7 @@ void NepomukStorage::createContact(const QString &path, const QString &id)
newImAccount.setImStatus("unknown");
newImAccount.setImIDs(QStringList() << id);
- newImAccount.setStatusTypes(QList<long long int>() << Tp::ConnectionPresenceTypeUnknown);
+ newImAccount.setStatusType(Tp::ConnectionPresenceTypeUnknown);
newImAccount.setImAccountType(account.imAccountType());
newImAccount.addIsAccessedBy(account);
@@ -499,7 +495,7 @@ void NepomukStorage::setContactPresence(const QString &path,
// Set the contact presence.
imAccount.setImStatus(presence.status);
- imAccount.setStatusTypes(QList<long long int>() << presence.type);
+ imAccount.setStatusType(presence.type);
imAccount.setImStatusMessage(presence.statusMessage);
}
diff --git a/kpeople/nepomuk-feeder/telepathy.trig b/kpeople/nepomuk-feeder/telepathy.trig
index 0f41421..d5a07d2 100644
--- a/kpeople/nepomuk-feeder/telepathy.trig
+++ b/kpeople/nepomuk-feeder/telepathy.trig
@@ -12,14 +12,16 @@ telepathy: {telepathy:accountIdentifier
rdfs:comment "Identifier of a Local Telepathy Account (as given by the Telepathy Account Manager).";
rdfs:domain nco:IMAccount ;
rdfs:label "accountIdentifier" ;
- rdfs:range xsd:string .
+ rdfs:range xsd:string ;
+ nrl:maxCardinality "1".
telepathy:statusType
a rdf:Property ;
rdfs:comment "The current presence type as defined by the Telepathy Spec. Invalid values (by the Telepathy spec) should be considered as 0, Unset.";
rdfs:domain nco:IMAccount ;
rdfs:label "statusType" ;
- rdfs:range xsd:integer .
+ rdfs:range xsd:integer ;
+ nrl:maxCardinality "1" .
diff --git a/kpeople/nepomuk-feeder/tests/storage-test.cpp b/kpeople/nepomuk-feeder/tests/storage-test.cpp
index 9078d15..2ff9428 100644
--- a/kpeople/nepomuk-feeder/tests/storage-test.cpp
+++ b/kpeople/nepomuk-feeder/tests/storage-test.cpp
@@ -123,8 +123,7 @@ void StorageTest::testCreateAccount()
QVERIFY(imAcc1.exists());
QCOMPARE(imAcc1.imIDs().size(), 1);
QCOMPARE(imAcc1.imIDs().first(), QLatin1String("foo at bar.baz"));
- QCOMPARE(imAcc1.accountIdentifiers().size(), 1);
- QCOMPARE(imAcc1.accountIdentifiers().first(), QLatin1String("/foo/bar/baz"));
+ QCOMPARE(imAcc1.accountIdentifier(), QLatin1String("/foo/bar/baz"));
QCOMPARE(imAcc1.imAccountType(), QLatin1String("test"));
// Check that it is correctly related to the mePersonContact.
@@ -133,7 +132,7 @@ void StorageTest::testCreateAccount()
// Test creating an account which *is* already in Nepomuk.
// Add the account to Nepomuk.
Nepomuk::IMAccount imAcc2;
- imAcc2.setAccountIdentifiers(QStringList() << QLatin1String("/foo/bar/baz/bong"));
+ imAcc2.setAccountIdentifier(QLatin1String("/foo/bar/baz/bong"));
imAcc2.setImIDs(QStringList() << QLatin1String("foo.bar at baz.bong"));
imAcc2.setImAccountType(QLatin1String("test"));
QVERIFY(imAcc2.exists());
@@ -153,8 +152,7 @@ void StorageTest::testCreateAccount()
QVERIFY(imAcc3.exists());
QCOMPARE(imAcc3.imIDs().size(), 1);
QCOMPARE(imAcc3.imIDs().first(), QLatin1String("foo.bar at baz.bong"));
- QCOMPARE(imAcc3.accountIdentifiers().size(), 1);
- QCOMPARE(imAcc3.accountIdentifiers().first(), QLatin1String("/foo/bar/baz/bong"));
+ QCOMPARE(imAcc3.accountIdentifier(), QLatin1String("/foo/bar/baz/bong"));
QCOMPARE(imAcc3.imAccountType(), QLatin1String("test"));
QCOMPARE(imAcc2, imAcc3);
@@ -175,8 +173,7 @@ void StorageTest::testCreateAccount()
QVERIFY(imAcc4.exists());
QCOMPARE(imAcc4.imIDs().size(), 1);
QCOMPARE(imAcc4.imIDs().first(), QLatin1String("foo at bar.baz"));
- QCOMPARE(imAcc4.accountIdentifiers().size(), 1);
- QCOMPARE(imAcc4.accountIdentifiers().first(), QLatin1String("/foo/bar/baz"));
+ QCOMPARE(imAcc4.accountIdentifier(), QLatin1String("/foo/bar/baz"));
QCOMPARE(imAcc4.imAccountType(), QLatin1String("test"));
QCOMPARE(imAcc4, imAcc1);
@@ -230,8 +227,7 @@ void StorageTest::testDestroyAccount()
// However, its presence changes.
QCOMPARE(imAcc1.imStatus(), QLatin1String("unknown"));
- QCOMPARE(imAcc1.statusTypes().size(), 1);
- QCOMPARE(imAcc1.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeUnknown);
+ QCOMPARE(imAcc1.statusType(), (qint64)Tp::ConnectionPresenceTypeUnknown);
// Cleanup the nepomuk resources created in this test case.
imAcc1.remove();
@@ -305,7 +301,7 @@ void StorageTest::testSetAccountCurrentPresence()
// Check the presence properties before we set them.
QVERIFY(imAcc1.imStatus().isEmpty());
QVERIFY(imAcc1.imStatusMessage().isEmpty());
- QCOMPARE(imAcc1.statusTypes().size(), 0);
+ QCOMPARE(imAcc1.statusType(), Q_INT64_C(0));
// Set the presence.
Tp::SimplePresence p1;
@@ -317,8 +313,7 @@ void StorageTest::testSetAccountCurrentPresence()
// Check the nepomuk resources are correct.
QCOMPARE(imAcc1.imStatus(), QLatin1String("away"));
QCOMPARE(imAcc1.imStatusMessage(), QLatin1String("Hello"));
- QCOMPARE(imAcc1.statusTypes().size(), 1);
- QCOMPARE(imAcc1.statusTypes().first(), Q_INT64_C(4));
+ QCOMPARE(imAcc1.statusType(), Q_INT64_C(4));
// Set the presence.
Tp::SimplePresence p2;
@@ -330,8 +325,7 @@ void StorageTest::testSetAccountCurrentPresence()
// Check the nepomuk resources are correct.
QCOMPARE(imAcc1.imStatus(), QLatin1String("available"));
QCOMPARE(imAcc1.imStatusMessage(), QLatin1String("Bye"));
- QCOMPARE(imAcc1.statusTypes().size(), 1);
- QCOMPARE(imAcc1.statusTypes().first(), Q_INT64_C(1));
+ QCOMPARE(imAcc1.statusType(), Q_INT64_C(1));
// Cleanup the Nepomuk Resources used in this test
imAcc1.remove();
@@ -384,8 +378,7 @@ void StorageTest::testCreateContact()
QCOMPARE(imAcc2.imStatus(), QLatin1String("unknown"));
QCOMPARE(imAcc2.imIDs().size(), 1);
QCOMPARE(imAcc2.imIDs().first(), QLatin1String("test at remote-contact.com"));
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeUnknown);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeUnknown);
QCOMPARE(imAcc2.imAccountType(), QLatin1String("test"));
QCOMPARE(imAcc1.isAccessedByOf().size(), 1);
QCOMPARE(imAcc2.isAccessedBys().size(), 1);
@@ -409,7 +402,7 @@ void StorageTest::testCreateContact()
Nepomuk::PersonContact pC3;
imAcc3.setImStatus("away");
imAcc3.setImIDs(QStringList() << "test2 at remote-contact.com");
- imAcc3.setStatusTypes(QList<qint64>() << Tp::ConnectionPresenceTypeAway);
+ imAcc3.setStatusType(Tp::ConnectionPresenceTypeAway);
imAcc3.setImAccountType(QLatin1String("test"));
imAcc3.addIsAccessedBy(imAcc1);
pC3.addIMAccount(imAcc3);
@@ -420,8 +413,7 @@ void StorageTest::testCreateContact()
QCOMPARE(imAcc3.imStatus(), QLatin1String("away"));
QCOMPARE(imAcc3.imIDs().size(), 1);
QCOMPARE(imAcc3.imIDs().first(), QLatin1String("test2 at remote-contact.com"));
- QCOMPARE(imAcc3.statusTypes().size(), 1);
- QCOMPARE(imAcc3.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeAway);
+ QCOMPARE(imAcc3.statusType(), (qint64)Tp::ConnectionPresenceTypeAway);
QCOMPARE(imAcc3.imAccountType(), QLatin1String("test"));
QCOMPARE(imAcc1.isAccessedByOf().size(), 2);
QCOMPARE(imAcc3.isAccessedBys().size(), 1);
@@ -452,8 +444,7 @@ void StorageTest::testCreateContact()
QCOMPARE(imAcc3.imStatus(), QLatin1String("away"));
QCOMPARE(imAcc3.imIDs().size(), 1);
QCOMPARE(imAcc3.imIDs().first(), QLatin1String("test2 at remote-contact.com"));
- QCOMPARE(imAcc3.statusTypes().size(), 1);
- QCOMPARE(imAcc3.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeAway);
+ QCOMPARE(imAcc3.statusType(), (qint64)Tp::ConnectionPresenceTypeAway);
QCOMPARE(imAcc3.imAccountType(), QLatin1String("test"));
QCOMPARE(imAcc1.isAccessedByOf().size(), 2);
QCOMPARE(imAcc3.isAccessedBys().size(), 1);
@@ -484,8 +475,7 @@ void StorageTest::testCreateContact()
QCOMPARE(imAcc2.imStatus(), QLatin1String("unknown"));
QCOMPARE(imAcc2.imIDs().size(), 1);
QCOMPARE(imAcc2.imIDs().first(), QLatin1String("test at remote-contact.com"));
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeUnknown);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeUnknown);
QCOMPARE(imAcc2.imAccountType(), QLatin1String("test"));
QCOMPARE(imAcc1.isAccessedByOf().size(), 2);
QCOMPARE(imAcc2.isAccessedBys().size(), 1);
@@ -562,8 +552,7 @@ void StorageTest::testDestroyContact()
// It's presence should be unknown now
QCOMPARE(imAcc2.imStatus(), QLatin1String("unknown"));
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeUnknown);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeUnknown);
// Cleanup Nepomuk Resources used in this test
imAcc1.remove();
@@ -685,8 +674,7 @@ void StorageTest::testSetContactPresence()
// Check the Presence is default.
QCOMPARE(imAcc2.imStatus(), QLatin1String("unknown"));
QVERIFY(imAcc2.imStatusMessage().isEmpty());
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeUnknown);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeUnknown);
// Set the presence of the contact.
Tp::SimplePresence p1;
@@ -700,8 +688,7 @@ void StorageTest::testSetContactPresence()
// Check the presence now.
QCOMPARE(imAcc2.imStatus(), QLatin1String("available"));
QCOMPARE(imAcc2.imStatusMessage(), QLatin1String("foo"));
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeAvailable);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeAvailable);
// Change the presence of the contact.
Tp::SimplePresence p2;
@@ -715,8 +702,7 @@ void StorageTest::testSetContactPresence()
// Check the presence now.
QCOMPARE(imAcc2.imStatus(), QLatin1String("away"));
QCOMPARE(imAcc2.imStatusMessage(), QLatin1String("bar"));
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeAway);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeAway);
// Change the presence to one without a message
Tp::SimplePresence p3;
@@ -729,8 +715,7 @@ void StorageTest::testSetContactPresence()
// Check the presence now.
QCOMPARE(imAcc2.imStatus(), QLatin1String("offline"));
QVERIFY(imAcc2.imStatusMessage().isEmpty());
- QCOMPARE(imAcc2.statusTypes().size(), 1);
- QCOMPARE(imAcc2.statusTypes().first(), (qint64)Tp::ConnectionPresenceTypeOffline);
+ QCOMPARE(imAcc2.statusType(), (qint64)Tp::ConnectionPresenceTypeOffline);
// Cleanup the Nepomuk resources used in this test.
imAcc1.remove();
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list