-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 @@ -787,5 +787,4 @@ bool TextEdit::save() { return false; } - name = currentFileName; if(doc) { file = doc->file(); @@ -808,5 +807,6 @@ bool TextEdit::save() { struct stat buf; mode_t mode; - stat(file.latin1(), &buf); + QFile f(file); + fstat(f.handle(), &buf); mode = buf.st_mode; @@ -820,5 +820,4 @@ bool TextEdit::save() { } else { odebug << "regular save file" << oendl; - QFile f(file); if( f.open(IO_WriteOnly)) { QCString crt = rt.utf8(); @@ -828,5 +827,4 @@ bool TextEdit::save() { return false; } - } editor->setEdited( false); @@ -836,6 +834,5 @@ bool TextEdit::save() { setCaption(caption().right(caption().length()-1)); - - chmod( file.latin1(), mode); + fchmod( f.handle(), mode); } return true; |