mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
Merge branch 'staged' into dev
This commit is contained in:
commit
e482e499a3
|
@ -137,7 +137,7 @@ char * Reader::getBlock( uint32_t address, vector< char > & chunk )
|
|||
// Read and decompress the chunk
|
||||
{
|
||||
// file.seek( offsets[ chunkIdx ] );
|
||||
|
||||
Mutex::Lock _( file.lock );
|
||||
auto bytes = file.map( offsets[ chunkIdx ], 8 );
|
||||
auto qBytes = QByteArray::fromRawData( reinterpret_cast< char * >(bytes), 8 );
|
||||
QDataStream in( qBytes );
|
||||
|
|
2
file.hh
2
file.hh
|
@ -9,6 +9,7 @@
|
|||
#include <vector>
|
||||
#include <QFile>
|
||||
#include "ex.hh"
|
||||
#include "mutex.hh"
|
||||
|
||||
/// A simple wrapper over FILE * operations with added write-buffering,
|
||||
/// used for non-Qt parts of code.
|
||||
|
@ -44,6 +45,7 @@ class Class
|
|||
void open( char const * filename, char const * mode ) ;
|
||||
|
||||
public:
|
||||
Mutex lock;
|
||||
|
||||
Class( char const * filename, char const * mode ) ;
|
||||
|
||||
|
|
Loading…
Reference in a new issue