Changeset View
Changeset View
Standalone View
Standalone View
src/kcompressiondevice.cpp
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 148 | { | |||
---|---|---|---|---|---|
176 | return true; | 176 | return true; | ||
177 | } | 177 | } | ||
178 | 178 | | |||
179 | void KCompressionDevice::close() | 179 | void KCompressionDevice::close() | ||
180 | { | 180 | { | ||
181 | if (!isOpen()) { | 181 | if (!isOpen()) { | ||
182 | return; | 182 | return; | ||
183 | } | 183 | } | ||
184 | d->errorCode = QFileDevice::NoError; | 184 | if (d->filter->mode() == QIODevice::WriteOnly && d->errorCode == QFileDevice::NoError) { | ||
185 | if (d->filter->mode() == QIODevice::WriteOnly) { | | |||
186 | write(nullptr, 0); // finish writing | 185 | write(nullptr, 0); // finish writing | ||
187 | } | 186 | } | ||
188 | //qCDebug(KArchiveLog) << "Calling terminate()."; | 187 | //qCDebug(KArchiveLog) << "Calling terminate()."; | ||
189 | 188 | | |||
190 | if (!d->filter->terminate()) { | 189 | if (!d->filter->terminate()) { | ||
191 | //qCWarning(KArchiveLog) << "KCompressionDevice::close: terminate returned an error"; | 190 | //qCWarning(KArchiveLog) << "KCompressionDevice::close: terminate returned an error"; | ||
192 | d->errorCode = QFileDevice::UnspecifiedError; | 191 | d->errorCode = QFileDevice::UnspecifiedError; | ||
193 | } | 192 | } | ||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |