author | llornkcor <llornkcor> | 2002-02-19 01:16:12 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-19 01:16:12 (UTC) |
commit | 05ed9bc7fbd667815e2e3ec608773d19bfd294d2 (patch) (side-by-side diff) | |
tree | 8e32c372231178e96848ba2267195525dd49aaef | |
parent | 2308c4db692821721bbe82f93fd60f275f4cccdc (diff) | |
download | opie-05ed9bc7fbd667815e2e3ec608773d19bfd294d2.zip opie-05ed9bc7fbd667815e2e3ec608773d19bfd294d2.tar.gz opie-05ed9bc7fbd667815e2e3ec608773d19bfd294d2.tar.bz2 |
fixed bug in save (unprompted) saving a new unnamed file...
-rw-r--r-- | core/apps/textedit/textedit.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index e41c69d..2f59ede 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -669,52 +669,55 @@ void TextEdit::openFile( const DocLnk &f ) qDebug("openFile doclnk "+currentFileName); doc->setName(currentFileName); updateCaption(); } void TextEdit::showEditTools() { // if ( !doc ) // close(); // clear(); fileSelector->hide(); menu->show(); editBar->show(); if ( searchVisible ) searchBar->show(); // updateCaption(); editorStack->raiseWidget( editor ); setWState (WState_Reserved1 ); } /*! unprompted save */ bool TextEdit::save() { - qDebug("saveFile "+currentFileName); - + QString file = doc->file(); + QString name= doc->name(); QString rt = editor->text(); - doc->setName( currentFileName); + currentFileName= file ; + qDebug("saveFile "+currentFileName); + + doc->setName( name); FileManager fm; if ( !fm.saveFile( *doc, rt ) ) { return false; } // if(doc) // delete doc; // doc = 0; editor->setEdited( false ); return true; } /*! prompted save */ bool TextEdit::saveAs() { qDebug("saveAsFile "+currentFileName); // case of nothing to save... /// there's always something to save // if ( !doc )//|| !bFromDocView) // { // qDebug("no doc"); // return true; // } if ( !editor->edited() ) { |