-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 @@ -666,19 +666,20 @@ void TextEdit::openDotFile( const QString &f ) { odebug << "openFile dotfile " + currentFileName << oendl; QString txt; QFile file(f); - file.open(IO_ReadWrite); + if (!file.open(IO_ReadWrite)) + owarn << "Failed to open file " << file.name() << oendl; + else { QTextStream t(&file); while ( !t.atEnd()) { txt+=t.readLine()+"\n"; } editor->setText(txt); editor->setEdited( false); edited1=false; edited=false; - - + } } updateCaption( currentFileName); } |