Add assert to make sure the temp file could be opened successfully.

This commit is contained in:
Felix Geyer 2012-07-03 12:39:03 +02:00
parent 40f194fe4b
commit d826ae5daf
2 changed files with 4 additions and 1 deletions

View File

@ -108,6 +108,8 @@ void Config::createTempFileInstance()
{
Q_ASSERT(!m_instance);
QTemporaryFile* tmpFile = new QTemporaryFile(qApp);
tmpFile->open();
bool openResult = tmpFile->open();
Q_ASSERT(openResult);
Q_UNUSED(openResult);
m_instance = new Config(tmpFile->fileName(), tmpFile);
}

View File

@ -176,6 +176,7 @@ void KeePass2XmlWriter::writeBinaries()
qint64 bytesWritten = compressor.write(i.key());
Q_ASSERT(bytesWritten == i.key().size());
Q_UNUSED(bytesWritten);
compressor.close();
buffer.seek(0);