Commit d508fb00 authored by Christoph Cullmann's avatar Christoph Cullmann

backport crash fix for saving .gz and co files

BUG: 346404
BUG: 352152
parent b8160f7d
...@@ -720,7 +720,7 @@ bool TextBuffer::save (const QString &filename) ...@@ -720,7 +720,7 @@ bool TextBuffer::save (const QString &filename)
* use KSaveFile for save write + rename * use KSaveFile for save write + rename
*/ */
KSaveFile saveFile (filename); KSaveFile saveFile (filename);
#if KDE_IS_VERSION(4,10,3) #if KDE_IS_VERSION(4,10,3)
/** /**
* allow fallback if directory not writable * allow fallback if directory not writable
...@@ -728,7 +728,7 @@ bool TextBuffer::save (const QString &filename) ...@@ -728,7 +728,7 @@ bool TextBuffer::save (const QString &filename)
*/ */
saveFile.setDirectWriteFallback (true); saveFile.setDirectWriteFallback (true);
#endif #endif
/** /**
* try to open or fail * try to open or fail
*/ */
...@@ -748,7 +748,7 @@ bool TextBuffer::save (const QString &filename) ...@@ -748,7 +748,7 @@ bool TextBuffer::save (const QString &filename)
* try to open, if new file * try to open, if new file
*/ */
if (deleteFile) { if (deleteFile) {
if (!file->open (QIODevice::WriteOnly | QIODevice::Truncate)) { if (!file->open (QIODevice::WriteOnly)) {
delete file; delete file;
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment