author | llornkcor <llornkcor> | 2002-12-15 21:32:35 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-15 21:32:35 (UTC) |
commit | 6de66e1e2af2b3b06e53dd83338b9dc9df6190df (patch) (unidiff) | |
tree | 1c6d955f2acf0f2a1b93b7959748ceed85bab8e0 | |
parent | 0a32396b7294d535b467b4fb4a4a0fb6038a21dc (diff) | |
download | opie-6de66e1e2af2b3b06e53dd83338b9dc9df6190df.zip opie-6de66e1e2af2b3b06e53dd83338b9dc9df6190df.tar.gz opie-6de66e1e2af2b3b06e53dd83338b9dc9df6190df.tar.bz2 |
fix bug in open when cancelling
-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 b199c81..8b3c4c6 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -543,97 +543,97 @@ void TextEdit::setBold(bool y) { | |||
543 | QFont f = editor->font(); | 543 | QFont f = editor->font(); |
544 | f.setBold(y); | 544 | f.setBold(y); |
545 | editor->setFont(f); | 545 | editor->setFont(f); |
546 | } | 546 | } |
547 | 547 | ||
548 | void TextEdit::setItalic(bool y) { | 548 | void TextEdit::setItalic(bool y) { |
549 | QFont f = editor->font(); | 549 | QFont f = editor->font(); |
550 | f.setItalic(y); | 550 | f.setItalic(y); |
551 | editor->setFont(f); | 551 | editor->setFont(f); |
552 | } | 552 | } |
553 | 553 | ||
554 | void TextEdit::setWordWrap(bool y) { | 554 | void TextEdit::setWordWrap(bool y) { |
555 | bool state = editor->edited(); | 555 | bool state = editor->edited(); |
556 | editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); | 556 | editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); |
557 | editor->setEdited( state ); | 557 | editor->setEdited( state ); |
558 | } | 558 | } |
559 | 559 | ||
560 | void TextEdit::setSearchBar(bool b) { | 560 | void TextEdit::setSearchBar(bool b) { |
561 | useSearchBar=b; | 561 | useSearchBar=b; |
562 | Config cfg("TextEdit"); | 562 | Config cfg("TextEdit"); |
563 | cfg.setGroup("View"); | 563 | cfg.setGroup("View"); |
564 | cfg.writeEntry ( "SearchBar", b ); | 564 | cfg.writeEntry ( "SearchBar", b ); |
565 | searchBarAction->setOn(b); | 565 | searchBarAction->setOn(b); |
566 | if(b) | 566 | if(b) |
567 | searchBar->show(); | 567 | searchBar->show(); |
568 | else | 568 | else |
569 | searchBar->hide(); | 569 | searchBar->hide(); |
570 | editor->setFocus(); | 570 | editor->setFocus(); |
571 | } | 571 | } |
572 | 572 | ||
573 | void TextEdit::fileNew() { | 573 | void TextEdit::fileNew() { |
574 | // if( !bFromDocView ) { | 574 | // if( !bFromDocView ) { |
575 | // saveAs(); | 575 | // saveAs(); |
576 | // } | 576 | // } |
577 | newFile(DocLnk()); | 577 | newFile(DocLnk()); |
578 | } | 578 | } |
579 | 579 | ||
580 | void TextEdit::fileOpen() { | 580 | void TextEdit::fileOpen() { |
581 | QMap<QString, QStringList> map; | 581 | QMap<QString, QStringList> map; |
582 | map.insert(tr("All"), QStringList() ); | 582 | map.insert(tr("All"), QStringList() ); |
583 | QStringList text; | 583 | QStringList text; |
584 | text << "text/*"; | 584 | text << "text/*"; |
585 | map.insert(tr("Text"), text ); | 585 | map.insert(tr("Text"), text ); |
586 | text << "*"; | 586 | text << "*"; |
587 | map.insert(tr("All"), text ); | 587 | map.insert(tr("All"), text ); |
588 | QString str = OFileDialog::getOpenFileName( 2, | 588 | QString str = OFileDialog::getOpenFileName( 2, |
589 | QPEApplication::documentDir(), | 589 | QPEApplication::documentDir(), |
590 | QString::null, map); | 590 | QString::null, map); |
591 | if(!str.isEmpty() ) | 591 | if( QFile(str).exists()) |
592 | openFile( str ); | 592 | openFile( str ); |
593 | else | 593 | else |
594 | updateCaption(); | 594 | updateCaption(); |
595 | } | 595 | } |
596 | 596 | ||
597 | void TextEdit::doSearchBar() { | 597 | void TextEdit::doSearchBar() { |
598 | if(!useSearchBar) | 598 | if(!useSearchBar) |
599 | searchBar->hide(); | 599 | searchBar->hide(); |
600 | else | 600 | else |
601 | searchBar->show(); | 601 | searchBar->show(); |
602 | } | 602 | } |
603 | 603 | ||
604 | #if 0 | 604 | #if 0 |
605 | void TextEdit::slotFind() { | 605 | void TextEdit::slotFind() { |
606 | FindDialog frmFind( tr("Text Editor"), this ); | 606 | FindDialog frmFind( tr("Text Editor"), this ); |
607 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), | 607 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), |
608 | editor, SLOT(slotDoFind( const QString&,bool,bool))); | 608 | editor, SLOT(slotDoFind( const QString&,bool,bool))); |
609 | 609 | ||
610 | //case sensitive, backwards, [category] | 610 | //case sensitive, backwards, [category] |
611 | 611 | ||
612 | connect( editor, SIGNAL(notFound()), | 612 | connect( editor, SIGNAL(notFound()), |
613 | &frmFind, SLOT(slotNotFound()) ); | 613 | &frmFind, SLOT(slotNotFound()) ); |
614 | connect( editor, SIGNAL(searchWrapped()), | 614 | connect( editor, SIGNAL(searchWrapped()), |
615 | &frmFind, SLOT(slotWrapAround()) ); | 615 | &frmFind, SLOT(slotWrapAround()) ); |
616 | 616 | ||
617 | frmFind.exec(); | 617 | frmFind.exec(); |
618 | 618 | ||
619 | 619 | ||
620 | } | 620 | } |
621 | #endif | 621 | #endif |
622 | 622 | ||
623 | void TextEdit::fileRevert() { | 623 | void TextEdit::fileRevert() { |
624 | clear(); | 624 | clear(); |
625 | fileOpen(); | 625 | fileOpen(); |
626 | } | 626 | } |
627 | 627 | ||
628 | void TextEdit::editCut() { | 628 | void TextEdit::editCut() { |
629 | #ifndef QT_NO_CLIPBOARD | 629 | #ifndef QT_NO_CLIPBOARD |
630 | editor->cut(); | 630 | editor->cut(); |
631 | #endif | 631 | #endif |
632 | } | 632 | } |
633 | 633 | ||
634 | void TextEdit::editCopy() { | 634 | void TextEdit::editCopy() { |
635 | #ifndef QT_NO_CLIPBOARD | 635 | #ifndef QT_NO_CLIPBOARD |
636 | editor->copy(); | 636 | editor->copy(); |
637 | #endif | 637 | #endif |
638 | } | 638 | } |
639 | 639 | ||