summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/composer.cpp
authorleseb <leseb>2002-06-16 16:15:47 (UTC)
committer leseb <leseb>2002-06-16 16:15:47 (UTC)
commitea69cfbbde29fef2f792d1eab702699aada088bf (patch) (side-by-side diff)
tree1b908b905a16deaba7331d2f0b0c844f94235da0 /noncore/unsupported/mail2/composer.cpp
parentd4414131cdf32677e8d54a18827f2e772718c3f7 (diff)
downloadopie-ea69cfbbde29fef2f792d1eab702699aada088bf.zip
opie-ea69cfbbde29fef2f792d1eab702699aada088bf.tar.gz
opie-ea69cfbbde29fef2f792d1eab702699aada088bf.tar.bz2
Fix memory leaks
Diffstat (limited to 'noncore/unsupported/mail2/composer.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/composer.cpp28
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 @@
#include <qaction.h>
#include <qtimer.h>
#include <qlabel.h>
+#include <qapplication.h>
#include <qpe/resource.h>
@@ -25,7 +26,7 @@ AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment)
}
Composer::Composer(QWidget *parent, const char *name, WFlags fl)
- : ComposerBase(parent, name, fl)
+ : ComposerBase(parent, name, fl), _inLoop(false)
{
abort->setEnabled(false);
to->setFocus();
@@ -43,6 +44,31 @@ Composer::Composer(QWidget *parent, const char *name, WFlags fl)
QTimer::singleShot(0, this, SLOT(slotResizing()));
}
+Composer::~Composer()
+{
+ hide();
+}
+
+void Composer::hide()
+{
+ QWidget::hide();
+
+ if (_inLoop) {
+ _inLoop = false;
+ qApp->exit_loop();
+ }
+}
+
+void Composer::exec()
+{
+ show();
+
+ if (!_inLoop) {
+ _inLoop = true;
+ qApp->enter_loop();
+ }
+}
+
void Composer::setSendMail(SendMail &sendMail)
{
to->setText(sendMail.to());