author | llornkcor <llornkcor> | 2004-09-18 09:14:31 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-18 09:14:31 (UTC) |
commit | f0e025a8e64f96390377c0aa66e8b5602494d7d0 (patch) (side-by-side diff) | |
tree | 3c812aec7e4bec59cea71f2e16cd1f77230a79fd | |
parent | eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63 (diff) | |
download | opie-f0e025a8e64f96390377c0aa66e8b5602494d7d0.zip opie-f0e025a8e64f96390377c0aa66e8b5602494d7d0.tar.gz opie-f0e025a8e64f96390377c0aa66e8b5602494d7d0.tar.bz2 |
fix #1399
-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 @@ -766,34 +766,40 @@ void TextEdit::showEditTools() { menu->show(); editBar->show(); if(!useSearchBar) searchBar->hide(); else searchBar->show(); setWState (WState_Reserved1 ); } /*! 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()) { saveAs(); } else { currentFileName= name ; odebug << "saveFile "+currentFileName << oendl; struct stat buf; mode_t mode; stat(file.latin1(), &buf); mode = buf.st_mode; |