author | llornkcor <llornkcor> | 2002-02-19 01:29:58 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-19 01:29:58 (UTC) |
commit | 994691c1659fdac4980b0319aa8fab1c98ef3c73 (patch) (unidiff) | |
tree | a7fa94deb3cbd4c7cda17f184eed634bbc0caac4 | |
parent | fe66103c21d3337bb6c7fc7ad112cbdedd255d67 (diff) | |
download | opie-994691c1659fdac4980b0319aa8fab1c98ef3c73.zip opie-994691c1659fdac4980b0319aa8fab1c98ef3c73.tar.gz opie-994691c1659fdac4980b0319aa8fab1c98ef3c73.tar.bz2 |
bug- saveas
-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 | |||
@@ -520,33 +520,33 @@ void TextEdit::fileOpen() | |||
520 | 520 | ||
521 | void TextEdit::newFileOpen() | 521 | void TextEdit::newFileOpen() |
522 | { | 522 | { |
523 | browseForFiles=new fileBrowser(this,"fileBrowser",TRUE,0, "*"); | 523 | browseForFiles=new fileBrowser(this,"fileBrowser",TRUE,0, "*"); |
524 | if( browseForFiles->exec() != -1 ) { | 524 | if( browseForFiles->exec() != -1 ) { |
525 | QString selFile= browseForFiles->selectedFileName; | 525 | QString selFile= browseForFiles->selectedFileName; |
526 | QStringList fileList=browseForFiles->fileList; | 526 | QStringList fileList=browseForFiles->fileList; |
527 | qDebug(selFile); | 527 | qDebug(selFile); |
528 | QStringList::ConstIterator f; | 528 | QStringList::ConstIterator f; |
529 | QString fileTemp; | 529 | QString fileTemp; |
530 | for ( f = fileList.begin(); f != fileList.end(); f++ ) { | 530 | for ( f = fileList.begin(); f != fileList.end(); f++ ) { |
531 | fileTemp = *f; | 531 | fileTemp = *f; |
532 | fileTemp.right( fileTemp.length()-5); | 532 | fileTemp.right( fileTemp.length()-5); |
533 | QString fileName = fileTemp; | 533 | QString fileName = fileTemp; |
534 | if( fileName != "Unnamed" || fileName != "Empty Text" ) { | 534 | if( fileName != "Unnamed" || fileName != "Empty Text" ) { |
535 | currentFileName = fileName; | 535 | currentFileName = fileName; |
536 | // qDebug("please open "+currentFileName); | 536 | qDebug("please open "+currentFileName); |
537 | openFile(fileName ); | 537 | openFile(fileName ); |
538 | } | 538 | } |
539 | } | 539 | } |
540 | } | 540 | } |
541 | delete browseForFiles; | 541 | delete browseForFiles; |
542 | editor->setEdited( true ); | 542 | editor->setEdited( true ); |
543 | } | 543 | } |
544 | 544 | ||
545 | #if 0 | 545 | #if 0 |
546 | void TextEdit::slotFind() | 546 | void TextEdit::slotFind() |
547 | { | 547 | { |
548 | FindDialog frmFind( "Text Editor", this ); | 548 | FindDialog frmFind( "Text Editor", this ); |
549 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), | 549 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), |
550 | editor, SLOT(slotDoFind( const QString&,bool,bool))); | 550 | editor, SLOT(slotDoFind( const QString&,bool,bool))); |
551 | 551 | ||
552 | //case sensitive, backwards, [category] | 552 | //case sensitive, backwards, [category] |
@@ -620,32 +620,34 @@ void TextEdit::newFile( const DocLnk &f ) | |||
620 | clear(); | 620 | clear(); |
621 | editorStack->raiseWidget( editor ); | 621 | editorStack->raiseWidget( editor ); |
622 | setWState (WState_Reserved1 ); | 622 | setWState (WState_Reserved1 ); |
623 | editor->setFocus(); | 623 | editor->setFocus(); |
624 | doc = new DocLnk(nf); | 624 | doc = new DocLnk(nf); |
625 | qDebug("newFile "+currentFileName); | 625 | qDebug("newFile "+currentFileName); |
626 | updateCaption(currentFileName); | 626 | updateCaption(currentFileName); |
627 | } | 627 | } |
628 | 628 | ||
629 | void TextEdit::openFile( const QString &f ) | 629 | void TextEdit::openFile( const QString &f ) |
630 | { | 630 | { |
631 | bFromDocView = TRUE; | 631 | bFromDocView = TRUE; |
632 | DocLnk nf; | 632 | DocLnk nf; |
633 | nf.setType("text/plain"); | 633 | nf.setType("text/plain"); |
634 | nf.setFile(f); | 634 | nf.setFile(f); |
635 | currentFileName=f; | 635 | currentFileName=f; |
636 | QFileInfo fi( currentFileName); | ||
637 | nf.setName(fi.baseName()); | ||
636 | qDebug("openFile string"+currentFileName); | 638 | qDebug("openFile string"+currentFileName); |
637 | 639 | ||
638 | openFile(nf); | 640 | openFile(nf); |
639 | showEditTools(); | 641 | showEditTools(); |
640 | // Show filename in caption | 642 | // Show filename in caption |
641 | QString name = f; | 643 | QString name = f; |
642 | int sep = name.findRev( '/' ); | 644 | int sep = name.findRev( '/' ); |
643 | if ( sep > 0 ) | 645 | if ( sep > 0 ) |
644 | name = name.mid( sep+1 ); | 646 | name = name.mid( sep+1 ); |
645 | updateCaption( name ); | 647 | updateCaption( name ); |
646 | } | 648 | } |
647 | 649 | ||
648 | void TextEdit::openFile( const DocLnk &f ) | 650 | void TextEdit::openFile( const DocLnk &f ) |
649 | { | 651 | { |
650 | // clear(); | 652 | // clear(); |
651 | bFromDocView = TRUE; | 653 | bFromDocView = TRUE; |