mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-01 01:44: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
|
// Read and decompress the chunk
|
||||||
{
|
{
|
||||||
// file.seek( offsets[ chunkIdx ] );
|
// file.seek( offsets[ chunkIdx ] );
|
||||||
|
Mutex::Lock _( file.lock );
|
||||||
auto bytes = file.map( offsets[ chunkIdx ], 8 );
|
auto bytes = file.map( offsets[ chunkIdx ], 8 );
|
||||||
auto qBytes = QByteArray::fromRawData( reinterpret_cast< char * >(bytes), 8 );
|
auto qBytes = QByteArray::fromRawData( reinterpret_cast< char * >(bytes), 8 );
|
||||||
QDataStream in( qBytes );
|
QDataStream in( qBytes );
|
||||||
|
|
2
file.hh
2
file.hh
|
@ -9,6 +9,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include "ex.hh"
|
#include "ex.hh"
|
||||||
|
#include "mutex.hh"
|
||||||
|
|
||||||
/// A simple wrapper over FILE * operations with added write-buffering,
|
/// A simple wrapper over FILE * operations with added write-buffering,
|
||||||
/// used for non-Qt parts of code.
|
/// used for non-Qt parts of code.
|
||||||
|
@ -44,6 +45,7 @@ class Class
|
||||||
void open( char const * filename, char const * mode ) ;
|
void open( char const * filename, char const * mode ) ;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Mutex lock;
|
||||||
|
|
||||||
Class( char const * filename, char const * mode ) ;
|
Class( char const * filename, char const * mode ) ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue