summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-01 21:24:59 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-01 21:54:48 +0300
commitf5e3f241af190e487c0499dae0efc12e9ae2d202 (patch)
tree295bac3fa27cfff3c78d664b49b01ff51b723b77 /src/gui/windows
parent13c5cc47aca547c1f3ca02e26672557823b844ee (diff)
downloadmanaverse-f5e3f241af190e487c0499dae0efc12e9ae2d202.tar.gz
manaverse-f5e3f241af190e487c0499dae0efc12e9ae2d202.tar.bz2
manaverse-f5e3f241af190e487c0499dae0efc12e9ae2d202.tar.xz
manaverse-f5e3f241af190e487c0499dae0efc12e9ae2d202.zip
Fix code style.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/mailviewwindow.cpp12
-rw-r--r--src/gui/windows/mailviewwindow.h1
-rw-r--r--src/gui/windows/mailwindow.cpp19
3 files changed, 14 insertions, 18 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index 03503bfac..3f349ef42 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -20,7 +20,6 @@
#include "gui/windows/mailviewwindow.h"
-#include "configuration.h"
#include "settings.h"
#include "net/mail2handler.h"
@@ -40,6 +39,7 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
+#include "utils/stringutils.h"
#include "resources/inventory/inventory.h"
@@ -109,7 +109,7 @@ MailViewWindow::MailViewWindow(MailMessage *const message,
if (message->money != 0)
{
// TRANSLATORS: mail view window label
- mMoneyLabel = new Label(this, strprintf("%s %d", _("Money:"),
+ mMoneyLabel = new Label(this, strprintf("%s %" PRId64, _("Money:"),
message->money));
placer(0, n++, mMoneyLabel);
}
@@ -170,7 +170,7 @@ void MailViewWindow::action(const ActionEvent &event)
}
else
{
- mailHandler->getAttach(mMessage->id);
+ mailHandler->getAttach(CAST_S32(mMessage->id));
}
}
else if (eventId == "money")
@@ -239,7 +239,7 @@ void MailViewWindow::removeItems(const int64_t mailId)
mMessage->type = static_cast<MailMessageType::Type>(
CAST_S32(mMessage->type) ^ CAST_S32(MailMessageType::Item));
updateAttachButton();
- if (mailWindow)
+ if (mailWindow != nullptr)
mailWindow->refreshMailNames();
}
@@ -257,13 +257,13 @@ void MailViewWindow::removeMoney(const int64_t mailId)
if (mMoneyLabel == nullptr)
return;
- if (mGetMoneyButton)
+ if (mGetMoneyButton != nullptr)
mGetMoneyButton->setVisible(Visible_false);
mMoneyLabel->setCaption(strprintf("%s %d",
// TRANSLATORS: mail view window label
_("Money:"),
0));
- if (mailWindow)
+ if (mailWindow != nullptr)
mailWindow->refreshMailNames();
}
diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h
index c3f691629..19585de03 100644
--- a/src/gui/windows/mailviewwindow.h
+++ b/src/gui/windows/mailviewwindow.h
@@ -26,7 +26,6 @@
#include "listeners/actionlistener.h"
class Button;
-class Icon;
class Inventory;
class ItemContainer;
class Label;
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index d22168f6d..254aa2f73 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -146,7 +146,7 @@ void MailWindow::action(const ActionEvent &event)
if (mUseMail2)
mail2Handler->readMail(mOpenType, mail->id);
else
- mailHandler->readMessage(mail->id);
+ mailHandler->readMessage(CAST_S32(mail->id));
}
else if (eventId == "delete")
{
@@ -157,7 +157,7 @@ void MailWindow::action(const ActionEvent &event)
if (mUseMail2)
mail2Handler->deleteMail(mOpenType, mail->id);
else
- mailHandler->deleteMessage(mail->id);
+ mailHandler->deleteMessage(CAST_S32(mail->id));
}
else if (eventId == "return")
{
@@ -175,7 +175,7 @@ void MailWindow::action(const ActionEvent &event)
if (sel < 0)
return;
const MailMessage *const mail = mMessages[sel];
- mailHandler->returnMessage(mail->id);
+ mailHandler->returnMessage(CAST_S32(mail->id));
}
}
}
@@ -210,12 +210,9 @@ std::string MailWindow::getMailHeader(MailMessage *const message) const
header.append(" ").append(message->title);
return STD_MOVE(header);
}
- else
- {
- return strprintf("%s %s",
- message->read ? " " : "U",
- message->title.c_str());
- }
+ return strprintf("%s %s",
+ message->read ? " " : "U",
+ message->title.c_str());
}
void MailWindow::addMail(MailMessage *const message)
@@ -294,7 +291,7 @@ void MailWindow::viewNext(const int64_t id)
if (mUseMail2)
mail2Handler->readMail(mOpenType, message->id);
else
- mailHandler->readMessage(message->id);
+ mailHandler->readMessage(CAST_S32(message->id));
return;
}
}
@@ -322,7 +319,7 @@ void MailWindow::viewPrev(const int64_t id)
if (mUseMail2)
mail2Handler->readMail(mOpenType, message->id);
else
- mailHandler->readMessage(message->id);
+ mailHandler->readMessage(CAST_S32(message->id));
return;
}
}