summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index af427ac..bd7cfb6 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -544,26 +544,33 @@ void TextEdit::setBold(bool y) {
544 f.setBold(y); 544 f.setBold(y);
545 editor->setFont(f); 545 editor->setFont(f);
546} 546}
547 547
548void TextEdit::setItalic(bool y) { 548void 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
554void TextEdit::setWordWrap(bool y) { 554void TextEdit::setWordWrap(bool y) {
555 bool state = editor->edited(); 555 bool state = editor->edited();
556 QString captionStr = caption();
557 bool b1 = edited1;
558 bool b2 = edited;
559
556 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); 560 editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap );
557 editor->setEdited( state ); 561 editor->setEdited( state );
562 edited1=b1;
563 edited=b2;
564 setCaption(captionStr);
558} 565}
559 566
560void TextEdit::setSearchBar(bool b) { 567void TextEdit::setSearchBar(bool b) {
561 useSearchBar=b; 568 useSearchBar=b;
562 Config cfg("TextEdit"); 569 Config cfg("TextEdit");
563 cfg.setGroup("View"); 570 cfg.setGroup("View");
564 cfg.writeEntry ( "SearchBar", b ); 571 cfg.writeEntry ( "SearchBar", b );
565 searchBarAction->setOn(b); 572 searchBarAction->setOn(b);
566 if(b) 573 if(b)
567 searchBar->show(); 574 searchBar->show();
568 else 575 else
569 searchBar->hide(); 576 searchBar->hide();
@@ -675,25 +682,25 @@ void TextEdit::newFile( const DocLnk &f ) {
675} 682}
676 683
677void TextEdit::openDotFile( const QString &f ) { 684void TextEdit::openDotFile( const QString &f ) {
678 if(!currentFileName.isEmpty()) { 685 if(!currentFileName.isEmpty()) {
679 currentFileName=f; 686 currentFileName=f;
680 687
681 qDebug("openFile dotfile " + currentFileName); 688 qDebug("openFile dotfile " + currentFileName);
682 QString txt; 689 QString txt;
683 QFile file(f); 690 QFile file(f);
684 file.open(IO_ReadWrite); 691 file.open(IO_ReadWrite);
685 QTextStream t(&file); 692 QTextStream t(&file);
686 while ( !t.atEnd()) { 693 while ( !t.atEnd()) {
687 txt+=t.readLine(); 694 txt+=t.readLine()+"\n";
688 } 695 }
689 editor->setText(txt); 696 editor->setText(txt);
690 editor->setEdited( false); 697 editor->setEdited( false);
691 edited1=false; 698 edited1=false;
692 edited=false; 699 edited=false;
693 700
694 701
695 } 702 }
696 updateCaption( currentFileName); 703 updateCaption( currentFileName);
697} 704}
698 705
699void TextEdit::openFile( const QString &f ) { 706void TextEdit::openFile( const QString &f ) {