author | erik <erik> | 2007-01-19 01:18:01 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-19 01:18:01 (UTC) |
commit | 32343107b30904806d02672955c57ed53d39fe79 (patch) (unidiff) | |
tree | 9114a0ea170e3adc807a2445b49360f1bfde9626 /core/apps | |
parent | ac0ce844e90a64247c0adb210e0a23021b011d57 (diff) | |
download | opie-32343107b30904806d02672955c57ed53d39fe79.zip opie-32343107b30904806d02672955c57ed53d39fe79.tar.gz opie-32343107b30904806d02672955c57ed53d39fe79.tar.bz2 |
Every file in this commit has a change to check the return value of a call.
-rw-r--r-- | core/apps/textedit/textedit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 759e440..61beac5 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -664,23 +664,24 @@ void TextEdit::openDotFile( const QString &f ) { | |||
664 | if(!currentFileName.isEmpty()) { | 664 | if(!currentFileName.isEmpty()) { |
665 | currentFileName=f; | 665 | currentFileName=f; |
666 | 666 | ||
667 | odebug << "openFile dotfile " + currentFileName << oendl; | 667 | odebug << "openFile dotfile " + currentFileName << oendl; |
668 | QString txt; | 668 | QString txt; |
669 | QFile file(f); | 669 | QFile file(f); |
670 | file.open(IO_ReadWrite); | 670 | if (!file.open(IO_ReadWrite)) |
671 | owarn << "Failed to open file " << file.name() << oendl; | ||
672 | else { | ||
671 | QTextStream t(&file); | 673 | QTextStream t(&file); |
672 | while ( !t.atEnd()) { | 674 | while ( !t.atEnd()) { |
673 | txt+=t.readLine()+"\n"; | 675 | txt+=t.readLine()+"\n"; |
674 | } | 676 | } |
675 | editor->setText(txt); | 677 | editor->setText(txt); |
676 | editor->setEdited( false); | 678 | editor->setEdited( false); |
677 | edited1=false; | 679 | edited1=false; |
678 | edited=false; | 680 | edited=false; |
679 | 681 | } | |
680 | |||
681 | } | 682 | } |
682 | updateCaption( currentFileName); | 683 | updateCaption( currentFileName); |
683 | } | 684 | } |
684 | 685 | ||
685 | void TextEdit::openFile( const QString &f ) { | 686 | void TextEdit::openFile( const QString &f ) { |
686 | odebug << "filename is "+ f << oendl; | 687 | odebug << "filename is "+ f << oendl; |