-rw-r--r-- | core/apps/textedit/textedit.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 086fdb6..1d0df6a 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -775,16 +775,22 @@ void TextEdit::showEditTools() { /*! unprompted save */ bool TextEdit::save() { + QString name, file; odebug << "saveAsFile " + currentFileName << oendl; if(currentFileName.isEmpty()) { saveAs(); return false; } - - QString file = doc->file(); + name = currentFileName; + if(doc) { + file = doc->file(); odebug << "saver file "+file << oendl; - QString name= doc->name(); + name = doc->name(); odebug << "File named "+name << oendl; + } else { + name = file = currentFileName; + } + QString rt = editor->text(); if( !rt.isEmpty() ) { if(name.isEmpty()) { |