-rw-r--r-- | core/apps/textedit/textedit.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index c7273c5..26b907b 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -417,15 +417,20 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) TextEdit::~TextEdit() { - owarn << "textedit d'tor" << oendl; + if( edited1 && !promptExit) { + switch( savePrompt() ) { + case 1: { + saveAs(); + } + break; + }; + } + delete editor; } void TextEdit::closeEvent(QCloseEvent *) { - if( edited1 && promptExit) - { - switch( savePrompt() ) - { - case 1: - { + if( promptExit) { + switch( savePrompt() ) { + case 1: { saveAs(); qApp->quit(); @@ -433,6 +438,5 @@ void TextEdit::closeEvent(QCloseEvent *) { break; - case 2: - { + case 2: { qApp->quit(); } @@ -445,5 +449,4 @@ void TextEdit::closeEvent(QCloseEvent *) { else qApp->quit(); - } |