-rw-r--r-- | core/apps/textedit/textedit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 571df27..cabeb20 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -785,15 +785,16 @@ bool TextEdit::save() { | |||
785 | if(doc) { | 785 | if(doc) { |
786 | file = doc->file(); | 786 | file = doc->file(); |
787 | odebug << "saver file "+file << oendl; | 787 | odebug << "saver file "+file << oendl; |
788 | name = doc->name(); | 788 | name = doc->name(); |
789 | odebug << "File named "+name << oendl; | 789 | odebug << "File named "+name << oendl; |
790 | } else { | 790 | } else { |
791 | name = file = currentFileName; | 791 | file = currentFileName; |
792 | name = QFileInfo(currentFileName).baseName(); | ||
792 | } | 793 | } |
793 | 794 | ||
794 | QString rt = editor->text(); | 795 | QString rt = editor->text(); |
795 | if( !rt.isEmpty() ) { | 796 | if( !rt.isEmpty() ) { |
796 | if(name.isEmpty()) { | 797 | if(name.isEmpty()) { |
797 | saveAs(); | 798 | saveAs(); |
798 | } else { | 799 | } else { |
799 | currentFileName = name; | 800 | currentFileName = name; |
@@ -921,13 +922,13 @@ bool TextEdit::saveAs() { | |||
921 | DocLnk nf; | 922 | DocLnk nf; |
922 | nf.setType("text/plain"); | 923 | nf.setType("text/plain"); |
923 | nf.setFile( fileNm); | 924 | nf.setFile( fileNm); |
924 | doc = new DocLnk(nf); | 925 | doc = new DocLnk(nf); |
925 | // editor->setText(rt); | 926 | // editor->setText(rt); |
926 | odebug << "Saving file as "+currentFileName << oendl; | 927 | odebug << "Saving file as "+currentFileName << oendl; |
927 | doc->setName( currentFileName); | 928 | doc->setName( fi.baseName() /*currentFileName*/); |
928 | updateCaption( currentFileName); | 929 | updateCaption( currentFileName); |
929 | 930 | ||
930 | FileManager fm; | 931 | FileManager fm; |
931 | if ( !fm.saveFile( *doc, rt ) ) { | 932 | if ( !fm.saveFile( *doc, rt ) ) { |
932 | QMessageBox::message(tr("Text Edit"),tr("Save Failed")); | 933 | QMessageBox::message(tr("Text Edit"),tr("Save Failed")); |
933 | return false; | 934 | return false; |