Commit 8d7feb4b authored by Montel Laurent's avatar Montel Laurent Committed by Laurent Montel

Delete dialogbox => avoid memory leak

Change-Id: I0f6eba4366f7760bfafd201e6ac22b23b11ce61c
Reviewed-by: default avatarhjk <hjk@qt.io>
parent dce4f03f
......@@ -98,9 +98,9 @@ Settings OptionsDialog::settings()
void OptionsDialog::addKeywordButtonClicked()
{
Keyword keyword;
KeywordDialog *keywordDialog = new KeywordDialog(keyword, keywordNames(), this);
if (keywordDialog->exec() == QDialog::Accepted) {
keyword = keywordDialog->keyword();
KeywordDialog keywordDialog(keyword, keywordNames(), this);
if (keywordDialog.exec() == QDialog::Accepted) {
keyword = keywordDialog.keyword();
addToKeywordsList(keyword);
}
}
......@@ -121,9 +121,9 @@ void OptionsDialog::editKeyword(QListWidgetItem *item)
QSet<QString> keywordNamesButThis = keywordNames();
keywordNamesButThis.remove(keyword.name);
KeywordDialog *keywordDialog = new KeywordDialog(keyword, keywordNamesButThis, this);
if (keywordDialog->exec() == QDialog::Accepted) {
keyword = keywordDialog->keyword();
KeywordDialog keywordDialog(keyword, keywordNamesButThis, this);
if (keywordDialog.exec() == QDialog::Accepted) {
keyword = keywordDialog.keyword();
item->setIcon(icon(keyword.iconType));
item->setText(keyword.name);
item->setData(Qt::UserRole, static_cast<int>(keyword.iconType));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment