Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 75 |
1 files changed, 42 insertions, 33 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 18402d4..84888c1 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -503,35 +503,44 @@ void TextEdit::fileOpen() { - QString str = OFileDialog::getOpenFileName(1,"/","", QStringList() , this ); - if(!str.isEmpty() ) - openFile( str ); -// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // -// browseForFiles->setFileView( viewSelection ); -// browseForFiles->showMaximized(); -// // if( result != -1 ) - -// if( browseForFiles->exec() != -1 ) { -// QString selFile = browseForFiles->selectedFileName; -// QStringList fileList = browseForFiles->fileList; -// qDebug(selFile); -// QStringList::ConstIterator f; -// QString fileTemp; -// for ( f = fileList.begin(); f != fileList.end(); f++ ) { -// fileTemp = *f; -// fileTemp.right( fileTemp.length()-5); -// QString fileName = fileTemp; -// if( fileName != "Unnamed" || fileName != "Empty Text" ) { -// currentFileName = fileName; -// qDebug("please open "+currentFileName); -// openFile(str ); -// } -// } -// viewSelection = browseForFiles->SelectionCombo->currentItem(); -// } -// delete browseForFiles; -// editor->setEdited( FALSE); -// edited1=FALSE; -// edited=FALSE; -// if(caption().left(1)=="*") -// setCaption(caption().right(caption().length()-1)); -// doSearchBar(); + Config cfg("TextEdit"); + cfg.setGroup("View"); + bool b=FALSE; + if(cfg.readEntry("useOldFileDialog") == "TRUE") + b=TRUE; + if(!b) { + QString str = OFileDialog::getOpenFileName( 1,"/","", "text/plain", this ); + if(!str.isEmpty() ) + openFile( str ); + } else { + QString str; + browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // + browseForFiles->setFileView( viewSelection ); + browseForFiles->showMaximized(); +// if( result != -1 ) + + if( browseForFiles->exec() != -1 ) { + QString selFile = browseForFiles->selectedFileName; + QStringList fileList = browseForFiles->fileList; + qDebug(selFile); + QStringList::ConstIterator f; + QString fileTemp; + for ( f = fileList.begin(); f != fileList.end(); f++ ) { + fileTemp = *f; + fileTemp.right( fileTemp.length()-5); + QString fileName = fileTemp; + if( fileName != "Unnamed" || fileName != "Empty Text" ) { + currentFileName = fileName; + qDebug("please open "+currentFileName); + openFile(str ); + } + } + viewSelection = browseForFiles->SelectionCombo->currentItem(); + } + delete browseForFiles; + editor->setEdited( FALSE); + edited1=FALSE; + edited=FALSE; + if(caption().left(1)=="*") + setCaption(caption().right(caption().length()-1)); + doSearchBar(); + } } |