summaryrefslogtreecommitdiff
path: root/core/apps
Unidiff
Diffstat (limited to 'core/apps') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp9
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() {
787 return false; 787 return false;
788 } 788 }
789 name = currentFileName;
790 if(doc) { 789 if(doc) {
791 file = doc->file(); 790 file = doc->file();
@@ -808,5 +807,6 @@ bool TextEdit::save() {
808 struct stat buf; 807 struct stat buf;
809 mode_t mode; 808 mode_t mode;
810 stat(file.latin1(), &buf); 809 QFile f(file);
810 fstat(f.handle(), &buf);
811 mode = buf.st_mode; 811 mode = buf.st_mode;
812 812
@@ -820,5 +820,4 @@ bool TextEdit::save() {
820 } else { 820 } else {
821 odebug << "regular save file" << oendl; 821 odebug << "regular save file" << oendl;
822 QFile f(file);
823 if( f.open(IO_WriteOnly)) { 822 if( f.open(IO_WriteOnly)) {
824 QCString crt = rt.utf8(); 823 QCString crt = rt.utf8();
@@ -828,5 +827,4 @@ bool TextEdit::save() {
828 return false; 827 return false;
829 } 828 }
830
831 } 829 }
832 editor->setEdited( false); 830 editor->setEdited( false);
@@ -836,6 +834,5 @@ bool TextEdit::save() {
836 setCaption(caption().right(caption().length()-1)); 834 setCaption(caption().right(caption().length()-1));
837 835
838 836 fchmod( f.handle(), mode);
839 chmod( file.latin1(), mode);
840 } 837 }
841 return true; 838 return true;