author | llornkcor <llornkcor> | 2003-02-16 20:54:08 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-02-16 20:54:08 (UTC) |
commit | 64178d4839f12540b8a3d19cf79c9c2b1d33707e (patch) (unidiff) | |
tree | c8e1b65c379e286b9f8f6750b0c69eaf5c00235c | |
parent | b24a37c7e412cdf49f5d93c8ab51786b6cda24fb (diff) | |
download | opie-64178d4839f12540b8a3d19cf79c9c2b1d33707e.zip opie-64178d4839f12540b8a3d19cf79c9c2b1d33707e.tar.gz opie-64178d4839f12540b8a3d19cf79c9c2b1d33707e.tar.bz2 |
fix for bug 616- hitting ok when no file is selected hangs
-rw-r--r-- | core/apps/textedit/textedit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 4cf1b07..e931f01 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -608,65 +608,65 @@ void TextEdit::setWordWrap(bool y) { | |||
608 | 608 | ||
609 | void TextEdit::setSearchBar(bool b) { | 609 | void TextEdit::setSearchBar(bool b) { |
610 | useSearchBar=b; | 610 | useSearchBar=b; |
611 | Config cfg("TextEdit"); | 611 | Config cfg("TextEdit"); |
612 | cfg.setGroup("View"); | 612 | cfg.setGroup("View"); |
613 | cfg.writeEntry ( "SearchBar", b ); | 613 | cfg.writeEntry ( "SearchBar", b ); |
614 | searchBarAction->setOn(b); | 614 | searchBarAction->setOn(b); |
615 | if(b) | 615 | if(b) |
616 | searchBar->show(); | 616 | searchBar->show(); |
617 | else | 617 | else |
618 | searchBar->hide(); | 618 | searchBar->hide(); |
619 | editor->setFocus(); | 619 | editor->setFocus(); |
620 | } | 620 | } |
621 | 621 | ||
622 | void TextEdit::fileNew() { | 622 | void TextEdit::fileNew() { |
623 | // if( !bFromDocView ) { | 623 | // if( !bFromDocView ) { |
624 | // saveAs(); | 624 | // saveAs(); |
625 | // } | 625 | // } |
626 | newFile(DocLnk()); | 626 | newFile(DocLnk()); |
627 | } | 627 | } |
628 | 628 | ||
629 | void TextEdit::fileOpen() { | 629 | void TextEdit::fileOpen() { |
630 | QMap<QString, QStringList> map; | 630 | QMap<QString, QStringList> map; |
631 | map.insert(tr("All"), QStringList() ); | 631 | map.insert(tr("All"), QStringList() ); |
632 | QStringList text; | 632 | QStringList text; |
633 | text << "text/*"; | 633 | text << "text/*"; |
634 | map.insert(tr("Text"), text ); | 634 | map.insert(tr("Text"), text ); |
635 | text << "*"; | 635 | text << "*"; |
636 | map.insert(tr("All"), text ); | 636 | map.insert(tr("All"), text ); |
637 | QString str = OFileDialog::getOpenFileName( 2, | 637 | QString str = OFileDialog::getOpenFileName( 2, |
638 | QPEApplication::documentDir(), | 638 | QPEApplication::documentDir(), |
639 | QString::null, map); | 639 | QString::null, map); |
640 | if( QFile(str).exists() && !QFileInfo(str).isDir() ) | 640 | if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) |
641 | openFile( str ); | 641 | openFile( str ); |
642 | else | 642 | else |
643 | updateCaption(); | 643 | updateCaption(); |
644 | } | 644 | } |
645 | 645 | ||
646 | void TextEdit::doSearchBar() { | 646 | void TextEdit::doSearchBar() { |
647 | if(!useSearchBar) | 647 | if(!useSearchBar) |
648 | searchBar->hide(); | 648 | searchBar->hide(); |
649 | else | 649 | else |
650 | searchBar->show(); | 650 | searchBar->show(); |
651 | } | 651 | } |
652 | 652 | ||
653 | #if 0 | 653 | #if 0 |
654 | void TextEdit::slotFind() { | 654 | void TextEdit::slotFind() { |
655 | FindDialog frmFind( tr("Text Editor"), this ); | 655 | FindDialog frmFind( tr("Text Editor"), this ); |
656 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), | 656 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), |
657 | editor, SLOT(slotDoFind( const QString&,bool,bool))); | 657 | editor, SLOT(slotDoFind( const QString&,bool,bool))); |
658 | 658 | ||
659 | //case sensitive, backwards, [category] | 659 | //case sensitive, backwards, [category] |
660 | 660 | ||
661 | connect( editor, SIGNAL(notFound()), | 661 | connect( editor, SIGNAL(notFound()), |
662 | &frmFind, SLOT(slotNotFound()) ); | 662 | &frmFind, SLOT(slotNotFound()) ); |
663 | connect( editor, SIGNAL(searchWrapped()), | 663 | connect( editor, SIGNAL(searchWrapped()), |
664 | &frmFind, SLOT(slotWrapAround()) ); | 664 | &frmFind, SLOT(slotWrapAround()) ); |
665 | 665 | ||
666 | frmFind.exec(); | 666 | frmFind.exec(); |
667 | 667 | ||
668 | 668 | ||
669 | } | 669 | } |
670 | #endif | 670 | #endif |
671 | 671 | ||
672 | void TextEdit::fileRevert() { | 672 | void TextEdit::fileRevert() { |