summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-12-20 13:53:13 (UTC)
committer llornkcor <llornkcor>2002-12-20 13:53:13 (UTC)
commit9c92aad4a3d8d83fa41e25ce58d5103599826a5b (patch) (side-by-side diff)
treec6cbd45f55da507ee1f0e53bebc63d9bb0db94e9
parentb7dafc7fc37d05498cf3ad7b7d0981bf3a341b4a (diff)
downloadopie-9c92aad4a3d8d83fa41e25ce58d5103599826a5b.zip
opie-9c92aad4a3d8d83fa41e25ce58d5103599826a5b.tar.gz
opie-9c92aad4a3d8d83fa41e25ce58d5103599826a5b.tar.bz2
save fix when no name bug #577
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index bd7cfb6..4f4f994 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -766,49 +766,54 @@ void TextEdit::openFile( const DocLnk &f ) {
delete doc;
doc = new DocLnk(f);
editor->setText(txt);
editor->setEdited( false);
edited1=false;
edited=false;
doc->setName(currentFileName);
updateCaption();
}
void TextEdit::showEditTools() {
menu->show();
editBar->show();
if(!useSearchBar)
searchBar->hide();
else
searchBar->show();
setWState (WState_Reserved1 );
}
/*!
unprompted save */
bool TextEdit::save() {
- QString file = doc->file();
+ qDebug("saveAsFile " + currentFileName);
+ if(currentFileName.isEmpty()) {
+ saveAs();
+ return;
+ }
+ QString file = doc->file();
qDebug("saver file "+file);
QString name= doc->name();
qDebug("File named "+name);
QString rt = editor->text();
if( !rt.isEmpty() ) {
if(name.isEmpty()) {
saveAs();
} else {
currentFileName= name ;
qDebug("saveFile "+currentFileName);
struct stat buf;
mode_t mode;
stat(file.latin1(), &buf);
mode = buf.st_mode;
if(!fileIs) {
doc->setName( name);
FileManager fm;
if ( !fm.saveFile( *doc, rt ) ) {
return false;
}
} else {
qDebug("regular save file");