author | llornkcor <llornkcor> | 2005-02-06 03:49:06 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-02-06 03:49:06 (UTC) |
commit | b09f9ce74d40f47bc336b4647c6c091a4f3bd5b6 (patch) (side-by-side diff) | |
tree | 212816ea85f372b28c22c85b3dbf1e6d4dcfa887 | |
parent | d0af8c31f8c74d8aa90477ad672dd876b661eba1 (diff) | |
download | opie-b09f9ce74d40f47bc336b4647c6c091a4f3bd5b6.zip opie-b09f9ce74d40f47bc336b4647c6c091a4f3bd5b6.tar.gz opie-b09f9ce74d40f47bc336b4647c6c091a4f3bd5b6.tar.bz2 |
fix #1472 - no prompt on esc exit
-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 @@ -407,53 +407,56 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) } else { openFile(currentFileName); } } else { edited1=false; openDotFile(""); } viewSelection = cfg.readNumEntry( "FileView", 0 ); } 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(); } break; - case 2: - { + case 2: { qApp->quit(); } break; case -1: break; }; } else qApp->quit(); - } void TextEdit::cleanUp() { Config cfg ( "TextEdit" ); cfg. setGroup ( "Font" ); QFont f = editor->font(); cfg.writeEntry ( "Family", f. family ( )); cfg.writeEntry ( "Size", f. pointSize ( )); cfg.writeEntry ( "Weight", f. weight ( )); cfg.writeEntry ( "Italic", f. italic ( )); |