mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-12-04 07:54:06 +00:00
Rename "DPRINTF" and "FDPRINTF" debug macro
This commit is contained in:
parent
96b635c834
commit
4120213ee8
|
@ -536,7 +536,7 @@ void ArticleRequest::bodyFinished()
|
||||||
if ( bodyDone )
|
if ( bodyDone )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DPRINTF( "some body finished\n" );
|
GD_DPRINTF( "some body finished\n" );
|
||||||
|
|
||||||
bool wasUpdated = false;
|
bool wasUpdated = false;
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ void ArticleRequest::bodyFinished()
|
||||||
{
|
{
|
||||||
// Good
|
// Good
|
||||||
|
|
||||||
DPRINTF( "one finished.\n" );
|
GD_DPRINTF( "one finished.\n" );
|
||||||
|
|
||||||
Dictionary::DataRequest & req = *bodyRequests.front();
|
Dictionary::DataRequest & req = *bodyRequests.front();
|
||||||
|
|
||||||
|
@ -683,14 +683,14 @@ void ArticleRequest::bodyFinished()
|
||||||
|
|
||||||
foundAnyDefinitions = true;
|
foundAnyDefinitions = true;
|
||||||
}
|
}
|
||||||
DPRINTF( "erasing..\n" );
|
GD_DPRINTF( "erasing..\n" );
|
||||||
bodyRequests.pop_front();
|
bodyRequests.pop_front();
|
||||||
DPRINTF( "erase done..\n" );
|
GD_DPRINTF( "erase done..\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF( "one not finished.\n" );
|
GD_DPRINTF( "one not finished.\n" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,9 +126,9 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op,
|
||||||
sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource(
|
sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource(
|
||||||
QUrl const & url, QString & contentType )
|
QUrl const & url, QString & contentType )
|
||||||
{
|
{
|
||||||
DPRINTF( "getResource: %ls\n", url.toString().toStdWString().c_str() );
|
GD_DPRINTF( "getResource: %ls\n", url.toString().toStdWString().c_str() );
|
||||||
DPRINTF( "scheme: %ls\n", url.scheme().toStdWString().c_str() );
|
GD_DPRINTF( "scheme: %ls\n", url.scheme().toStdWString().c_str() );
|
||||||
DPRINTF( "host: %ls\n", url.host().toStdWString().c_str() );
|
GD_DPRINTF( "host: %ls\n", url.host().toStdWString().c_str() );
|
||||||
|
|
||||||
if ( url.scheme() == "gdlookup" )
|
if ( url.scheme() == "gdlookup" )
|
||||||
{
|
{
|
||||||
|
@ -286,7 +286,7 @@ ArticleResourceReply::ArticleResourceReply( QObject * parent,
|
||||||
if ( req->isFinished() )
|
if ( req->isFinished() )
|
||||||
{
|
{
|
||||||
emit finishedSignal();
|
emit finishedSignal();
|
||||||
DPRINTF( "In-place finish.\n" );
|
GD_DPRINTF( "In-place finish.\n" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,7 @@ qint64 ArticleResourceReply::readData( char * out, qint64 maxSize )
|
||||||
if ( maxSize == 0 )
|
if ( maxSize == 0 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
DPRINTF( "====reading %d bytes\n", (int)maxSize );
|
GD_DPRINTF( "====reading %d bytes\n", (int)maxSize );
|
||||||
|
|
||||||
bool finished = req->isFinished();
|
bool finished = req->isFinished();
|
||||||
|
|
||||||
|
|
2
bgl.cc
2
bgl.cc
|
@ -1291,7 +1291,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
|
|
||||||
idxHeader.chunksOffset = chunks.finish();
|
idxHeader.chunksOffset = chunks.finish();
|
||||||
|
|
||||||
DPRINTF( "Writing index...\n" );
|
GD_DPRINTF( "Writing index...\n" );
|
||||||
|
|
||||||
// Good. Now build the index
|
// Good. Now build the index
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ bool Babylon::read(std::string &source_charset, std::string &target_charset)
|
||||||
convertToUtf8( m_email, TARGET_CHARSET );
|
convertToUtf8( m_email, TARGET_CHARSET );
|
||||||
convertToUtf8( m_copyright, TARGET_CHARSET );
|
convertToUtf8( m_copyright, TARGET_CHARSET );
|
||||||
convertToUtf8( m_description, TARGET_CHARSET );
|
convertToUtf8( m_description, TARGET_CHARSET );
|
||||||
DPRINTF("Default charset: %s\nSource Charset: %s\nTargetCharset: %s\n", m_defaultCharset.c_str(), m_sourceCharset.c_str(), m_targetCharset.c_str());
|
GD_DPRINTF("Default charset: %s\nSource Charset: %s\nTargetCharset: %s\n", m_defaultCharset.c_str(), m_sourceCharset.c_str(), m_targetCharset.c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
|
|
||||||
if ( length > len - a - 2 )
|
if ( length > len - a - 2 )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Hidden displayed headword is too large %s\n", headword.c_str() );
|
GD_FDPRINTF( stderr, "Hidden displayed headword is too large %s\n", headword.c_str() );
|
||||||
pos += len - a;
|
pos += len - a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
|
|
||||||
if ( length > len - a - 2 )
|
if ( length > len - a - 2 )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Displayed headword's length is too large for headword %s\n", headword.c_str() );
|
GD_FDPRINTF( stderr, "Displayed headword's length is too large for headword %s\n", headword.c_str() );
|
||||||
pos += len - a;
|
pos += len - a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -539,7 +539,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
|
|
||||||
if ( length > len - a - 3 )
|
if ( length > len - a - 3 )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "2-byte sized displayed headword for %s is too large\n", headword.c_str() );
|
GD_FDPRINTF( stderr, "2-byte sized displayed headword for %s is too large\n", headword.c_str() );
|
||||||
pos += len - a;
|
pos += len - a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -557,7 +557,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
|
|
||||||
if ( length > len - a - 3 )
|
if ( length > len - a - 3 )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "1-byte-sized transcription's length is too large for headword %s\n", headword.c_str() );
|
GD_FDPRINTF( stderr, "1-byte-sized transcription's length is too large for headword %s\n", headword.c_str() );
|
||||||
pos += len - a;
|
pos += len - a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -590,7 +590,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
|
|
||||||
if ( length > len - a - 4)
|
if ( length > len - a - 4)
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "2-byte-sized transcription's length is too large for headword %s\n", headword.c_str() );
|
GD_FDPRINTF( stderr, "2-byte-sized transcription's length is too large for headword %s\n", headword.c_str() );
|
||||||
pos += len - a;
|
pos += len - a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -623,7 +623,7 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
|
||||||
|
|
||||||
if ( length > len - a - 2 )
|
if ( length > len - a - 2 )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Hidden transcription is too large %s\n", headword.c_str() );
|
GD_FDPRINTF( stderr, "Hidden transcription is too large %s\n", headword.c_str() );
|
||||||
pos += len - a;
|
pos += len - a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1158,7 +1158,7 @@ IndexInfo buildIndex( IndexedWords const & indexedWords, File::Class & file )
|
||||||
if ( btreeMaxElements > BtreeMaxElements )
|
if ( btreeMaxElements > BtreeMaxElements )
|
||||||
btreeMaxElements = BtreeMaxElements;
|
btreeMaxElements = BtreeMaxElements;
|
||||||
|
|
||||||
DPRINTF( "Building a tree of %u elements\n", (unsigned) btreeMaxElements );
|
GD_DPRINTF( "Building a tree of %u elements\n", (unsigned) btreeMaxElements );
|
||||||
|
|
||||||
|
|
||||||
uint32_t lastLeafOffset = 0;
|
uint32_t lastLeafOffset = 0;
|
||||||
|
|
|
@ -409,7 +409,7 @@ Class load() throw( exError )
|
||||||
// Load the config as usual
|
// Load the config as usual
|
||||||
if ( !dd.setContent( &configFile, false, &errorStr, &errorLine, &errorColumn ) )
|
if ( !dd.setContent( &configFile, false, &errorStr, &errorLine, &errorColumn ) )
|
||||||
{
|
{
|
||||||
DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn );
|
GD_DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn );
|
||||||
throw exMalformedConfigFile();
|
throw exMalformedConfigFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,7 +424,7 @@ Class load() throw( exError )
|
||||||
|
|
||||||
if ( !dd.setContent( &bufferedData, false, &errorStr, &errorLine, &errorColumn ) )
|
if ( !dd.setContent( &bufferedData, false, &errorStr, &errorLine, &errorColumn ) )
|
||||||
{
|
{
|
||||||
DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn );
|
GD_DPRINTF( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn );
|
||||||
throw exMalformedConfigFile();
|
throw exMalformedConfigFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -610,7 +610,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
char * tab4 = strchr( tab3 + 1, '\t');
|
char * tab4 = strchr( tab3 + 1, '\t');
|
||||||
if ( tab4 )
|
if ( tab4 )
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: too many tabs present, skipping: %s\n", buf );
|
GD_DPRINTF( "Warning: too many tabs present, skipping: %s\n", buf );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
if ( endEol )
|
if ( endEol )
|
||||||
*endEol = 0;
|
*endEol = 0;
|
||||||
|
|
||||||
DPRINTF( "DICT NAME: '%s'\n", eol );
|
GD_DPRINTF( "DICT NAME: '%s'\n", eol );
|
||||||
dictionaryName = eol;
|
dictionaryName = eol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -662,13 +662,13 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: only a single tab present, skipping: %s\n", buf );
|
GD_DPRINTF( "Warning: only a single tab present, skipping: %s\n", buf );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: no tabs present, skipping: %s\n", buf );
|
GD_DPRINTF( "Warning: no tabs present, skipping: %s\n", buf );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
dsl.cc
8
dsl.cc
|
@ -403,7 +403,7 @@ void DslDictionary::doDeferredInit()
|
||||||
memcpy( &total, abrvBlock, sizeof( uint32_t ) );
|
memcpy( &total, abrvBlock, sizeof( uint32_t ) );
|
||||||
abrvBlock += sizeof( uint32_t );
|
abrvBlock += sizeof( uint32_t );
|
||||||
|
|
||||||
DPRINTF( "Loading %u abbrv\n", total );
|
GD_DPRINTF( "Loading %u abbrv\n", total );
|
||||||
|
|
||||||
while( total-- )
|
while( total-- )
|
||||||
{
|
{
|
||||||
|
@ -532,7 +532,7 @@ void DslDictionary::loadArticle( uint32_t address,
|
||||||
memcpy( &articleSize, articleProps + sizeof( articleOffset ),
|
memcpy( &articleSize, articleProps + sizeof( articleOffset ),
|
||||||
sizeof( articleSize ) );
|
sizeof( articleSize ) );
|
||||||
|
|
||||||
DPRINTF( "offset = %x\n", articleOffset );
|
GD_DPRINTF( "offset = %x\n", articleOffset );
|
||||||
|
|
||||||
|
|
||||||
char * articleBody;
|
char * articleBody;
|
||||||
|
@ -1717,7 +1717,7 @@ void DslResourceRequest::run()
|
||||||
FsEncoding::separator() +
|
FsEncoding::separator() +
|
||||||
FsEncoding::encode( resourceName );
|
FsEncoding::encode( resourceName );
|
||||||
|
|
||||||
DPRINTF( "n is %s\n", n.c_str() );
|
GD_DPRINTF( "n is %s\n", n.c_str() );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -2264,7 +2264,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
|
|
||||||
if ( zipFileName.size() )
|
if ( zipFileName.size() )
|
||||||
{
|
{
|
||||||
DPRINTF( "Indexing zip file\n" );
|
GD_DPRINTF( "Indexing zip file\n" );
|
||||||
|
|
||||||
idxHeader.hasZipFile = 1;
|
idxHeader.hasZipFile = 1;
|
||||||
|
|
||||||
|
|
|
@ -463,7 +463,7 @@ ArticleDom::ArticleDom( wstring const & str, string const & dictName,
|
||||||
|
|
||||||
if ( stack.size() )
|
if ( stack.size() )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Warning: %u tags were unclosed.\n", (unsigned) stack.size() );
|
GD_FDPRINTF( stderr, "Warning: %u tags were unclosed.\n", (unsigned) stack.size() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -776,7 +776,7 @@ DslScanner::DslScanner( string const & fileName ) throw( Ex, Iconv::Ex ):
|
||||||
if ( !needExactEncoding )
|
if ( !needExactEncoding )
|
||||||
{
|
{
|
||||||
// We don't need that!
|
// We don't need that!
|
||||||
FDPRINTF( stderr, "Warning: encoding was specified in a Unicode file, ignoring.\n" );
|
GD_FDPRINTF( stderr, "Warning: encoding was specified in a Unicode file, ignoring.\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( !wcscasecmp( arg.c_str(), GD_NATIVE_TO_WS( L"Latin" ) ) )
|
if ( !wcscasecmp( arg.c_str(), GD_NATIVE_TO_WS( L"Latin" ) ) )
|
||||||
|
@ -1023,7 +1023,7 @@ void processUnsortedParts( wstring & str, bool strip )
|
||||||
|
|
||||||
if ( refCount < 0 )
|
if ( refCount < 0 )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Warning: an unmatched closing brace was encountered.\n" );
|
GD_FDPRINTF( stderr, "Warning: an unmatched closing brace was encountered.\n" );
|
||||||
refCount = 0;
|
refCount = 0;
|
||||||
// But we remove that thing either way
|
// But we remove that thing either way
|
||||||
str.erase( x, 1 );
|
str.erase( x, 1 );
|
||||||
|
@ -1052,7 +1052,7 @@ void processUnsortedParts( wstring & str, bool strip )
|
||||||
|
|
||||||
if ( strip && refCount )
|
if ( strip && refCount )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Warning: unclosed brace(s) encountered.\n" );
|
GD_FDPRINTF( stderr, "Warning: unclosed brace(s) encountered.\n" );
|
||||||
str.erase( startPos );
|
str.erase( startPos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ ExternalViewer::ExternalViewer( QObject * parent, vector< char > const & data,
|
||||||
|
|
||||||
tempFile.close();
|
tempFile.close();
|
||||||
|
|
||||||
DPRINTF( "%s\n", tempFile.fileName().toLocal8Bit().data() );
|
GD_DPRINTF( "%s\n", tempFile.fileName().toLocal8Bit().data() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExternalViewer::start() throw( exCantRunViewer )
|
void ExternalViewer::start() throw( exCantRunViewer )
|
||||||
|
|
4
forvo.cc
4
forvo.cc
|
@ -181,7 +181,7 @@ void ForvoArticleRequest::addQuery( QNetworkAccessManager & mgr,
|
||||||
|
|
||||||
void ForvoArticleRequest::requestFinished( QNetworkReply * r )
|
void ForvoArticleRequest::requestFinished( QNetworkReply * r )
|
||||||
{
|
{
|
||||||
DPRINTF( "Finished.\n" );
|
GD_DPRINTF( "Finished.\n" );
|
||||||
|
|
||||||
if ( isFinished() ) // Was cancelled
|
if ( isFinished() ) // Was cancelled
|
||||||
return;
|
return;
|
||||||
|
@ -350,7 +350,7 @@ void ForvoArticleRequest::requestFinished( QNetworkReply * r )
|
||||||
setErrorString( text );
|
setErrorString( text );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPRINTF( "done.\n" );
|
GD_DPRINTF( "done.\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
setErrorString( netReply->errorString() );
|
setErrorString( netReply->errorString() );
|
||||||
|
|
|
@ -355,7 +355,7 @@ void FullTextSearchDialog::searchReqFinished()
|
||||||
{
|
{
|
||||||
if ( (*it)->isFinished() )
|
if ( (*it)->isFinished() )
|
||||||
{
|
{
|
||||||
DPRINTF( "one finished.\n" );
|
GD_DPRINTF( "one finished.\n" );
|
||||||
|
|
||||||
QString errorString = (*it)->getErrorString();
|
QString errorString = (*it)->getErrorString();
|
||||||
|
|
||||||
|
@ -384,9 +384,9 @@ void FullTextSearchDialog::searchReqFinished()
|
||||||
}
|
}
|
||||||
if( it != searchReqs.end() )
|
if( it != searchReqs.end() )
|
||||||
{
|
{
|
||||||
DPRINTF( "erasing..\n" );
|
GD_DPRINTF( "erasing..\n" );
|
||||||
searchReqs.erase( it );
|
searchReqs.erase( it );
|
||||||
DPRINTF( "erase done..\n" );
|
GD_DPRINTF( "erase done..\n" );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#ifdef NO_CONSOLE
|
#ifdef NO_CONSOLE
|
||||||
#define DPRINTF(...)
|
#define GD_DPRINTF(...)
|
||||||
#define FDPRINTF(...)
|
#define GD_FDPRINTF(...)
|
||||||
#else
|
#else
|
||||||
#define DPRINTF(...) printf(__VA_ARGS__)
|
#define GD_DPRINTF(...) printf(__VA_ARGS__)
|
||||||
#define FDPRINTF(...) fprintf(__VA_ARGS__)
|
#define GD_FDPRINTF(...) fprintf(__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void gdWarning(const char *, ...) /* print warning message */
|
void gdWarning(const char *, ...) /* print warning message */
|
||||||
|
|
|
@ -502,7 +502,7 @@ QVector< wstring > HunspellHeadwordsRequest::suggest( wstring & word )
|
||||||
{
|
{
|
||||||
QString suggestion = gd::toQString( decodeFromHunspell( hunspell, suggestions[ x ] ) );
|
QString suggestion = gd::toQString( decodeFromHunspell( hunspell, suggestions[ x ] ) );
|
||||||
|
|
||||||
DPRINTF( ">>>Sugg: %s\n", suggestion.toLocal8Bit().data() );
|
GD_DPRINTF( ">>>Sugg: %s\n", suggestion.toLocal8Bit().data() );
|
||||||
|
|
||||||
if ( cutStem.indexIn( suggestion ) != -1 )
|
if ( cutStem.indexIn( suggestion ) != -1 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data )
|
||||||
|
|
||||||
if ( !ZipFile::readLocalHeader( zip, header ) )
|
if ( !ZipFile::readLocalHeader( zip, header ) )
|
||||||
{
|
{
|
||||||
DPRINTF( "Failed to load header\n" );
|
GD_DPRINTF( "Failed to load header\n" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,13 +68,13 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data )
|
||||||
switch( header.compressionMethod )
|
switch( header.compressionMethod )
|
||||||
{
|
{
|
||||||
case ZipFile::Uncompressed:
|
case ZipFile::Uncompressed:
|
||||||
DPRINTF( "Uncompressed\n" );
|
GD_DPRINTF( "Uncompressed\n" );
|
||||||
data.resize( header.uncompressedSize );
|
data.resize( header.uncompressedSize );
|
||||||
return (size_t) zip.read( &data.front(), data.size() ) == data.size();
|
return (size_t) zip.read( &data.front(), data.size() ) == data.size();
|
||||||
|
|
||||||
case ZipFile::Deflated:
|
case ZipFile::Deflated:
|
||||||
{
|
{
|
||||||
DPRINTF( "Deflated\n" );
|
GD_DPRINTF( "Deflated\n" );
|
||||||
|
|
||||||
// Now do the deflation
|
// Now do the deflation
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data )
|
||||||
|
|
||||||
if ( inflate( &stream, Z_FINISH ) != Z_STREAM_END )
|
if ( inflate( &stream, Z_FINISH ) != Z_STREAM_END )
|
||||||
{
|
{
|
||||||
DPRINTF( "Not zstream end!" );
|
GD_DPRINTF( "Not zstream end!" );
|
||||||
|
|
||||||
data.clear();
|
data.clear();
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,7 @@ void loadDictionaries( QWidget * parent, bool showInitially,
|
||||||
dictionaries.insert( dictionaries.end(), dicts.begin(), dicts.end() );
|
dictionaries.insert( dictionaries.end(), dicts.begin(), dicts.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF( "Load done\n" );
|
GD_DPRINTF( "Load done\n" );
|
||||||
|
|
||||||
// Remove any stale index files
|
// Remove any stale index files
|
||||||
|
|
||||||
|
|
6
lsa.cc
6
lsa.cc
|
@ -477,7 +477,7 @@ sptr< Dictionary::DataRequest > LsaDictionary::getResource( string const & name
|
||||||
|
|
||||||
if ( result > left )
|
if ( result > left )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Warning: Vorbis decode returned more data than requested.\n" );
|
GD_FDPRINTF( stderr, "Warning: Vorbis decode returned more data than requested.\n" );
|
||||||
|
|
||||||
result = left;
|
result = left;
|
||||||
}
|
}
|
||||||
|
@ -575,7 +575,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
/// XXX handle big-endian machines here!
|
/// XXX handle big-endian machines here!
|
||||||
uint32_t entriesCount = f.read< uint32_t >();
|
uint32_t entriesCount = f.read< uint32_t >();
|
||||||
|
|
||||||
DPRINTF( "%s: %u entries\n", i->c_str(), entriesCount );
|
GD_DPRINTF( "%s: %u entries\n", i->c_str(), entriesCount );
|
||||||
|
|
||||||
idxHeader.soundsCount = entriesCount;
|
idxHeader.soundsCount = entriesCount;
|
||||||
|
|
||||||
|
@ -591,7 +591,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
// Remove the extension, no need for that in the index
|
// Remove the extension, no need for that in the index
|
||||||
e.name = stripExtension( e.name );
|
e.name = stripExtension( e.name );
|
||||||
|
|
||||||
DPRINTF( "Read filename %s (%u at %u)<\n", e.name.c_str(), e.samplesLength, e.samplesOffset );
|
GD_DPRINTF( "Read filename %s (%u at %u)<\n", e.name.c_str(), e.samplesLength, e.samplesOffset );
|
||||||
|
|
||||||
// Insert new entry into an index
|
// Insert new entry into an index
|
||||||
|
|
||||||
|
|
|
@ -1612,7 +1612,7 @@ void MainWindow::ctrlReleased()
|
||||||
|
|
||||||
void MainWindow::backClicked()
|
void MainWindow::backClicked()
|
||||||
{
|
{
|
||||||
DPRINTF( "Back\n" );
|
GD_DPRINTF( "Back\n" );
|
||||||
|
|
||||||
ArticleView *view = getCurrentArticleView();
|
ArticleView *view = getCurrentArticleView();
|
||||||
|
|
||||||
|
@ -1621,7 +1621,7 @@ void MainWindow::backClicked()
|
||||||
|
|
||||||
void MainWindow::forwardClicked()
|
void MainWindow::forwardClicked()
|
||||||
{
|
{
|
||||||
DPRINTF( "Forward\n" );
|
GD_DPRINTF( "Forward\n" );
|
||||||
|
|
||||||
ArticleView *view = getCurrentArticleView();
|
ArticleView *view = getCurrentArticleView();
|
||||||
|
|
||||||
|
@ -2877,7 +2877,7 @@ void MainWindow::latestReleaseReplyReady()
|
||||||
// Failed -- reschedule to check in two hours
|
// Failed -- reschedule to check in two hours
|
||||||
newReleaseCheckTimer.start( 2 * 60 * 60 * 1000 );
|
newReleaseCheckTimer.start( 2 * 60 * 60 * 1000 );
|
||||||
|
|
||||||
DPRINTF( "Failed to check program version, retry in two hours\n" );
|
GD_DPRINTF( "Failed to check program version, retry in two hours\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2888,8 +2888,8 @@ void MainWindow::latestReleaseReplyReady()
|
||||||
|
|
||||||
Config::save( cfg );
|
Config::save( cfg );
|
||||||
|
|
||||||
DPRINTF( "Program version's check successful, current version is %ls\n",
|
GD_DPRINTF( "Program version's check successful, current version is %ls\n",
|
||||||
latestVersion.toStdWString().c_str() );
|
latestVersion.toStdWString().c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( success && latestVersion > PROGRAM_VERSION && latestVersion != cfg.skippedRelease )
|
if ( success && latestVersion > PROGRAM_VERSION && latestVersion != cfg.skippedRelease )
|
||||||
|
|
2
mdx.cc
2
mdx.cc
|
@ -1191,7 +1191,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
|
||||||
// Finish with the chunks
|
// Finish with the chunks
|
||||||
idxHeader.chunksOffset = chunks.finish();
|
idxHeader.chunksOffset = chunks.finish();
|
||||||
|
|
||||||
DPRINTF( "Writing index...\n" );
|
GD_DPRINTF( "Writing index...\n" );
|
||||||
|
|
||||||
// Good. Now build the index
|
// Good. Now build the index
|
||||||
IndexInfo idxInfo = BtreeIndexing::buildIndex( indexedWords, idx );
|
IndexInfo idxInfo = BtreeIndexing::buildIndex( indexedWords, idx );
|
||||||
|
|
12
mediawiki.cc
12
mediawiki.cc
|
@ -121,7 +121,7 @@ MediaWikiWordSearchRequest::MediaWikiWordSearchRequest( wstring const & str,
|
||||||
QNetworkAccessManager & mgr ):
|
QNetworkAccessManager & mgr ):
|
||||||
livedLongEnough( false ), isCancelling( false )
|
livedLongEnough( false ), isCancelling( false )
|
||||||
{
|
{
|
||||||
DPRINTF( "request begin\n" );
|
GD_DPRINTF( "request begin\n" );
|
||||||
QUrl reqUrl( url + "/api.php?action=query&list=allpages&aplimit=40&format=xml" );
|
QUrl reqUrl( url + "/api.php?action=query&list=allpages&aplimit=40&format=xml" );
|
||||||
|
|
||||||
reqUrl.addQueryItem( "apfrom", gd::toQString( str ) );
|
reqUrl.addQueryItem( "apfrom", gd::toQString( str ) );
|
||||||
|
@ -147,7 +147,7 @@ void MediaWikiWordSearchRequest::timerEvent( QTimerEvent * ev )
|
||||||
|
|
||||||
MediaWikiWordSearchRequest::~MediaWikiWordSearchRequest()
|
MediaWikiWordSearchRequest::~MediaWikiWordSearchRequest()
|
||||||
{
|
{
|
||||||
DPRINTF( "request end\n" );
|
GD_DPRINTF( "request end\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaWikiWordSearchRequest::cancel()
|
void MediaWikiWordSearchRequest::cancel()
|
||||||
|
@ -164,7 +164,7 @@ void MediaWikiWordSearchRequest::cancel()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF("not long enough\n" );
|
GD_DPRINTF("not long enough\n" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ void MediaWikiWordSearchRequest::downloadFinished()
|
||||||
matches.push_back( gd::toWString( nl.item( x ).toElement().attribute( "title" ) ) );
|
matches.push_back( gd::toWString( nl.item( x ).toElement().attribute( "title" ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPRINTF( "done.\n" );
|
GD_DPRINTF( "done.\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
setErrorString( netReply->errorString() );
|
setErrorString( netReply->errorString() );
|
||||||
|
@ -267,7 +267,7 @@ void MediaWikiArticleRequest::addQuery( QNetworkAccessManager & mgr,
|
||||||
|
|
||||||
void MediaWikiArticleRequest::requestFinished( QNetworkReply * r )
|
void MediaWikiArticleRequest::requestFinished( QNetworkReply * r )
|
||||||
{
|
{
|
||||||
DPRINTF( "Finished.\n" );
|
GD_DPRINTF( "Finished.\n" );
|
||||||
|
|
||||||
if ( isFinished() ) // Was cancelled
|
if ( isFinished() ) // Was cancelled
|
||||||
return;
|
return;
|
||||||
|
@ -379,7 +379,7 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPRINTF( "done.\n" );
|
GD_DPRINTF( "done.\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
setErrorString( netReply->errorString() );
|
setErrorString( netReply->errorString() );
|
||||||
|
|
|
@ -328,7 +328,7 @@ void ScanPopup::editGroupRequested()
|
||||||
|
|
||||||
void ScanPopup::translateWordFromClipboard(QClipboard::Mode m)
|
void ScanPopup::translateWordFromClipboard(QClipboard::Mode m)
|
||||||
{
|
{
|
||||||
DPRINTF( "translating from clipboard or selection\n" );
|
GD_DPRINTF( "translating from clipboard or selection\n" );
|
||||||
|
|
||||||
QString subtype = "plain";
|
QString subtype = "plain";
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ void ScanPopup::clipboardChanged( QClipboard::Mode m )
|
||||||
if ( !isScanningEnabled )
|
if ( !isScanningEnabled )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DPRINTF( "clipboard changed\n" );
|
GD_DPRINTF( "clipboard changed\n" );
|
||||||
|
|
||||||
QString subtype = "plain";
|
QString subtype = "plain";
|
||||||
|
|
||||||
|
|
20
stardict.cc
20
stardict.cc
|
@ -1136,7 +1136,7 @@ void StardictResourceRequest::run()
|
||||||
FsEncoding::separator() +
|
FsEncoding::separator() +
|
||||||
FsEncoding::encode( resourceName );
|
FsEncoding::encode( resourceName );
|
||||||
|
|
||||||
DPRINTF( "n is %s\n", n.c_str() );
|
GD_DPRINTF( "n is %s\n", n.c_str() );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1310,7 +1310,7 @@ static void handleIdxSynFile( string const & fileName,
|
||||||
sizeof( uint32_t ) * 2 ) >
|
sizeof( uint32_t ) * 2 ) >
|
||||||
&image.back() )
|
&image.back() )
|
||||||
{
|
{
|
||||||
FDPRINTF( stderr, "Warning: sudden end of file %s\n", fileName.c_str() );
|
GD_FDPRINTF( stderr, "Warning: sudden end of file %s\n", fileName.c_str() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1392,7 +1392,7 @@ static void handleIdxSynFile( string const & fileName,
|
||||||
indexedWords.addWord( Utf8::decode( word ), offset );
|
indexedWords.addWord( Utf8::decode( word ), offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF( "%u entires made\n", (unsigned) indexedWords.size() );
|
GD_DPRINTF( "%u entires made\n", (unsigned) indexedWords.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1460,21 +1460,21 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
{
|
{
|
||||||
if ( ifo.synwordcount )
|
if ( ifo.synwordcount )
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: dictionary has synwordcount specified, but no "
|
GD_DPRINTF( "Warning: dictionary has synwordcount specified, but no "
|
||||||
"corresponding .syn file was found\n" );
|
"corresponding .syn file was found\n" );
|
||||||
ifo.synwordcount = 0; // Pretend it wasn't there
|
ifo.synwordcount = 0; // Pretend it wasn't there
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ( !ifo.synwordcount )
|
if ( !ifo.synwordcount )
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: ignoring .syn file %s, since there's no synwordcount in .ifo specified\n",
|
GD_DPRINTF( "Warning: ignoring .syn file %s, since there's no synwordcount in .ifo specified\n",
|
||||||
synFileName.c_str() );
|
synFileName.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DPRINTF( "bookname = %s\n", ifo.bookname.c_str() );
|
GD_DPRINTF( "bookname = %s\n", ifo.bookname.c_str() );
|
||||||
DPRINTF( "wordcount = %u\n", ifo.wordcount );
|
GD_DPRINTF( "wordcount = %u\n", ifo.wordcount );
|
||||||
|
|
||||||
initializing.indexingDictionary( ifo.bookname );
|
initializing.indexingDictionary( ifo.bookname );
|
||||||
|
|
||||||
|
@ -1551,7 +1551,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
|
|
||||||
if ( zipFileName.size() )
|
if ( zipFileName.size() )
|
||||||
{
|
{
|
||||||
DPRINTF( "Indexing zip file\n" );
|
GD_DPRINTF( "Indexing zip file\n" );
|
||||||
|
|
||||||
idxHeader.hasZipFile = 1;
|
idxHeader.hasZipFile = 1;
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ sptr< Dictionary::WordSearchRequest > TransliterationDictionary::findHeadwordsFo
|
||||||
|
|
||||||
vector< wstring > alts = getAlternateWritings( str );
|
vector< wstring > alts = getAlternateWritings( str );
|
||||||
|
|
||||||
DPRINTF( "alts = %u\n", (unsigned) alts.size() );
|
GD_DPRINTF( "alts = %u\n", (unsigned) alts.size() );
|
||||||
|
|
||||||
for( unsigned x = 0; x < alts.size(); ++x )
|
for( unsigned x = 0; x < alts.size(); ++x )
|
||||||
result->getMatches().push_back( alts[ x ] );
|
result->getMatches().push_back( alts[ x ] );
|
||||||
|
|
|
@ -49,14 +49,14 @@ BSTR bstr;
|
||||||
RECT r = { 0, 0, 0, 0 };
|
RECT r = { 0, 0, 0, 0 };
|
||||||
bool bGoUp;
|
bool bGoUp;
|
||||||
|
|
||||||
DPRINTF("\nEntering getWordAtPoint\n");
|
GD_DPRINTF("\nEntering getWordAtPoint\n");
|
||||||
|
|
||||||
if( pGDAutomation == NULL ) return false;
|
if( pGDAutomation == NULL ) return false;
|
||||||
|
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
pElement = NULL;
|
pElement = NULL;
|
||||||
hr = pGDAutomation->ElementFromPoint( pt, &pElement );
|
hr = pGDAutomation->ElementFromPoint( pt, &pElement );
|
||||||
DPRINTF("ElementFromPoint return hr=%08lX, ptr=%p\n", hr, pElement);
|
GD_DPRINTF("ElementFromPoint return hr=%08lX, ptr=%p\n", hr, pElement);
|
||||||
if( hr != S_OK || pElement == NULL )
|
if( hr != S_OK || pElement == NULL )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
8
xdxf.cc
8
xdxf.cc
|
@ -1008,7 +1008,7 @@ void XdxfResourceRequest::run()
|
||||||
FsEncoding::separator() +
|
FsEncoding::separator() +
|
||||||
FsEncoding::encode( resourceName );
|
FsEncoding::encode( resourceName );
|
||||||
|
|
||||||
DPRINTF( "n is %s\n", n.c_str() );
|
GD_DPRINTF( "n is %s\n", n.c_str() );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1243,7 +1243,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: duplicate full_name in %s\n", dictFiles[ 0 ].c_str() );
|
GD_DPRINTF( "Warning: duplicate full_name in %s\n", dictFiles[ 0 ].c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1265,7 +1265,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTF( "Warning: duplicate description in %s\n", dictFiles[ 0 ].c_str() );
|
GD_DPRINTF( "Warning: duplicate description in %s\n", dictFiles[ 0 ].c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1376,7 +1376,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries(
|
||||||
|
|
||||||
if ( zipFileName.size() )
|
if ( zipFileName.size() )
|
||||||
{
|
{
|
||||||
DPRINTF( "Indexing zip file\n" );
|
GD_DPRINTF( "Indexing zip file\n" );
|
||||||
|
|
||||||
idxHeader.hasZipFile = 1;
|
idxHeader.hasZipFile = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue