From 4622c2ecf0085b0d322a5ad80324d13cc153f7e4 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Tue, 10 Feb 2015 14:41:49 +0100
Subject: =?UTF-8?q?Fix=20missing=20removable=20icon=20in=20contact=20listi?=
 =?UTF-8?q?ng=20of=20"Start=20Chat=E2=80=A6"=20dialog?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

QtRemovableItemDelegate only renders the icon if the data for the
cell is empty. This is to enable persistent entries. With this commit
the model only returns the expected data for the first column.

Test-Information:

Tested on OS X 10.9.5 with Qt 5.4.0.

Change-Id: I5cacebcc47323280b689badf2ba90b3503c17061

diff --git a/Swift/QtUI/UserSearch/ContactListModel.cpp b/Swift/QtUI/UserSearch/ContactListModel.cpp
index 936f048..db13fbc 100644
--- a/Swift/QtUI/UserSearch/ContactListModel.cpp
+++ b/Swift/QtUI/UserSearch/ContactListModel.cpp
@@ -81,7 +81,7 @@ int ContactListModel::columnCount(const QModelIndex&) const {
 }
 
 QVariant ContactListModel::data(const QModelIndex& index, int role) const {
-	if (boost::numeric_cast<size_t>(index.row()) < contacts_.size()) {
+	if ((boost::numeric_cast<size_t>(index.row()) < contacts_.size()) && (index.column() == 0)) {
 		const Contact::ref& contact = contacts_[index.row()];
 		if (role == Qt::EditRole) {
 			return P2QSTRING(contact->jid.toString());
-- 
cgit v0.10.2-6-g49f6