Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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 | |||
@@ -507,13 +507,13 @@ void TextEdit::fileOpen() | |||
507 | Config cfg("TextEdit"); | 507 | Config cfg("TextEdit"); |
508 | cfg.setGroup("View"); | 508 | cfg.setGroup("View"); |
509 | bool b=FALSE; | 509 | bool b=FALSE; |
510 | // if(cfg.readEntry("useOldFileDialog") == "TRUE") | 510 | // if(cfg.readEntry("useOldFileDialog") == "TRUE") |
511 | // b=TRUE; | 511 | // b=TRUE; |
512 | // if(!b) { | 512 | // if(!b) { |
513 | QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); | 513 | QString str = OFileDialog::getOpenFileName( 2,"/");//,"", "*", this ); |
514 | if(!str.isEmpty() ) | 514 | if(!str.isEmpty() ) |
515 | openFile( str ); | 515 | openFile( str ); |
516 | // } else { | 516 | // } else { |
517 | // QString str; | 517 | // QString str; |
518 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // | 518 | // browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); // |
519 | // browseForFiles->setFileView( viewSelection ); | 519 | // browseForFiles->setFileView( viewSelection ); |
@@ -745,12 +745,13 @@ bool TextEdit::save() | |||
745 | qDebug("saveFile "+currentFileName); | 745 | qDebug("saveFile "+currentFileName); |
746 | 746 | ||
747 | struct stat buf; | 747 | struct stat buf; |
748 | mode_t mode; | 748 | mode_t mode; |
749 | stat(file.latin1(), &buf); | 749 | stat(file.latin1(), &buf); |
750 | mode = buf.st_mode; | 750 | mode = buf.st_mode; |
751 | |||
751 | if(!fileIs) { | 752 | if(!fileIs) { |
752 | doc->setName( name); | 753 | doc->setName( name); |
753 | FileManager fm; | 754 | FileManager fm; |
754 | if ( !fm.saveFile( *doc, rt ) ) { | 755 | if ( !fm.saveFile( *doc, rt ) ) { |
755 | return false; | 756 | return false; |
756 | } | 757 | } |
@@ -819,17 +820,22 @@ bool TextEdit::saveAs() | |||
819 | doc->setName(docname); | 820 | doc->setName(docname); |
820 | currentFileName=docname; | 821 | currentFileName=docname; |
821 | } | 822 | } |
822 | } | 823 | } |
823 | 824 | ||
824 | 825 | ||
825 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); | 826 | // QString str = OFileDialog::getSaveFileName( 2,"/");//,"", "*", this ); |
826 | qDebug("wanna save filename "+currentFileName); | 827 | // if(!str.isEmpty() ) { |
827 | fileSaveDlg->exec(); | 828 | // openFile( str ); |
828 | if( fileSaveDlg->result() == 1 ) { | 829 | |
830 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); | ||
831 | qDebug("wanna save filename "+currentFileName); | ||
832 | fileSaveDlg->exec(); | ||
833 | if( fileSaveDlg->result() == 1 ) { | ||
829 | QString fileNm=fileSaveDlg->selectedFileName; | 834 | QString fileNm=fileSaveDlg->selectedFileName; |
835 | // QString fileNm=srt; | ||
830 | qDebug("saving filename "+fileNm); | 836 | qDebug("saving filename "+fileNm); |
831 | QFileInfo fi(fileNm); | 837 | QFileInfo fi(fileNm); |
832 | currentFileName=fi.fileName(); | 838 | currentFileName=fi.fileName(); |
833 | if(doc) { | 839 | if(doc) { |
834 | // QString file = doc->file(); | 840 | // QString file = doc->file(); |
835 | // doc->removeFiles(); | 841 | // doc->removeFiles(); |