author | llornkcor <llornkcor> | 2002-12-16 04:34:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-16 04:34:10 (UTC) |
commit | d1d849bab2d54b1e9144bca1f30786882be9a464 (patch) (side-by-side diff) | |
tree | 4a17e9dba5e5ec84cd2344f55640b262d57f0d96 | |
parent | 71f0618e5fdfe7c7f5c251fef3885ee3833d1046 (diff) | |
download | opie-d1d849bab2d54b1e9144bca1f30786882be9a464.zip opie-d1d849bab2d54b1e9144bca1f30786882be9a464.tar.gz opie-d1d849bab2d54b1e9144bca1f30786882be9a464.tar.bz2 |
work around for changing wrap changing edited state. also fixed opening dotFiles line endings
-rw-r--r-- | core/apps/textedit/textedit.cpp | 9 |
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) { f.setBold(y); editor->setFont(f); } void TextEdit::setItalic(bool y) { QFont f = editor->font(); f.setItalic(y); editor->setFont(f); } void TextEdit::setWordWrap(bool y) { bool state = editor->edited(); + QString captionStr = caption(); + bool b1 = edited1; + bool b2 = edited; + editor->setWordWrap(y ? QMultiLineEdit::WidgetWidth : QMultiLineEdit::NoWrap ); editor->setEdited( state ); + edited1=b1; + edited=b2; + setCaption(captionStr); } void TextEdit::setSearchBar(bool b) { useSearchBar=b; Config cfg("TextEdit"); cfg.setGroup("View"); cfg.writeEntry ( "SearchBar", b ); searchBarAction->setOn(b); if(b) searchBar->show(); else searchBar->hide(); @@ -675,25 +682,25 @@ void TextEdit::newFile( const DocLnk &f ) { } void TextEdit::openDotFile( const QString &f ) { if(!currentFileName.isEmpty()) { currentFileName=f; qDebug("openFile dotfile " + currentFileName); QString txt; QFile file(f); file.open(IO_ReadWrite); QTextStream t(&file); while ( !t.atEnd()) { - txt+=t.readLine(); + txt+=t.readLine()+"\n"; } editor->setText(txt); editor->setEdited( false); edited1=false; edited=false; } updateCaption( currentFileName); } void TextEdit::openFile( const QString &f ) { |