diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-29 14:01:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-29 14:10:28 +0300 |
commit | f820365eed7e956e67e6122a8a5ab529e7df9474 (patch) | |
tree | 9ee43bae2f7cafa38ab0cf018b8dbaf49d531f38 /src/gui/windows/mailview.cpp | |
parent | 4b0f30b1e1879cee6d65394d826bba21eca6c40b (diff) | |
download | mv-f820365eed7e956e67e6122a8a5ab529e7df9474.tar.gz mv-f820365eed7e956e67e6122a8a5ab529e7df9474.tar.bz2 mv-f820365eed7e956e67e6122a8a5ab529e7df9474.tar.xz mv-f820365eed7e956e67e6122a8a5ab529e7df9474.zip |
Fix time in mail view window.
Also fix possible leaks in mail windows.
Diffstat (limited to 'src/gui/windows/mailview.cpp')
-rw-r--r-- | src/gui/windows/mailview.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gui/windows/mailview.cpp b/src/gui/windows/mailview.cpp index 4c252c89d..32a207acf 100644 --- a/src/gui/windows/mailview.cpp +++ b/src/gui/windows/mailview.cpp @@ -36,6 +36,7 @@ #include "gui/widgets/layouttype.h" #include "gui/widgets/textfield.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "utils/stringutils.h" @@ -47,9 +48,11 @@ #include "debug.h" +MailView *mailViewWindow = nullptr; + MailView::MailView(const MailMessage *const message) : // TRANSLATORS: mail view window name - Window(_("View mail"), true, nullptr, "mailview.xml"), + Window(_("View mail"), false, nullptr, "mailview.xml"), ActionListener(), mMessage(message), // TRANSLATORS: mail view window button @@ -70,9 +73,8 @@ MailView::MailView(const MailMessage *const message) : mMessageLabel(new Label(this, strprintf("%s %s", _("Message:"), message->text.c_str()))), // TRANSLATORS: mail view window label - mItemLabel(new Label(this, std::string(_("Item:")).append(" "))), - mMessageField(new TextField(this)), - mIcon(new Icon(this, nullptr)) + mItemLabel(nullptr), + mIcon(nullptr) { setWindowName("MailView"); setCloseButton(true); @@ -89,8 +91,6 @@ MailView::MailView(const MailMessage *const message) : ContainerPlacer placer; placer = getPlacer(0, 0); - mMessageField->setWidth(100); - int n = 0; placer(0, n++, mTimeLabel); placer(0, n++, mFromLabel); @@ -111,7 +111,8 @@ MailView::MailView(const MailMessage *const message) : paths.getStringValue("itemIcons").append( item.getDisplay().image), item.getDyeColorsString(1))); - mIcon->setImage(image); + mIcon = new Icon(this, image); + mItemLabel = new Label(this, std::string(_("Item:")).append(" ")); placer(0, n, mItemLabel); placer(1, n++, mIcon); } @@ -125,6 +126,14 @@ MailView::MailView(const MailMessage *const message) : MailView::~MailView() { + if (mIcon) + { + Image *const image = mIcon->getImage(); + if (image) + image->decRef(); + } + delete2(mMessage); + mailViewWindow = nullptr; } void MailView::action(const ActionEvent &event) |