communi/communi — Issue #3: User lists in messageview
Author: heriniaina
Created: 2011-12-20 10:25:33+00:00
State: open

Hello,

I'm trying to implement messageview to show a userlist in the right side (like pidgin does).

1. I added a listview in messageview.ui (listUserList) and set its visible state to false when messageview loads.

2. Then to make it visible on chanel only, i modified the addUser method

```c++
void MessageView::addUser(const QString& user)
{
d.listUserList->setVisible(true);

// TODO: this is far from optimal
QStringList users = d.userModel->stringList();

users.append(user);

qSort(users.begin(), users.end(), nameLessThan );
d.listUserList->setModel(d.userModel);

d.userModel->setStringList(users);

}
```

Like this I get the list of users in the listUserList QListView but it doesn't respect the order because the appended user doesn't have "@" or "+" etc..., it is just sorted alphabetically.

Can you help me how to get the user list in the right order?

Later on I should be able to connect the userlist item (doubleClicked) to open a new query tab.

Thank you