-rw-r--r-- | core/apps/textedit/textedit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index f031a0f..c46f089 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -730,32 +730,33 @@ bool TextEdit::save() | |||
730 | currentFileName= name ; | 730 | currentFileName= name ; |
731 | qDebug("saveFile "+currentFileName); | 731 | qDebug("saveFile "+currentFileName); |
732 | 732 | ||
733 | struct stat buf; | 733 | struct stat buf; |
734 | mode_t mode; | 734 | mode_t mode; |
735 | stat(file.latin1(), &buf); | 735 | stat(file.latin1(), &buf); |
736 | mode = buf.st_mode; | 736 | mode = buf.st_mode; |
737 | 737 | ||
738 | doc->setName( name); | 738 | doc->setName( name); |
739 | FileManager fm; | 739 | FileManager fm; |
740 | if ( !fm.saveFile( *doc, rt ) ) { | 740 | if ( !fm.saveFile( *doc, rt ) ) { |
741 | return false; | 741 | return false; |
742 | } | 742 | } |
743 | editor->setEdited( FALSE); | 743 | editor->setEdited( FALSE); |
744 | edited1=FALSE; | 744 | edited1=FALSE; |
745 | edited=FALSE; | 745 | edited=FALSE; |
746 | if(caption().left(1)=="*") | ||
746 | setCaption(caption().right(caption().length()-1)); | 747 | setCaption(caption().right(caption().length()-1)); |
747 | 748 | ||
748 | 749 | ||
749 | chmod( file.latin1(), mode); | 750 | chmod( file.latin1(), mode); |
750 | } | 751 | } |
751 | return true; | 752 | return true; |
752 | } | 753 | } |
753 | return false; | 754 | return false; |
754 | } | 755 | } |
755 | 756 | ||
756 | /*! | 757 | /*! |
757 | prompted save */ | 758 | prompted save */ |
758 | bool TextEdit::saveAs() | 759 | bool TextEdit::saveAs() |
759 | { | 760 | { |
760 | // qDebug("saveAsFile "+currentFileName); | 761 | // qDebug("saveAsFile "+currentFileName); |
761 | 762 | ||
@@ -819,35 +820,35 @@ bool TextEdit::saveAs() | |||
819 | updateCaption( currentFileName); | 820 | updateCaption( currentFileName); |
820 | 821 | ||
821 | FileManager fm; | 822 | FileManager fm; |
822 | if ( !fm.saveFile( *doc, rt ) ) { | 823 | if ( !fm.saveFile( *doc, rt ) ) { |
823 | return false; | 824 | return false; |
824 | } | 825 | } |
825 | if( fileSaveDlg->filePermCheck->isChecked() ) { | 826 | if( fileSaveDlg->filePermCheck->isChecked() ) { |
826 | filePermissions *filePerm; | 827 | filePermissions *filePerm; |
827 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm); | 828 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm); |
828 | filePerm->exec(); | 829 | filePerm->exec(); |
829 | 830 | ||
830 | if( filePerm) | 831 | if( filePerm) |
831 | delete filePerm; | 832 | delete filePerm; |
832 | } | 833 | } |
833 | } | 834 | } |
834 | } | 835 | } |
835 | editor->setEdited( FALSE); | 836 | editor->setEdited(TRUE); |
836 | edited1=FALSE; | 837 | edited1=FALSE; |
837 | edited=FALSE; | 838 | edited=TRUE; |
838 | if(caption().left(1)=="*") | 839 | if(caption().left(1)=="*") |
839 | setCaption(caption().right(caption().length()-1)); | 840 | setCaption(caption().right(caption().length()-1)); |
840 | 841 | ||
841 | if(fileSaveDlg) | 842 | if(fileSaveDlg) |
842 | delete fileSaveDlg; | 843 | delete fileSaveDlg; |
843 | return true; | 844 | return true; |
844 | } | 845 | } |
845 | 846 | ||
846 | void TextEdit::clear() | 847 | void TextEdit::clear() |
847 | { | 848 | { |
848 | delete doc; | 849 | delete doc; |
849 | doc = 0; | 850 | doc = 0; |
850 | editor->clear(); | 851 | editor->clear(); |
851 | } | 852 | } |
852 | 853 | ||
853 | void TextEdit::updateCaption( const QString &name ) | 854 | void TextEdit::updateCaption( const QString &name ) |