author | leseb <leseb> | 2002-06-16 15:34:57 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-16 15:34:57 (UTC) |
commit | 1b74249e80cf9f33e52fdb7cc96a114e8be85bc1 (patch) (unidiff) | |
tree | 679a1a47c9843e8f89dbe0b3bad532ae60187d72 /noncore/unsupported | |
parent | 4c1300773b986ad5725492cd26743d542ed16311 (diff) | |
download | opie-1b74249e80cf9f33e52fdb7cc96a114e8be85bc1.zip opie-1b74249e80cf9f33e52fdb7cc96a114e8be85bc1.tar.gz opie-1b74249e80cf9f33e52fdb7cc96a114e8be85bc1.tar.bz2 |
Fix memory leaks
-rw-r--r-- | noncore/unsupported/mail2/addresspicker.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/mail2/attachdiag.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/mail2/configdiag.cpp | 21 | ||||
-rw-r--r-- | noncore/unsupported/mail2/rename.cpp | 28 |
4 files changed, 35 insertions, 34 deletions
diff --git a/noncore/unsupported/mail2/addresspicker.cpp b/noncore/unsupported/mail2/addresspicker.cpp index 178fe27..7f32725 100644 --- a/noncore/unsupported/mail2/addresspicker.cpp +++ b/noncore/unsupported/mail2/addresspicker.cpp | |||
@@ -105,11 +105,11 @@ QString AddressPicker::getNames() | |||
105 | QString names = 0; | 105 | QString names = 0; |
106 | 106 | ||
107 | AddressPicker *picker = new AddressPicker(0, 0, true); | 107 | AddressPicker picker(0, 0, true); |
108 | picker->showMaximized(); | 108 | picker.showMaximized(); |
109 | picker->show(); | 109 | picker.show(); |
110 | 110 | ||
111 | int ret = picker->exec(); | 111 | int ret = picker.exec(); |
112 | if (QDialog::Accepted == ret) { | 112 | if (QDialog::Accepted == ret) { |
113 | return picker->selectedNames; | 113 | return picker.selectedNames; |
114 | } | 114 | } |
115 | return 0; | 115 | return 0; |
diff --git a/noncore/unsupported/mail2/attachdiag.cpp b/noncore/unsupported/mail2/attachdiag.cpp index bedf3c4..36e1948 100644 --- a/noncore/unsupported/mail2/attachdiag.cpp +++ b/noncore/unsupported/mail2/attachdiag.cpp | |||
@@ -58,10 +58,10 @@ void AttachDiag::fileSelected(const DocLnk &file) | |||
58 | DocLnk AttachDiag::getFile(QWidget *parent) | 58 | DocLnk AttachDiag::getFile(QWidget *parent) |
59 | { | 59 | { |
60 | AttachDiag *attach = new AttachDiag(parent, 0, true); | 60 | AttachDiag attach(parent, 0, true); |
61 | attach->showMaximized(); | 61 | attach.showMaximized(); |
62 | attach->show(); | 62 | attach.show(); |
63 | 63 | ||
64 | if (QDialog::Accepted == attach->exec()) { | 64 | if (QDialog::Accepted == attach.exec()) { |
65 | return attach->currentFile; | 65 | return attach.currentFile; |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/noncore/unsupported/mail2/configdiag.cpp b/noncore/unsupported/mail2/configdiag.cpp index be1f1f4..b89b937 100644 --- a/noncore/unsupported/mail2/configdiag.cpp +++ b/noncore/unsupported/mail2/configdiag.cpp | |||
@@ -80,10 +80,11 @@ void ConfigDiag::slotFillLists() | |||
80 | void ConfigDiag::slotNewAccount() | 80 | void ConfigDiag::slotNewAccount() |
81 | { | 81 | { |
82 | AccountEditor *editor = new AccountEditor(Account(), 0, 0, true); | 82 | Account account; |
83 | editor->showMaximized(); | 83 | AccountEditor editor(account, 0, 0, true); |
84 | editor->show(); | 84 | editor.showMaximized(); |
85 | editor.show(); | ||
85 | 86 | ||
86 | if (QDialog::Accepted == editor->exec()) { | 87 | if (QDialog::Accepted == editor.exec()) { |
87 | ConfigFile::updateAccount(editor->_account); | 88 | ConfigFile::updateAccount(editor._account); |
88 | slotFillLists(); | 89 | slotFillLists(); |
89 | emit changed(); | 90 | emit changed(); |
@@ -99,10 +100,10 @@ void ConfigDiag::slotEditAccount() | |||
99 | Account account = ((AccountListItem *)accountList->currentItem())->account(); | 100 | Account account = ((AccountListItem *)accountList->currentItem())->account(); |
100 | 101 | ||
101 | AccountEditor *editor = new AccountEditor(account, 0, 0, true); | 102 | AccountEditor editor(account, 0, 0, true); |
102 | editor->showMaximized(); | 103 | editor.showMaximized(); |
103 | editor->show(); | 104 | editor.show(); |
104 | 105 | ||
105 | if (QDialog::Accepted == editor->exec()) { | 106 | if (QDialog::Accepted == editor.exec()) { |
106 | ConfigFile::updateAccount(editor->_account); | 107 | ConfigFile::updateAccount(editor._account); |
107 | slotFillLists(); | 108 | slotFillLists(); |
108 | emit changed(); | 109 | emit changed(); |
diff --git a/noncore/unsupported/mail2/rename.cpp b/noncore/unsupported/mail2/rename.cpp index 8c2fde1..627db0b 100644 --- a/noncore/unsupported/mail2/rename.cpp +++ b/noncore/unsupported/mail2/rename.cpp | |||
@@ -11,11 +11,11 @@ Rename::Rename(QWidget *parent, const char *name, bool modal, WFlags fl) | |||
11 | QString Rename::rename(const QString &on, QWidget *parent) | 11 | QString Rename::rename(const QString &on, QWidget *parent) |
12 | { | 12 | { |
13 | Rename *rename = new Rename(parent, 0, true); | 13 | Rename rename(parent, 0, true); |
14 | rename->oldName->setText(on); | 14 | rename.oldName->setText(on); |
15 | rename->newName->setText(on); | 15 | rename.newName->setText(on); |
16 | rename->newName->setFocus(); | 16 | rename.newName->setFocus(); |
17 | 17 | ||
18 | if (rename->exec() == QDialog::Accepted) { | 18 | if (rename.exec() == QDialog::Accepted) { |
19 | return rename->newName->text(); | 19 | return rename.newName->text(); |
20 | } | 20 | } |
21 | 21 | ||
@@ -25,12 +25,12 @@ QString Rename::rename(const QString &on, QWidget *parent) | |||
25 | QString Rename::getText(const QString &caption, const QString &secondLabel, QWidget *parent) | 25 | QString Rename::getText(const QString &caption, const QString &secondLabel, QWidget *parent) |
26 | { | 26 | { |
27 | Rename *rename = new Rename(parent, 0, true); | 27 | Rename rename(parent, 0, true); |
28 | rename->firstLabel->hide(); | 28 | rename.firstLabel->hide(); |
29 | rename->oldName->hide(); | 29 | rename.oldName->hide(); |
30 | rename->setCaption(caption); | 30 | rename.setCaption(caption); |
31 | rename->secondLabel->setText(secondLabel); | 31 | rename.secondLabel->setText(secondLabel); |
32 | 32 | ||
33 | if (rename->exec() == QDialog::Accepted) { | 33 | if (rename.exec() == QDialog::Accepted) { |
34 | return rename->newName->text(); | 34 | return rename.newName->text(); |
35 | } | 35 | } |
36 | 36 | ||