mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
fix: DPRINTF=>GD_DPRINTF ,DDPRINT does not exist now.
do not affect functionality.only existed in comments.
This commit is contained in:
parent
65fcedd44a
commit
262e650779
|
@ -827,7 +827,7 @@ void ArticleRequest::compoundSearchNextStep( bool lastSearchSucceeded )
|
|||
|
||||
if ( lastGoodCompoundResult.size() ) // We have something to append
|
||||
{
|
||||
// DPRINTF( "Appending\n" );
|
||||
// GD_DPRINTF( "Appending\n" );
|
||||
|
||||
if ( !firstCompoundWasFound )
|
||||
{
|
||||
|
@ -925,7 +925,7 @@ void ArticleRequest::compoundSearchNextStep( bool lastSearchSucceeded )
|
|||
|
||||
// Look it up
|
||||
|
||||
// DPRINTF( "Looking up %s\n", qPrintable( currentSplittedWordCompound ) );
|
||||
// GD_DPRINTF( "Looking up %s\n", qPrintable( currentSplittedWordCompound ) );
|
||||
|
||||
stemmedWordFinder->expressionMatch( currentSplittedWordCompound, activeDicts, 40, // Would one be enough? Leave 40 to be safe.
|
||||
Dictionary::SuitableForCompoundSearching );
|
||||
|
|
|
@ -244,11 +244,11 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op,
|
|||
{
|
||||
QByteArray referer = req.rawHeader( "Referer" );
|
||||
|
||||
//DPRINTF( "Referer: %s\n", referer.data() );
|
||||
//GD_DPRINTF( "Referer: %s\n", referer.data() );
|
||||
|
||||
QUrl refererUrl = QUrl::fromEncoded( referer );
|
||||
|
||||
//DPRINTF( "Considering %s vs %s\n", getHostBase( req.url() ).toUtf8().data(),
|
||||
//GD_DPRINTF( "Considering %s vs %s\n", getHostBase( req.url() ).toUtf8().data(),
|
||||
// getHostBase( refererUrl ).toUtf8().data() );
|
||||
|
||||
if ( !req.url().host().endsWith( refererUrl.host() ) &&
|
||||
|
@ -369,8 +369,8 @@ sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource(
|
|||
if ( ( url.scheme() == "bres" || url.scheme() == "gdau" || url.scheme() == "gdvideo" || url.scheme() == "gico" ) &&
|
||||
url.path().size() )
|
||||
{
|
||||
//DPRINTF( "Get %s\n", req.url().host().toLocal8Bit().data() );
|
||||
//DPRINTF( "Get %s\n", req.url().path().toLocal8Bit().data() );
|
||||
//GD_DPRINTF( "Get %s\n", req.url().host().toLocal8Bit().data() );
|
||||
//GD_DPRINTF( "Get %s\n", req.url().path().toLocal8Bit().data() );
|
||||
|
||||
string id = url.host().toStdString();
|
||||
|
||||
|
|
2
bgl.cc
2
bgl.cc
|
@ -1141,7 +1141,7 @@ sptr< Dictionary::DataRequest > BglDictionary::getResource( string const & name
|
|||
void ResourceHandler::handleBabylonResource( string const & filename,
|
||||
char const * data, size_t size )
|
||||
{
|
||||
//DPRINTF( "Handling resource file %s (%u bytes)\n", filename.c_str(), size );
|
||||
//GD_DPRINTF( "Handling resource file %s (%u bytes)\n", filename.c_str(), size );
|
||||
|
||||
vector< unsigned char > compressedData( compressBound( size ) );
|
||||
|
||||
|
|
22
btreeidx.cc
22
btreeidx.cc
|
@ -325,7 +325,7 @@ void BtreeWordSearchRequest::findMatches()
|
|||
if ( Utils::AtomicInt::loadAcquire( isCancelled ) )
|
||||
break;
|
||||
|
||||
//DPRINTF( "offset = %u, size = %u\n", chainOffset - &leaf.front(), leaf.size() );
|
||||
//GD_DPRINTF( "offset = %u, size = %u\n", chainOffset - &leaf.front(), leaf.size() );
|
||||
|
||||
vector< WordArticleLink > chain = dict.readChain( chainOffset );
|
||||
|
||||
|
@ -389,7 +389,7 @@ void BtreeWordSearchRequest::findMatches()
|
|||
{
|
||||
// We're past the current leaf, fetch the next one
|
||||
|
||||
//DPRINTF( "advancing\n" );
|
||||
//GD_DPRINTF( "advancing\n" );
|
||||
|
||||
if ( nextLeaf )
|
||||
{
|
||||
|
@ -405,7 +405,7 @@ void BtreeWordSearchRequest::findMatches()
|
|||
|
||||
if ( leafEntries == 0xffffFFFF )
|
||||
{
|
||||
//DPRINTF( "bah!\n" );
|
||||
//GD_DPRINTF( "bah!\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ void BtreeIndex::readNode( uint32_t offset, vector< char > & out )
|
|||
uint32_t uncompressedSize = idxFile->read< uint32_t >();
|
||||
uint32_t compressedSize = idxFile->read< uint32_t >();
|
||||
|
||||
//DPRINTF( "%x,%x\n", uncompressedSize, compressedSize );
|
||||
//GD_DPRINTF( "%x,%x\n", uncompressedSize, compressedSize );
|
||||
|
||||
out.resize( uncompressedSize );
|
||||
|
||||
|
@ -586,7 +586,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
|
|||
{
|
||||
// A node
|
||||
|
||||
//DPRINTF( "=>a node\n" );
|
||||
//GD_DPRINTF( "=>a node\n" );
|
||||
|
||||
uint32_t const * offsets = (uint32_t *)leaf + 1;
|
||||
|
||||
|
@ -626,7 +626,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
|
|||
|
||||
wcharBuffer[ result ] = 0;
|
||||
|
||||
//DPRINTF( "Checking against %s\n", closestString );
|
||||
//GD_DPRINTF( "Checking against %s\n", closestString );
|
||||
|
||||
compareResult = target.compare( &wcharBuffer.front() );
|
||||
|
||||
|
@ -686,14 +686,14 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
|
|||
currentNodeOffset = offsets[ entry + 1 ];
|
||||
}
|
||||
|
||||
//DPRINTF( "reading node at %x\n", currentNodeOffset );
|
||||
//GD_DPRINTF( "reading node at %x\n", currentNodeOffset );
|
||||
readNode( currentNodeOffset, extLeaf );
|
||||
leaf = &extLeaf.front();
|
||||
leafEnd = leaf + extLeaf.size();
|
||||
}
|
||||
else
|
||||
{
|
||||
//DPRINTF( "=>a leaf\n" );
|
||||
//GD_DPRINTF( "=>a leaf\n" );
|
||||
// A leaf
|
||||
|
||||
// If this leaf is the root, there's no next leaf, it just can't be.
|
||||
|
@ -726,7 +726,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
|
|||
|
||||
memcpy( &chainSize, ptr, sizeof( uint32_t ) );
|
||||
|
||||
//DPRINTF( "%s + %s\n", ptr + sizeof( uint32_t ), ptr + sizeof( uint32_t ) + strlen( ptr + sizeof( uint32_t ) ) + 1 );
|
||||
//GD_DPRINTF( "%s + %s\n", ptr + sizeof( uint32_t ), ptr + sizeof( uint32_t ) + strlen( ptr + sizeof( uint32_t ) ) + 1 );
|
||||
|
||||
ptr += sizeof( uint32_t ) + chainSize;
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
|
|||
|
||||
for( ; ; )
|
||||
{
|
||||
//DPRINTF( "window = %u, ws = %u\n", window - &chainOffsets.front(), windowSize );
|
||||
//GD_DPRINTF( "window = %u, ws = %u\n", window - &chainOffsets.front(), windowSize );
|
||||
|
||||
char const ** chainToCheck = window + windowSize/2;
|
||||
ptr = *chainToCheck;
|
||||
|
@ -753,7 +753,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
|
|||
if ( wcharBuffer.size() <= wordSize )
|
||||
wcharBuffer.resize( wordSize + 1 );
|
||||
|
||||
//DPRINTF( "checking against word %s, left = %u\n", ptr, leafEntries );
|
||||
//GD_DPRINTF( "checking against word %s, left = %u\n", ptr, leafEntries );
|
||||
|
||||
long result = Utf8::decode( ptr, wordSize, &wcharBuffer.front() );
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ void DictionaryBar::showContextMenu( QContextMenuEvent * event, bool extended )
|
|||
|
||||
void DictionaryBar::mutedDictionariesChanged()
|
||||
{
|
||||
//DPRINTF( "Muted dictionaries changed\n" );
|
||||
//GD_DPRINTF( "Muted dictionaries changed\n" );
|
||||
|
||||
if( !mutedDictionaries )
|
||||
return;
|
||||
|
|
4
dsl.cc
4
dsl.cc
|
@ -2193,7 +2193,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
|||
for( map< string, string >::const_iterator i = abrv.begin();
|
||||
i != abrv.end(); ++i )
|
||||
{
|
||||
// DPRINTF( "%s:%s\n", i->first.c_str(), i->second.c_str() );
|
||||
// GD_DPRINTF( "%s:%s\n", i->first.c_str(), i->second.c_str() );
|
||||
|
||||
sz = i->first.size();
|
||||
chunks.addToBlock( &sz, sizeof( uint32_t ) );
|
||||
|
@ -2255,7 +2255,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
|||
|
||||
uint32_t articleOffset = curOffset;
|
||||
|
||||
//DPRINTF( "Headword: %ls\n", curString.c_str() );
|
||||
//GD_DPRINTF( "Headword: %ls\n", curString.c_str() );
|
||||
|
||||
// More headwords may follow
|
||||
|
||||
|
|
4
forvo.cc
4
forvo.cc
|
@ -152,7 +152,7 @@ void ForvoArticleRequest::addQuery( QNetworkAccessManager & mgr,
|
|||
"/order/rate-desc"
|
||||
).toUtf8() );
|
||||
|
||||
// DPRINTF( "req: %s\n", reqUrl.toEncoded().data() );
|
||||
// GD_DPRINTF( "req: %s\n", reqUrl.toEncoded().data() );
|
||||
|
||||
sptr< QNetworkReply > netReply = mgr.get( QNetworkRequest( reqUrl ) );
|
||||
|
||||
|
@ -206,7 +206,7 @@ void ForvoArticleRequest::requestFinished( QNetworkReply * r )
|
|||
}
|
||||
else
|
||||
{
|
||||
// DPRINTF( "%s\n", dd.toByteArray().data() );
|
||||
// GD_DPRINTF( "%s\n", dd.toByteArray().data() );
|
||||
|
||||
QDomNode items = dd.namedItem( "items" );
|
||||
|
||||
|
|
|
@ -896,7 +896,7 @@ bool ScanPopup::eventFilter( QObject * watched, QEvent * event )
|
|||
|
||||
if ( event->type() == QEvent::MouseMove )
|
||||
{
|
||||
// DPRINTF( "Object: %s\n", watched->objectName().toUtf8().data() );
|
||||
// GD_DPRINTF( "Object: %s\n", watched->objectName().toUtf8().data() );
|
||||
QMouseEvent * mouseEvent = ( QMouseEvent * ) event;
|
||||
reactOnMouseMove( mouseEvent->globalPos() );
|
||||
}
|
||||
|
@ -909,7 +909,7 @@ void ScanPopup::reactOnMouseMove( QPoint const & p )
|
|||
{
|
||||
if ( geometry().contains( p ) )
|
||||
{
|
||||
// DPRINTF( "got inside\n" );
|
||||
// GD_DPRINTF( "got inside\n" );
|
||||
|
||||
hideTimer.stop();
|
||||
mouseEnteredOnce = true;
|
||||
|
@ -917,7 +917,7 @@ void ScanPopup::reactOnMouseMove( QPoint const & p )
|
|||
}
|
||||
else
|
||||
{
|
||||
// DPRINTF( "outside\n" );
|
||||
// GD_DPRINTF( "outside\n" );
|
||||
// We're in grab mode and outside the window - calculate the
|
||||
// distance from it. We might want to hide it.
|
||||
|
||||
|
|
2
sdict.cc
2
sdict.cc
|
@ -260,7 +260,7 @@ void SdictDictionary::loadIcon() throw()
|
|||
|
||||
string SdictDictionary::convert( string const & in )
|
||||
{
|
||||
// DPRINTF( "Source>>>>>>>>>>: %s\n\n\n", in.c_str() );
|
||||
// GD_DPRINTF( "Source>>>>>>>>>>: %s\n\n\n", in.c_str() );
|
||||
|
||||
string inConverted;
|
||||
|
||||
|
|
|
@ -511,8 +511,8 @@ bool MediaWikisModel::setData( QModelIndex const & index, const QVariant & value
|
|||
|
||||
if ( role == Qt::CheckStateRole && !index.column() )
|
||||
{
|
||||
//DPRINTF( "type = %d\n", (int)value.type() );
|
||||
//DPRINTF( "value = %d\n", (int)value.toInt() );
|
||||
//GD_DPRINTF( "type = %d\n", (int)value.type() );
|
||||
//GD_DPRINTF( "value = %d\n", (int)value.toInt() );
|
||||
|
||||
// XXX it seems to be always passing Int( 2 ) as a value, so we just toggle
|
||||
mediawikis[ index.row() ].enabled = !mediawikis[ index.row() ].enabled;
|
||||
|
@ -691,8 +691,8 @@ bool WebSitesModel::setData( QModelIndex const & index, const QVariant & value,
|
|||
|
||||
if ( role == Qt::CheckStateRole && !index.column() )
|
||||
{
|
||||
//DPRINTF( "type = %d\n", (int)value.type() );
|
||||
//DPRINTF( "value = %d\n", (int)value.toInt() );
|
||||
//GD_DPRINTF( "type = %d\n", (int)value.type() );
|
||||
//GD_DPRINTF( "value = %d\n", (int)value.toInt() );
|
||||
|
||||
// XXX it seems to be always passing Int( 2 ) as a value, so we just toggle
|
||||
webSites[ index.row() ].enabled = !webSites[ index.row() ].enabled;
|
||||
|
|
|
@ -1534,8 +1534,8 @@ Ifo::Ifo( File::Class & f ):
|
|||
|
||||
static string const booknameEq( "bookname=" );
|
||||
|
||||
//DPRINTF( "%s<\n", f.gets().c_str() );
|
||||
//DPRINTF( "%s<\n", f.gets().c_str() );
|
||||
//GD_DPRINTF( "%s<\n", f.gets().c_str() );
|
||||
//GD_DPRINTF( "%s<\n", f.gets().c_str() );
|
||||
|
||||
if ( QString::fromUtf8(f.gets().c_str()) != "StarDict's dict ifo file" ||
|
||||
f.gets().compare( 0, versionEq.size(), versionEq ) )
|
||||
|
|
|
@ -494,7 +494,7 @@ void WordFinder::updateResults()
|
|||
for( ResultsArray::const_iterator i = resultsArray.begin(), j = resultsArray.end();
|
||||
i != j; ++i )
|
||||
{
|
||||
//DPRINTF( "%d: %ls\n", i->second, i->first.c_str() );
|
||||
//GD_DPRINTF( "%d: %ls\n", i->second, i->first.c_str() );
|
||||
|
||||
if ( searchResults.size() < maxSearchResults )
|
||||
searchResults.push_back( std::pair< QString, bool >( gd::toQString( i->word ), i->wasSuggested ) );
|
||||
|
|
2
xdxf.cc
2
xdxf.cc
|
@ -937,7 +937,7 @@ void indexArticle( GzippedFile & gzFile,
|
|||
// Add also first header - it's needed for full-text search
|
||||
chunks.addToBlock( words.begin()->toUtf8().data(), words.begin()->toUtf8().length() + 1 );
|
||||
|
||||
// DPRINTF( "%x: %s\n", articleOffset, words.begin()->toUtf8().data() );
|
||||
// GD_DPRINTF( "%x: %s\n", articleOffset, words.begin()->toUtf8().data() );
|
||||
|
||||
// Add words to index
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ string convert( string const & in, DICT_TYPE type, map < string, string > const
|
|||
Dictionary::Class *dictPtr, IndexedZip * resourceZip,
|
||||
bool isLogicalFormat, unsigned revisionNumber, QString * headword )
|
||||
{
|
||||
// DPRINTF( "Source>>>>>>>>>>: %s\n\n\n", in.c_str() );
|
||||
// GD_DPRINTF( "Source>>>>>>>>>>: %s\n\n\n", in.c_str() );
|
||||
|
||||
// Convert spaces after each end of line to s, and then each end of
|
||||
// line to a <br>
|
||||
|
|
Loading…
Reference in a new issue