Kaj Wallin - kaj.wallin@ixonos.com
Henri Lampela - henri.lampela@ixonos.com
+ Jussi Laitinen jussi.laitinen@ixonos.com
Situare is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
{
qDebug() << __PRETTY_FUNCTION__;
+ m_ui->toggleProgressIndicator(true);
+
QPointF coordinates(65.0109, 25.5092); // this will be get from somewhere, map etc...
m_situareService->updateLocation(coordinates, status, publish);
}
m_situareService->fetchLocations();
}
-void SituareEngine::userDataReceived(User *user,QList<User*> &friends)
+void SituareEngine::userDataReceived(User *,QList<User*> &)
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
- m_situareService->fetchLocations();
+ refreshUserData();
}
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Jussi Laitinen - jussi.laitinen@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include <QtTest>
+#include <QtGui>
+
+#include "../../../src/ui/friendlistitem.h"
+#include "../../../src/ui/friendlistview.h"
+#include "../../../src/user/user.h"
+
+
+class TestFriendList: public QObject
+{
+ Q_OBJECT
+private slots:
+ /**
+ * @brief Add widgets to the view.
+ */
+ void friendListViewAddWidget();
+
+
+ /**
+ * @brief Clear widgets from the view.
+ */
+ void friendListViewClear();
+};
+
+void TestFriendList::friendListViewAddWidget()
+{
+ FriendListView *view = new FriendListView();
+
+ User *user1 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
+ QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
+ QString("UserID"), QString("Units"), 44.12);
+ User *user2 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
+ QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
+ QString("UserID"), QString("Units"), 44.12);
+
+ FriendListItem *item1 = new FriendListItem(view);
+ item1->setData(*user1);
+ FriendListItem *item2 = new FriendListItem(view);
+ item2->setData(*user2);
+
+ view->addWidget(item1);
+ view->addWidget(item2);
+
+ QCOMPARE(view->layout()->count(), 2);
+
+ User *user3 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
+ QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
+ QString("UserID"), QString("Units"), 44.12);
+
+ FriendListItem *item3 = new FriendListItem(view);
+ item3->setData(*user3);
+ view->addWidget(item3);
+
+ QCOMPARE(view->layout()->count(), 3);
+
+ view->addWidget(item3);
+
+ QCOMPARE(view->layout()->count(), 3);
+}
+
+void TestFriendList::friendListViewClear()
+{
+ FriendListView *view = new FriendListView();
+
+ User *user1 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
+ QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
+ QString("UserID"), QString("Units"), 44.12);
+ User *user2 = new User(QString("Address"), QPointF(12.22, 23.33), QString("Name"),
+ QString("Note"), QUrl("http://image.url"), QString("Timestamp"), true,
+ QString("UserID"), QString("Units"), 44.12);
+
+ FriendListItem *item1 = new FriendListItem(view);
+ item1->setData(*user1);
+ FriendListItem *item2 = new FriendListItem(view);
+ item2->setData(*user2);
+
+ view->addWidget(item1);
+ view->addWidget(item2);
+
+ QCOMPARE(view->layout()->count(), 2);
+
+ view->clear();
+
+ QCOMPARE(view->layout()->count(), 0);
+}
+
+
+QTEST_MAIN(TestFriendList)
+#include "testfriendlist.moc"