Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 4bbc62b..1c81a55 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -786,7 +786,6 @@ bool TextEdit::save() { saveAs(); return false; } - name = currentFileName; if(doc) { file = doc->file(); odebug << "saver file "+file << oendl; @@ -807,7 +806,8 @@ bool TextEdit::save() { struct stat buf; mode_t mode; - stat(file.latin1(), &buf); + QFile f(file); + fstat(f.handle(), &buf); mode = buf.st_mode; if(!fileIs) { @@ -819,7 +819,6 @@ bool TextEdit::save() { } } else { odebug << "regular save file" << oendl; - QFile f(file); if( f.open(IO_WriteOnly)) { QCString crt = rt.utf8(); f.writeBlock(crt,crt.length()); @@ -827,7 +826,6 @@ bool TextEdit::save() { QMessageBox::message(tr("Text Edit"),tr("Write Failed")); return false; } - } editor->setEdited( false); edited1=false; @@ -835,8 +833,7 @@ bool TextEdit::save() { if(caption().left(1)=="*") setCaption(caption().right(caption().length()-1)); - - chmod( file.latin1(), mode); + fchmod( f.handle(), mode); } return true; } |