-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 @@ -181,4 +181,5 @@ void fileSaver::listDoubleClicked(QListViewItem *selectedItem) void fileSaver::listClicked(QListViewItem *selectedItem) { + if(selectedItem != NULL) { QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); @@ -217,5 +218,5 @@ void fileSaver::listClicked(QListViewItem *selectedItem) 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 @@ -511,5 +511,5 @@ void TextEdit::fileOpen() // b=TRUE; // if(!b) { - QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); + QString str = OFileDialog::getOpenFileName( 2,"/");//,"", "*", this ); if(!str.isEmpty() ) openFile( str ); @@ -749,4 +749,5 @@ bool TextEdit::save() stat(file.latin1(), &buf); mode = buf.st_mode; + if(!fileIs) { doc->setName( name); @@ -823,4 +824,8 @@ 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); @@ -828,4 +833,5 @@ bool TextEdit::saveAs() if( fileSaveDlg->result() == 1 ) { QString fileNm=fileSaveDlg->selectedFileName; +// QString fileNm=srt; qDebug("saving filename "+fileNm); QFileInfo fi(fileNm); |