-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 3 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index b1ddc0b..209a258 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp @@ -180,6 +180,7 @@ void fileSaver::listDoubleClicked(QListViewItem *selectedItem) void fileSaver::listClicked(QListViewItem *selectedItem) { + if(selectedItem != NULL) { QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); // qDebug("strItem is "+strItem); @@ -216,7 +217,7 @@ void fileSaver::listClicked(QListViewItem *selectedItem) } //end not symlink chdir(strItem.latin1()); - + } } diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index f89ed6d..f99f259 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -510,7 +510,7 @@ void TextEdit::fileOpen() // if(cfg.readEntry("useOldFileDialog") == "TRUE") // b=TRUE; // if(!b) { - QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); + QString str = OFileDialog::getOpenFileName( 2,"/");//,"", "*", this ); if(!str.isEmpty() ) openFile( str ); // } else { @@ -748,6 +748,7 @@ bool TextEdit::save() mode_t mode; stat(file.latin1(), &buf); mode = buf.st_mode; + if(!fileIs) { doc->setName( name); FileManager fm; @@ -822,11 +823,16 @@ bool TextEdit::saveAs() } +// QString str = OFileDialog::getSaveFileName( 2,"/");//,"", "*", this ); +// if(!str.isEmpty() ) { +// openFile( str ); + fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); qDebug("wanna save filename "+currentFileName); fileSaveDlg->exec(); if( fileSaveDlg->result() == 1 ) { QString fileNm=fileSaveDlg->selectedFileName; +// QString fileNm=srt; qDebug("saving filename "+fileNm); QFileInfo fi(fileNm); currentFileName=fi.fileName(); |