diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-25 04:36:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-25 04:36:31 +0300 |
commit | 6adafcc07e2101ab085bd9f2182c965ef70d0519 (patch) | |
tree | b1c293ec19e5cd29ad5c05f8eddc017de33b3cb0 | |
parent | d11a1f693cd1c43c4d1977f65ef16eba11d872b1 (diff) | |
download | manaplus-6adafcc07e2101ab085bd9f2182c965ef70d0519.tar.gz manaplus-6adafcc07e2101ab085bd9f2182c965ef70d0519.tar.bz2 manaplus-6adafcc07e2101ab085bd9f2182c965ef70d0519.tar.xz manaplus-6adafcc07e2101ab085bd9f2182c965ef70d0519.zip |
Use int64 for mail messages ids.
-rw-r--r-- | src/gui/mailmessage.h | 2 | ||||
-rw-r--r-- | src/gui/windows/mailwindow.cpp | 10 | ||||
-rw-r--r-- | src/gui/windows/mailwindow.h | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/mailmessage.h b/src/gui/mailmessage.h index 0f6d4f6b5..70ad038fa 100644 --- a/src/gui/mailmessage.h +++ b/src/gui/mailmessage.h @@ -60,7 +60,7 @@ struct MailMessage final std::string strTime; std::string text; uint16_t card[maxMailCards]; - int id; + int64_t id; int time; int expireTime; int money; diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 647eb17f5..c12b719fc 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -207,9 +207,9 @@ void MailWindow::addMail(MailMessage *const message) mMessagesMap[message->id] = message; } -void MailWindow::removeMail(const int id) +void MailWindow::removeMail(const int64_t id) { - std::map<int, MailMessage*>::iterator it1 = mMessagesMap.find(id); + std::map<int64_t, MailMessage*>::iterator it1 = mMessagesMap.find(id); if (it1 != mMessagesMap.end()) mMessagesMap.erase(it1); @@ -238,7 +238,7 @@ void MailWindow::showMessage(MailMessage *const mail) { if (mail == nullptr) return; - const std::map<int, MailMessage*>::const_iterator + const std::map<int64_t, MailMessage*>::const_iterator it = mMessagesMap.find(mail->id); if (it != mMessagesMap.end()) { @@ -250,7 +250,7 @@ void MailWindow::showMessage(MailMessage *const mail) CREATEWIDGETV(mailViewWindow, MailViewWindow, mail); } -void MailWindow::viewNext(const int id) +void MailWindow::viewNext(const int64_t id) { FOR_EACH (STD_VECTOR<MailMessage*>::iterator, it, mMessages) { @@ -274,7 +274,7 @@ void MailWindow::viewNext(const int id) } } -void MailWindow::viewPrev(const int id) +void MailWindow::viewPrev(const int64_t id) { FOR_EACH (STD_VECTOR<MailMessage*>::iterator, it, mMessages) { diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h index 7c808379d..8a6bc6695 100644 --- a/src/gui/windows/mailwindow.h +++ b/src/gui/windows/mailwindow.h @@ -57,11 +57,11 @@ class MailWindow final : public Window, void showMessage(MailMessage *const mail); - void removeMail(const int id); + void removeMail(const int64_t id); - void viewNext(const int id); + void viewNext(const int64_t id); - void viewPrev(const int id); + void viewPrev(const int64_t id); void mouseClicked(MouseEvent &event) override final; @@ -79,7 +79,7 @@ class MailWindow final : public Window, A_WARN_UNUSED A_NONNULL(2); STD_VECTOR<MailMessage*> mMessages; - std::map<int, MailMessage*> mMessagesMap; + std::map<int64_t, MailMessage*> mMessagesMap; ExtendedNamesModel *mMailModel; ExtendedListBox *mListBox; ScrollArea *mListScrollArea; |