author | llornkcor <llornkcor> | 2004-10-18 09:18:50 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-10-18 09:18:50 (UTC) |
commit | b4a613303322cd557915baa621d4a1cef749af59 (patch) (side-by-side diff) | |
tree | 2bb7ba0e89ce00d0ccb408a69ae79b5c38af6b0e | |
parent | e95fcb09fc069a83b3c10c19c081873daba49831 (diff) | |
download | opie-b4a613303322cd557915baa621d4a1cef749af59.zip opie-b4a613303322cd557915baa621d4a1cef749af59.tar.gz opie-b4a613303322cd557915baa621d4a1cef749af59.tar.bz2 |
change doclnk handling
-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 @@ -783,19 +783,20 @@ bool TextEdit::save() { } name = currentFileName; if(doc) { file = doc->file(); odebug << "saver file "+file << oendl; name = doc->name(); odebug << "File named "+name << oendl; } else { - name = file = currentFileName; + file = currentFileName; + name = QFileInfo(currentFileName).baseName(); } - + QString rt = editor->text(); if( !rt.isEmpty() ) { if(name.isEmpty()) { saveAs(); } else { currentFileName = name; odebug << "saveFile "+currentFileName << oendl; @@ -919,17 +920,17 @@ bool TextEdit::saveAs() { // doc->removeFiles(); delete doc; DocLnk nf; nf.setType("text/plain"); nf.setFile( fileNm); doc = new DocLnk(nf); // editor->setText(rt); odebug << "Saving file as "+currentFileName << oendl; - doc->setName( currentFileName); + doc->setName( fi.baseName() /*currentFileName*/); updateCaption( currentFileName); FileManager fm; if ( !fm.saveFile( *doc, rt ) ) { QMessageBox::message(tr("Text Edit"),tr("Save Failed")); return false; } |