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/QtUI
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/QtUI')
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.cpp2
-rw-r--r--Swift/QtUI/ChatList/QtChatListWindow.h4
-rw-r--r--Swift/QtUI/QtChatWindow.cpp4
-rw-r--r--Swift/QtUI/QtChatWindow.h6
-rw-r--r--Swift/QtUI/QtTabbable.h2
5 files changed, 9 insertions, 9 deletions
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index e92ba0d..2fd05c4 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -132,3 +132,3 @@ void QtChatListWindow::setRecents(const std::list<ChatListWindow::Chat>& recents
-void QtChatListWindow::setUnreadCount(int unread) {
+void QtChatListWindow::setUnreadCount(size_t unread) {
emit onCountUpdated(unread);
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.h b/Swift/QtUI/ChatList/QtChatListWindow.h
index 001650c..3322001 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.h
+++ b/Swift/QtUI/ChatList/QtChatListWindow.h
@@ -29,3 +29,3 @@ namespace Swift {
void setRecents(const std::list<ChatListWindow::Chat>& recents);
- void setUnreadCount(int unread);
+ void setUnreadCount(size_t unread);
void clearBookmarks();
@@ -34,3 +34,3 @@ namespace Swift {
signals:
- void onCountUpdated(int count);
+ void onCountUpdated(size_t count);
private slots:
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index a413b4d..82c65ce 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -507,3 +507,3 @@ void QtChatWindow::showEvent(QShowEvent* event) {
-void QtChatWindow::setUnreadMessageCount(int count) {
+void QtChatWindow::setUnreadMessageCount(size_t count) {
if (unreadCount_ != count) {
@@ -549,3 +549,3 @@ void QtChatWindow::flash() {
-int QtChatWindow::getCount() {
+size_t QtChatWindow::getCount() {
return unreadCount_;
diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h
index 8cc3283..b876d1e 100644
--- a/Swift/QtUI/QtChatWindow.h
+++ b/Swift/QtUI/QtChatWindow.h
@@ -108,3 +108,3 @@ namespace Swift {
void activate();
- void setUnreadMessageCount(int count);
+ void setUnreadMessageCount(size_t count);
void convertToMUC(MUCType mucType);
@@ -121,3 +121,3 @@ namespace Swift {
void setTabComplete(TabComplete* completer);
- int getCount();
+ size_t getCount();
virtual void replaceSystemMessage(const ChatMessage& message, const std::string& id, const TimestampBehaviour timestampBehaviour);
@@ -203,3 +203,3 @@ namespace Swift {
private:
- int unreadCount_;
+ size_t unreadCount_;
bool contactIsTyping_;
diff --git a/Swift/QtUI/QtTabbable.h b/Swift/QtUI/QtTabbable.h
index 5837702..63c60f4 100644
--- a/Swift/QtUI/QtTabbable.h
+++ b/Swift/QtUI/QtTabbable.h
@@ -21,3 +21,3 @@ namespace Swift {
virtual AlertType getWidgetAlertState() {return NoActivity;}
- virtual int getCount() {return 0;}
+ virtual size_t getCount() {return 0;}
virtual std::string getID() const = 0;