summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katebuffer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katebuffer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katebuffer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katebuffer.cpp b/noncore/apps/tinykate/libkate/document/katebuffer.cpp
index 4c15fd0..d89edbd 100644
--- a/noncore/apps/tinykate/libkate/document/katebuffer.cpp
+++ b/noncore/apps/tinykate/libkate/document/katebuffer.cpp
@@ -63,25 +63,28 @@ KWBuffer::clear()
/**
* Insert a file at line @p line in the buffer.
*/
void
KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec)
{
if (line) {
odebug << "insert File only supports insertion at line 0 == file opening" << oendl;
return;
}
clear();
QFile iofile(file);
- iofile.open(IO_ReadOnly);
+ if (!iofile.open(IO_ReadOnly)) {
+ owarn << "failed to open file " << iofile.name() << oendl;
+ return;
+ }
QTextStream stream(&iofile);
stream.setCodec(codec);
QString qsl;
int count=0;
for (count=0;((qsl=stream.readLine())!=QString::null); count++)
{
if (count==0)
{
(*m_stringListIt)->append(qsl.unicode(),qsl.length());
}
else
{