author | llornkcor <llornkcor> | 2005-02-06 03:49:06 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-02-06 03:49:06 (UTC) |
commit | b09f9ce74d40f47bc336b4647c6c091a4f3bd5b6 (patch) (unidiff) | |
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 | |||
@@ -416,24 +416,28 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | |||
416 | } | 416 | } |
417 | 417 | ||
418 | TextEdit::~TextEdit() { | 418 | TextEdit::~TextEdit() { |
419 | owarn << "textedit d'tor" << oendl; | 419 | if( edited1 && !promptExit) { |
420 | switch( savePrompt() ) { | ||
421 | case 1: { | ||
422 | saveAs(); | ||
423 | } | ||
424 | break; | ||
425 | }; | ||
426 | } | ||
427 | |||
420 | delete editor; | 428 | delete editor; |
421 | } | 429 | } |
422 | 430 | ||
423 | void TextEdit::closeEvent(QCloseEvent *) { | 431 | void TextEdit::closeEvent(QCloseEvent *) { |
424 | if( edited1 && promptExit) | 432 | if( promptExit) { |
425 | { | 433 | switch( savePrompt() ) { |
426 | switch( savePrompt() ) | 434 | case 1: { |
427 | { | ||
428 | case 1: | ||
429 | { | ||
430 | saveAs(); | 435 | saveAs(); |
431 | qApp->quit(); | 436 | qApp->quit(); |
432 | } | 437 | } |
433 | break; | 438 | break; |
434 | 439 | ||
435 | case 2: | 440 | case 2: { |
436 | { | ||
437 | qApp->quit(); | 441 | qApp->quit(); |
438 | } | 442 | } |
439 | break; | 443 | break; |
@@ -444,7 +448,6 @@ void TextEdit::closeEvent(QCloseEvent *) { | |||
444 | } | 448 | } |
445 | else | 449 | else |
446 | qApp->quit(); | 450 | qApp->quit(); |
447 | |||
448 | } | 451 | } |
449 | 452 | ||
450 | void TextEdit::cleanUp() { | 453 | void TextEdit::cleanUp() { |