author | leseb <leseb> | 2002-06-16 16:15:47 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-16 16:15:47 (UTC) |
commit | ea69cfbbde29fef2f792d1eab702699aada088bf (patch) (unidiff) | |
tree | 1b908b905a16deaba7331d2f0b0c844f94235da0 /noncore/unsupported/mail2/composer.cpp | |
parent | d4414131cdf32677e8d54a18827f2e772718c3f7 (diff) | |
download | opie-ea69cfbbde29fef2f792d1eab702699aada088bf.zip opie-ea69cfbbde29fef2f792d1eab702699aada088bf.tar.gz opie-ea69cfbbde29fef2f792d1eab702699aada088bf.tar.bz2 |
Fix memory leaks
Diffstat (limited to 'noncore/unsupported/mail2/composer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index 82ed117..7f65dba 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <qaction.h> | 6 | #include <qaction.h> |
7 | #include <qtimer.h> | 7 | #include <qtimer.h> |
8 | #include <qlabel.h> | 8 | #include <qlabel.h> |
9 | #include <qapplication.h> | ||
9 | 10 | ||
10 | #include <qpe/resource.h> | 11 | #include <qpe/resource.h> |
11 | 12 | ||
@@ -25,7 +26,7 @@ AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment) | |||
25 | } | 26 | } |
26 | 27 | ||
27 | Composer::Composer(QWidget *parent, const char *name, WFlags fl) | 28 | Composer::Composer(QWidget *parent, const char *name, WFlags fl) |
28 | : ComposerBase(parent, name, fl) | 29 | : ComposerBase(parent, name, fl), _inLoop(false) |
29 | { | 30 | { |
30 | abort->setEnabled(false); | 31 | abort->setEnabled(false); |
31 | to->setFocus(); | 32 | to->setFocus(); |
@@ -43,6 +44,31 @@ Composer::Composer(QWidget *parent, const char *name, WFlags fl) | |||
43 | QTimer::singleShot(0, this, SLOT(slotResizing())); | 44 | QTimer::singleShot(0, this, SLOT(slotResizing())); |
44 | } | 45 | } |
45 | 46 | ||
47 | Composer::~Composer() | ||
48 | { | ||
49 | hide(); | ||
50 | } | ||
51 | |||
52 | void Composer::hide() | ||
53 | { | ||
54 | QWidget::hide(); | ||
55 | |||
56 | if (_inLoop) { | ||
57 | _inLoop = false; | ||
58 | qApp->exit_loop(); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | void Composer::exec() | ||
63 | { | ||
64 | show(); | ||
65 | |||
66 | if (!_inLoop) { | ||
67 | _inLoop = true; | ||
68 | qApp->enter_loop(); | ||
69 | } | ||
70 | } | ||
71 | |||
46 | void Composer::setSendMail(SendMail &sendMail) | 72 | void Composer::setSendMail(SendMail &sendMail) |
47 | { | 73 | { |
48 | to->setText(sendMail.to()); | 74 | to->setText(sendMail.to()); |