QTfrontend/model/playerslistmodel.cpp
changeset 8891 bf67b4d7d7b4
parent 7842 d1c0e4341165
child 9503 8f9b04138456
--- a/QTfrontend/model/playerslistmodel.cpp	Sun Apr 07 19:43:18 2013 -0400
+++ b/QTfrontend/model/playerslistmodel.cpp	Mon Apr 08 23:34:12 2013 +0400
@@ -84,7 +84,7 @@
 }
 
 
-void PlayersListModel::addPlayer(const QString & nickname)
+void PlayersListModel::addPlayer(const QString & nickname, bool notify)
 {
     insertRow(rowCount());
 
@@ -92,11 +92,18 @@
     setData(mi, nickname);
 
     checkFriendIgnore(mi);
+
+    emit nickAddedLobby(nickname, notify);
 }
 
 
-void PlayersListModel::removePlayer(const QString & nickname)
+void PlayersListModel::removePlayer(const QString & nickname, const QString &msg)
 {
+    if(msg.isEmpty())
+        emit nickRemovedLobby(nickname);
+    else
+        emit nickRemovedLobby(nickname, msg);
+
     QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
 
     if(mil.size())
@@ -104,7 +111,7 @@
 }
 
 
-void PlayersListModel::playerJoinedRoom(const QString & nickname)
+void PlayersListModel::playerJoinedRoom(const QString & nickname, bool notify)
 {
     QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
 
@@ -114,11 +121,15 @@
         updateIcon(mil[0]);
         updateSortData(mil[0]);
     }
+
+    emit nickAdded(nickname, notify);
 }
 
 
 void PlayersListModel::playerLeftRoom(const QString & nickname)
 {
+    emit nickRemoved(nickname);
+
     QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
 
     if(mil.size())