|
|
@ -1455,13 +1455,17 @@ bool Kdb3Database::save(){ |
|
|
|
|
|
|
|
|
|
|
|
int size = EncryptedPartSize+DB_HEADER_SIZE; |
|
|
|
int size = EncryptedPartSize+DB_HEADER_SIZE; |
|
|
|
|
|
|
|
|
|
|
|
if(!File->resize(size)){ |
|
|
|
if (!File->resize(size)){ |
|
|
|
|
|
|
|
if (File->size() > size) { |
|
|
|
|
|
|
|
if (!File->remove() || !File->open(QIODevice::ReadWrite)) { |
|
|
|
delete [] buffer; |
|
|
|
delete [] buffer; |
|
|
|
error=decodeFileError(File->error()); |
|
|
|
error=decodeFileError(File->error()); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
File->seek(0); |
|
|
|
File->seek(0); |
|
|
|
if(File->write(buffer,size)!=size){ |
|
|
|
if (File->write(buffer,size)!=size){ |
|
|
|
delete [] buffer; |
|
|
|
delete [] buffer; |
|
|
|
error=decodeFileError(File->error()); |
|
|
|
error=decodeFileError(File->error()); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|