From 51f4923d975af65b9f2f29b179f1e7768e8368d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Sat, 9 Jul 2011 20:19:35 +0200
Subject: Add avatar path to table roster.


diff --git a/Swift/Controllers/Roster/TableRoster.cpp b/Swift/Controllers/Roster/TableRoster.cpp
index 54f2484..171e8ed 100644
--- a/Swift/Controllers/Roster/TableRoster.cpp
+++ b/Swift/Controllers/Roster/TableRoster.cpp
@@ -90,7 +90,7 @@ size_t TableRoster::getNumberOfRowsInSection(size_t section) const {
 	return sections[section].items.size();
 }
 
-TableRoster::Item TableRoster::getItem(const Index& index) const {
+const TableRoster::Item& TableRoster::getItem(const Index& index) const {
 	return sections[index.section].items[index.row];
 }
 			
@@ -108,7 +108,7 @@ void TableRoster::handleUpdateTimerTick() {
 				foreach(RosterItem* groupChildItem, groupItem->getDisplayedChildren()) {
 					if (ContactRosterItem* contact = boost::polymorphic_downcast<ContactRosterItem*>(groupChildItem)) {
 						//std::cerr << "  - " << contact->getDisplayJID() << std::endl;
-						section.items.push_back(Item(contact->getDisplayName(), contact->getStatusText(), contact->getDisplayJID(), contact->getStatusShow()));
+						section.items.push_back(Item(contact->getDisplayName(), contact->getStatusText(), contact->getDisplayJID(), contact->getStatusShow(), contact->getAvatarPath()));
 					}
 				}
 				newSections.push_back(section);
diff --git a/Swift/Controllers/Roster/TableRoster.h b/Swift/Controllers/Roster/TableRoster.h
index a19d592..8ff16d0 100644
--- a/Swift/Controllers/Roster/TableRoster.h
+++ b/Swift/Controllers/Roster/TableRoster.h
@@ -21,12 +21,13 @@ namespace Swift {
 	class TableRoster {
 		public:
 			struct Item {
-				Item(const std::string& name, const std::string& description, const JID& jid, StatusShow::Type status) : name(name), description(description), jid(jid), status(status) {
+				Item(const std::string& name, const std::string& description, const JID& jid, StatusShow::Type status, const std::string& avatarPath) : name(name), description(description), jid(jid), status(status), avatarPath(avatarPath) {
 				}
 				std::string name;
 				std::string description;
 				JID jid;
 				StatusShow::Type status;
+				std::string avatarPath;
 			};
 
 			struct Index {
@@ -56,7 +57,7 @@ namespace Swift {
 
 			const std::string& getSectionTitle(size_t);
 
-			Item getItem(const Index&) const;
+			const Item& getItem(const Index&) const;
 
 			boost::signal<void (const Update&)> onUpdate;
 
-- 
cgit v0.10.2-6-g49f6