-rw-r--r-- | core/apps/textedit/textedit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 019ffee..197b28b 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -512,49 +512,49 @@ void TextEdit::fileOpen() menu->hide(); editBar->hide(); searchBar->hide(); clearWState (WState_Reserved1 ); editorStack->raiseWidget( fileSelector ); fileSelector->reread(); updateCaption(); } void TextEdit::newFileOpen() { browseForFiles=new fileBrowser(this,"fileBrowser",TRUE,0, "*"); 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); + qDebug("please open "+currentFileName); openFile(fileName ); } } } delete browseForFiles; editor->setEdited( true ); } #if 0 void TextEdit::slotFind() { FindDialog frmFind( "Text Editor", this ); connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), editor, SLOT(slotDoFind( const QString&,bool,bool))); //case sensitive, backwards, [category] connect( editor, SIGNAL(notFound()), &frmFind, SLOT(slotNotFound()) ); connect( editor, SIGNAL(searchWrapped()), &frmFind, SLOT(slotWrapAround()) ); frmFind.exec(); @@ -612,48 +612,50 @@ void TextEdit::search() { editor->find( searchEdit->text(), FALSE, FALSE ); } void TextEdit::newFile( const DocLnk &f ) { DocLnk nf = f; nf.setType("text/plain"); clear(); editorStack->raiseWidget( editor ); setWState (WState_Reserved1 ); editor->setFocus(); doc = new DocLnk(nf); qDebug("newFile "+currentFileName); updateCaption(currentFileName); } void TextEdit::openFile( const QString &f ) { bFromDocView = TRUE; DocLnk nf; nf.setType("text/plain"); nf.setFile(f); currentFileName=f; + QFileInfo fi( currentFileName); + nf.setName(fi.baseName()); qDebug("openFile string"+currentFileName); openFile(nf); showEditTools(); // Show filename in caption QString name = f; int sep = name.findRev( '/' ); if ( sep > 0 ) name = name.mid( sep+1 ); updateCaption( name ); } void TextEdit::openFile( const DocLnk &f ) { // clear(); bFromDocView = TRUE; FileManager fm; QString txt; currentFileName=f.name(); qDebug("openFile doclnk " + currentFileName); if ( !fm.loadFile( f, txt ) ) { // ####### could be a new file qDebug( "Cannot open file" ); |