fix: DPRINTF=>GD_DPRINTF ,DDPRINT does not exist now.

do not affect functionality.only existed in comments.
This commit is contained in:
yifang 2022-01-15 15:29:20 +08:00
parent 65fcedd44a
commit 262e650779
14 changed files with 36 additions and 36 deletions

View file

@ -827,7 +827,7 @@ void ArticleRequest::compoundSearchNextStep( bool lastSearchSucceeded )
if ( lastGoodCompoundResult.size() ) // We have something to append if ( lastGoodCompoundResult.size() ) // We have something to append
{ {
// DPRINTF( "Appending\n" ); // GD_DPRINTF( "Appending\n" );
if ( !firstCompoundWasFound ) if ( !firstCompoundWasFound )
{ {
@ -925,7 +925,7 @@ void ArticleRequest::compoundSearchNextStep( bool lastSearchSucceeded )
// Look it up // 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. stemmedWordFinder->expressionMatch( currentSplittedWordCompound, activeDicts, 40, // Would one be enough? Leave 40 to be safe.
Dictionary::SuitableForCompoundSearching ); Dictionary::SuitableForCompoundSearching );

View file

@ -244,11 +244,11 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op,
{ {
QByteArray referer = req.rawHeader( "Referer" ); QByteArray referer = req.rawHeader( "Referer" );
//DPRINTF( "Referer: %s\n", referer.data() ); //GD_DPRINTF( "Referer: %s\n", referer.data() );
QUrl refererUrl = QUrl::fromEncoded( referer ); 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() ); // getHostBase( refererUrl ).toUtf8().data() );
if ( !req.url().host().endsWith( refererUrl.host() ) && 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" ) && if ( ( url.scheme() == "bres" || url.scheme() == "gdau" || url.scheme() == "gdvideo" || url.scheme() == "gico" ) &&
url.path().size() ) url.path().size() )
{ {
//DPRINTF( "Get %s\n", req.url().host().toLocal8Bit().data() ); //GD_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().path().toLocal8Bit().data() );
string id = url.host().toStdString(); string id = url.host().toStdString();

2
bgl.cc
View file

@ -1141,7 +1141,7 @@ sptr< Dictionary::DataRequest > BglDictionary::getResource( string const & name
void ResourceHandler::handleBabylonResource( string const & filename, void ResourceHandler::handleBabylonResource( string const & filename,
char const * data, size_t size ) 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 ) ); vector< unsigned char > compressedData( compressBound( size ) );

View file

@ -325,7 +325,7 @@ void BtreeWordSearchRequest::findMatches()
if ( Utils::AtomicInt::loadAcquire( isCancelled ) ) if ( Utils::AtomicInt::loadAcquire( isCancelled ) )
break; 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 ); vector< WordArticleLink > chain = dict.readChain( chainOffset );
@ -389,7 +389,7 @@ void BtreeWordSearchRequest::findMatches()
{ {
// We're past the current leaf, fetch the next one // We're past the current leaf, fetch the next one
//DPRINTF( "advancing\n" ); //GD_DPRINTF( "advancing\n" );
if ( nextLeaf ) if ( nextLeaf )
{ {
@ -405,7 +405,7 @@ void BtreeWordSearchRequest::findMatches()
if ( leafEntries == 0xffffFFFF ) if ( leafEntries == 0xffffFFFF )
{ {
//DPRINTF( "bah!\n" ); //GD_DPRINTF( "bah!\n" );
exit( 1 ); exit( 1 );
} }
} }
@ -483,7 +483,7 @@ void BtreeIndex::readNode( uint32_t offset, vector< char > & out )
uint32_t uncompressedSize = idxFile->read< uint32_t >(); uint32_t uncompressedSize = idxFile->read< uint32_t >();
uint32_t compressedSize = 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 ); out.resize( uncompressedSize );
@ -586,7 +586,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
{ {
// A node // A node
//DPRINTF( "=>a node\n" ); //GD_DPRINTF( "=>a node\n" );
uint32_t const * offsets = (uint32_t *)leaf + 1; uint32_t const * offsets = (uint32_t *)leaf + 1;
@ -626,7 +626,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
wcharBuffer[ result ] = 0; wcharBuffer[ result ] = 0;
//DPRINTF( "Checking against %s\n", closestString ); //GD_DPRINTF( "Checking against %s\n", closestString );
compareResult = target.compare( &wcharBuffer.front() ); compareResult = target.compare( &wcharBuffer.front() );
@ -686,14 +686,14 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
currentNodeOffset = offsets[ entry + 1 ]; currentNodeOffset = offsets[ entry + 1 ];
} }
//DPRINTF( "reading node at %x\n", currentNodeOffset ); //GD_DPRINTF( "reading node at %x\n", currentNodeOffset );
readNode( currentNodeOffset, extLeaf ); readNode( currentNodeOffset, extLeaf );
leaf = &extLeaf.front(); leaf = &extLeaf.front();
leafEnd = leaf + extLeaf.size(); leafEnd = leaf + extLeaf.size();
} }
else else
{ {
//DPRINTF( "=>a leaf\n" ); //GD_DPRINTF( "=>a leaf\n" );
// A leaf // A leaf
// If this leaf is the root, there's no next leaf, it just can't be. // 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 ) ); 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; ptr += sizeof( uint32_t ) + chainSize;
} }
@ -740,7 +740,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
for( ; ; ) 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; char const ** chainToCheck = window + windowSize/2;
ptr = *chainToCheck; ptr = *chainToCheck;
@ -753,7 +753,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
if ( wcharBuffer.size() <= wordSize ) if ( wcharBuffer.size() <= wordSize )
wcharBuffer.resize( wordSize + 1 ); 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() ); long result = Utf8::decode( ptr, wordSize, &wcharBuffer.front() );

View file

@ -231,7 +231,7 @@ void DictionaryBar::showContextMenu( QContextMenuEvent * event, bool extended )
void DictionaryBar::mutedDictionariesChanged() void DictionaryBar::mutedDictionariesChanged()
{ {
//DPRINTF( "Muted dictionaries changed\n" ); //GD_DPRINTF( "Muted dictionaries changed\n" );
if( !mutedDictionaries ) if( !mutedDictionaries )
return; return;

4
dsl.cc
View file

@ -2193,7 +2193,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
for( map< string, string >::const_iterator i = abrv.begin(); for( map< string, string >::const_iterator i = abrv.begin();
i != abrv.end(); ++i ) 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(); sz = i->first.size();
chunks.addToBlock( &sz, sizeof( uint32_t ) ); chunks.addToBlock( &sz, sizeof( uint32_t ) );
@ -2255,7 +2255,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
uint32_t articleOffset = curOffset; uint32_t articleOffset = curOffset;
//DPRINTF( "Headword: %ls\n", curString.c_str() ); //GD_DPRINTF( "Headword: %ls\n", curString.c_str() );
// More headwords may follow // More headwords may follow

View file

@ -152,7 +152,7 @@ void ForvoArticleRequest::addQuery( QNetworkAccessManager & mgr,
"/order/rate-desc" "/order/rate-desc"
).toUtf8() ); ).toUtf8() );
// DPRINTF( "req: %s\n", reqUrl.toEncoded().data() ); // GD_DPRINTF( "req: %s\n", reqUrl.toEncoded().data() );
sptr< QNetworkReply > netReply = mgr.get( QNetworkRequest( reqUrl ) ); sptr< QNetworkReply > netReply = mgr.get( QNetworkRequest( reqUrl ) );
@ -206,7 +206,7 @@ void ForvoArticleRequest::requestFinished( QNetworkReply * r )
} }
else else
{ {
// DPRINTF( "%s\n", dd.toByteArray().data() ); // GD_DPRINTF( "%s\n", dd.toByteArray().data() );
QDomNode items = dd.namedItem( "items" ); QDomNode items = dd.namedItem( "items" );

View file

@ -896,7 +896,7 @@ bool ScanPopup::eventFilter( QObject * watched, QEvent * event )
if ( event->type() == QEvent::MouseMove ) 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; QMouseEvent * mouseEvent = ( QMouseEvent * ) event;
reactOnMouseMove( mouseEvent->globalPos() ); reactOnMouseMove( mouseEvent->globalPos() );
} }
@ -909,7 +909,7 @@ void ScanPopup::reactOnMouseMove( QPoint const & p )
{ {
if ( geometry().contains( p ) ) if ( geometry().contains( p ) )
{ {
// DPRINTF( "got inside\n" ); // GD_DPRINTF( "got inside\n" );
hideTimer.stop(); hideTimer.stop();
mouseEnteredOnce = true; mouseEnteredOnce = true;
@ -917,7 +917,7 @@ void ScanPopup::reactOnMouseMove( QPoint const & p )
} }
else else
{ {
// DPRINTF( "outside\n" ); // GD_DPRINTF( "outside\n" );
// We're in grab mode and outside the window - calculate the // We're in grab mode and outside the window - calculate the
// distance from it. We might want to hide it. // distance from it. We might want to hide it.

View file

@ -260,7 +260,7 @@ void SdictDictionary::loadIcon() throw()
string SdictDictionary::convert( string const & in ) 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; string inConverted;

View file

@ -511,8 +511,8 @@ bool MediaWikisModel::setData( QModelIndex const & index, const QVariant & value
if ( role == Qt::CheckStateRole && !index.column() ) if ( role == Qt::CheckStateRole && !index.column() )
{ {
//DPRINTF( "type = %d\n", (int)value.type() ); //GD_DPRINTF( "type = %d\n", (int)value.type() );
//DPRINTF( "value = %d\n", (int)value.toInt() ); //GD_DPRINTF( "value = %d\n", (int)value.toInt() );
// XXX it seems to be always passing Int( 2 ) as a value, so we just toggle // XXX it seems to be always passing Int( 2 ) as a value, so we just toggle
mediawikis[ index.row() ].enabled = !mediawikis[ index.row() ].enabled; 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() ) if ( role == Qt::CheckStateRole && !index.column() )
{ {
//DPRINTF( "type = %d\n", (int)value.type() ); //GD_DPRINTF( "type = %d\n", (int)value.type() );
//DPRINTF( "value = %d\n", (int)value.toInt() ); //GD_DPRINTF( "value = %d\n", (int)value.toInt() );
// XXX it seems to be always passing Int( 2 ) as a value, so we just toggle // XXX it seems to be always passing Int( 2 ) as a value, so we just toggle
webSites[ index.row() ].enabled = !webSites[ index.row() ].enabled; webSites[ index.row() ].enabled = !webSites[ index.row() ].enabled;

View file

@ -1534,8 +1534,8 @@ Ifo::Ifo( File::Class & f ):
static string const booknameEq( "bookname=" ); static string const booknameEq( "bookname=" );
//DPRINTF( "%s<\n", f.gets().c_str() ); //GD_DPRINTF( "%s<\n", f.gets().c_str() );
//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" || if ( QString::fromUtf8(f.gets().c_str()) != "StarDict's dict ifo file" ||
f.gets().compare( 0, versionEq.size(), versionEq ) ) f.gets().compare( 0, versionEq.size(), versionEq ) )

View file

@ -494,7 +494,7 @@ void WordFinder::updateResults()
for( ResultsArray::const_iterator i = resultsArray.begin(), j = resultsArray.end(); for( ResultsArray::const_iterator i = resultsArray.begin(), j = resultsArray.end();
i != j; ++i ) 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 ) if ( searchResults.size() < maxSearchResults )
searchResults.push_back( std::pair< QString, bool >( gd::toQString( i->word ), i->wasSuggested ) ); searchResults.push_back( std::pair< QString, bool >( gd::toQString( i->word ), i->wasSuggested ) );

View file

@ -937,7 +937,7 @@ void indexArticle( GzippedFile & gzFile,
// Add also first header - it's needed for full-text search // Add also first header - it's needed for full-text search
chunks.addToBlock( words.begin()->toUtf8().data(), words.begin()->toUtf8().length() + 1 ); 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 // Add words to index

View file

@ -69,7 +69,7 @@ string convert( string const & in, DICT_TYPE type, map < string, string > const
Dictionary::Class *dictPtr, IndexedZip * resourceZip, Dictionary::Class *dictPtr, IndexedZip * resourceZip,
bool isLogicalFormat, unsigned revisionNumber, QString * headword ) 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 &nbsp;s, and then each end of // Convert spaces after each end of line to &nbsp;s, and then each end of
// line to a <br> // line to a <br>