summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2018-11-08 14:12:36 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2018-11-08 15:30:19 (GMT)
commit0b4e062a59613b2597b712c0106c3ed08b747637 (patch)
tree7b062a8123d37be7226d4eb36c553b04563255c6 /Swift/Controllers/UIInterfaces/ChatListWindow.h
parentcf3d517763a3d74a2ec9fd6f7bdee8cbaee3550f (diff)
downloadswift-0b4e062a59613b2597b712c0106c3ed08b747637.zip
swift-0b4e062a59613b2597b712c0106c3ed08b747637.tar.bz2
Change unread counters to size_t
Since the counters cannot be negative, changing the type used for unread counters to size_t seems a better fit, and it avoids the need for numeric_casts. Test-Information: Unit tests pass on macOS 10.13 Change-Id: I61badcfc410f0cce7f922da90b50ef5a809c6521
Diffstat (limited to 'Swift/Controllers/UIInterfaces/ChatListWindow.h')
-rw-r--r--Swift/Controllers/UIInterfaces/ChatListWindow.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swift/Controllers/UIInterfaces/ChatListWindow.h b/Swift/Controllers/UIInterfaces/ChatListWindow.h
index 29097e9..6aa729b 100644
--- a/Swift/Controllers/UIInterfaces/ChatListWindow.h
+++ b/Swift/Controllers/UIInterfaces/ChatListWindow.h
@@ -26,7 +26,7 @@ namespace Swift {
26 class Chat { 26 class Chat {
27 public: 27 public:
28 Chat() : statusType(StatusShow::None), isMUC(false), unreadCount(0), isPrivateMessage(false) {} 28 Chat() : statusType(StatusShow::None), isMUC(false), unreadCount(0), isPrivateMessage(false) {}
29 Chat(const JID& jid, const std::string& chatName, const std::string& activity, int unreadCount, StatusShow::Type statusType, const boost::filesystem::path& avatarPath, bool isMUC, bool isPrivateMessage = false, const std::string& nick = "", const boost::optional<std::string> password = boost::optional<std::string>()) 29 Chat(const JID& jid, const std::string& chatName, const std::string& activity, size_t unreadCount, StatusShow::Type statusType, const boost::filesystem::path& avatarPath, bool isMUC, bool isPrivateMessage = false, const std::string& nick = "", const boost::optional<std::string> password = boost::optional<std::string>())
30 : jid(jid), chatName(chatName), activity(activity), statusType(statusType), isMUC(isMUC), nick(nick), password(password), unreadCount(unreadCount), avatarPath(avatarPath), isPrivateMessage(isPrivateMessage) {} 30 : jid(jid), chatName(chatName), activity(activity), statusType(statusType), isMUC(isMUC), nick(nick), password(password), unreadCount(unreadCount), avatarPath(avatarPath), isPrivateMessage(isPrivateMessage) {}
31 /** Assume that nicks and other transient features aren't important for equality */ 31 /** Assume that nicks and other transient features aren't important for equality */
32 bool operator==(const Chat& other) const { 32 bool operator==(const Chat& other) const {
@@ -53,7 +53,7 @@ namespace Swift {
53 return key_compare(inviteesNames, other.inviteesNames); 53 return key_compare(inviteesNames, other.inviteesNames);
54 } 54 }
55 } 55 }
56 void setUnreadCount(int unread) { 56 void setUnreadCount(size_t unread) {
57 unreadCount = unread; 57 unreadCount = unread;
58 } 58 }
59 void setStatusType(StatusShow::Type type) { 59 void setStatusType(StatusShow::Type type) {
@@ -93,7 +93,7 @@ namespace Swift {
93 bool isMUC; 93 bool isMUC;
94 std::string nick; 94 std::string nick;
95 boost::optional<std::string> password; 95 boost::optional<std::string> password;
96 int unreadCount; 96 size_t unreadCount;
97 boost::filesystem::path avatarPath; 97 boost::filesystem::path avatarPath;
98 std::map<std::string, JID> impromptuJIDs; 98 std::map<std::string, JID> impromptuJIDs;
99 std::map<JID, std::string> inviteesNames; 99 std::map<JID, std::string> inviteesNames;
@@ -107,7 +107,7 @@ namespace Swift {
107 virtual void removeWhiteboardSession(const JID& jid) = 0; 107 virtual void removeWhiteboardSession(const JID& jid) = 0;
108 virtual void removeMUCBookmark(const MUCBookmark& bookmark) = 0; 108 virtual void removeMUCBookmark(const MUCBookmark& bookmark) = 0;
109 virtual void setRecents(const std::list<Chat>& recents) = 0; 109 virtual void setRecents(const std::list<Chat>& recents) = 0;
110 virtual void setUnreadCount(int unread) = 0; 110 virtual void setUnreadCount(size_t unread) = 0;
111 virtual void clearBookmarks() = 0; 111 virtual void clearBookmarks() = 0;
112 virtual void setOnline(bool isOnline) = 0; 112 virtual void setOnline(bool isOnline) = 0;
113 113