-rw-r--r-- | core/apps/textedit/textedit.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 2a4d391..8e106bf 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -816,8 +816,9 @@ bool TextEdit::save() { if(!fileIs) { doc->setName( name); FileManager fm; if ( !fm.saveFile( *doc, rt ) ) { + QMessageBox::message(tr("Text Edit"),tr("Save Failed")); return false; } } else { qDebug("regular save file"); @@ -826,9 +827,9 @@ bool TextEdit::save() { QCString crt = rt.utf8(); f.writeBlock(crt,crt.length()); } else { QMessageBox::message(tr("Text Edit"),tr("Write Failed")); - return false; + return false; } } editor->setEdited( false); @@ -908,16 +909,15 @@ bool TextEdit::saveAs() { QString dire = cuFi.dirPath(); if(dire==".") dire = QPEApplication::documentDir(); QString str; - if( !featureAutoSave) - { + if( !featureAutoSave) { str = OFileDialog::getSaveFileName( 2, dire, filee, map); - } - else + } else str=currentFileName; + if(!str.isEmpty()) { QString fileNm=str; qDebug("saving filename "+fileNm); @@ -937,8 +937,9 @@ bool TextEdit::saveAs() { updateCaption( currentFileName); FileManager fm; if ( !fm.saveFile( *doc, rt ) ) { + QMessageBox::message(tr("Text Edit"),tr("Save Failed")); return false; } if( filePerms ) { |