remove if 0 dead code

This commit is contained in:
xiaoyifang 2021-11-17 22:19:32 +08:00
parent 857850bbf8
commit e07e0ec314
4 changed files with 1 additions and 97 deletions

View file

@ -358,11 +358,6 @@ bgl_entry Babylon::readEntry( ResourceHandler * resourceHandler )
resourceHandler->handleBabylonResource( filename, resourceHandler->handleBabylonResource( filename,
block.data + pos, block.data + pos,
block.length - pos ); block.length - pos );
#if 0
FILE *ifile = gd_fopen(filename.c_str(), "w");
fwrite(block.data + pos, 1, block.length -pos, ifile);
fclose(ifile);
#endif
break; break;
} }
case 1: case 1:

View file

@ -676,30 +676,6 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target,
} }
} }
#if 0
DPRINTF( "The winner is %s, compareResult = %d\n", closestString, compareResult );
if ( closestString != ptr )
{
char const * left = closestString -1;
while( left != ptr && left[ -1 ] )
--left;
DPRINTF( "To the left: %s\n", left );
}
else
DPRINTF( "To the lest -- nothing\n" );
char const * right = closestString + strlen( closestString ) + 1;
if ( right != leafEnd )
{
DPRINTF( "To the right: %s\n", right );
}
else
DPRINTF( "To the right -- nothing\n" );
#endif
// Now, whatever the outcome (compareResult) is, we need to find // Now, whatever the outcome (compareResult) is, we need to find
// entry number for the closestMatch string. // entry number for the closestMatch string.

44
dsl.cc
View file

@ -215,13 +215,7 @@ public:
inline virtual string getResourceDir2() const inline virtual string getResourceDir2() const
{ return resourceDir2; } { return resourceDir2; }
#if 0
virtual vector< wstring > findHeadwordsForSynonym( wstring const & )
THROW_SPEC( std::exception )
{
return vector< wstring >();
}
#endif
virtual sptr< Dictionary::DataRequest > getArticle( wstring const &, virtual sptr< Dictionary::DataRequest > getArticle( wstring const &,
vector< wstring > const & alts, vector< wstring > const & alts,
@ -2005,42 +1999,6 @@ sptr< Dictionary::DataRequest > DslDictionary::getResource( string const & name
return new DslResourceRequest( *this, name ); return new DslResourceRequest( *this, name );
} }
#if 0
static void findCorrespondingFiles( string const & ifo,
string & idx, string & dict, string & syn,
bool needSyn )
{
string base( ifo, 0, ifo.size() - 3 );
if ( !(
tryPossibleName( base + "idx", idx ) ||
tryPossibleName( base + "idx.gz", idx ) ||
tryPossibleName( base + "idx.dz", idx ) ||
tryPossibleName( base + "IDX", idx ) ||
tryPossibleName( base + "IDX.GZ", idx ) ||
tryPossibleName( base + "IDX.DZ", idx )
) )
throw exNoIdxFile( ifo );
if ( !(
tryPossibleName( base + "dict", dict ) ||
tryPossibleName( base + "dict.dz", dict ) ||
tryPossibleName( base + "DICT", dict ) ||
tryPossibleName( base + "dict.DZ", dict )
) )
throw exNoDictFile( ifo );
if ( needSyn && !(
tryPossibleName( base + "syn", syn ) ||
tryPossibleName( base + "syn.gz", syn ) ||
tryPossibleName( base + "syn.dz", syn ) ||
tryPossibleName( base + "SYN", syn ) ||
tryPossibleName( base + "SYN.GZ", syn ) ||
tryPossibleName( base + "SYN.DZ", syn )
) )
throw exNoSynFile( ifo );
}
#endif
sptr< Dictionary::DataRequest > DslDictionary::getSearchResults( QString const & searchString, sptr< Dictionary::DataRequest > DslDictionary::getSearchResults( QString const & searchString,
int searchMode, bool matchCase, int searchMode, bool matchCase,

View file

@ -95,31 +95,6 @@ void ForvoDictionary::loadIcon() throw()
if ( dictionaryIconLoaded ) if ( dictionaryIconLoaded )
return; return;
// Experimental code to generate icon -- but the flags clutter the interface too
// much and we're better with a single icon.
#if 0
if ( languageCode.size() == 2 )
{
QString countryCode = Language::countryCodeForId( LangCoder::code2toInt( languageCode.toLatin1().data() ) );
if ( countryCode.size() )
{
QImage flag( QString( ":/flags/%1.png" ).arg( countryCode.toLower() ) );
if ( !flag.isNull() )
{
QImage img( ":/icons/forvo_icon_base.png" );
{
QPainter painter( &img );
painter.drawImage( QPoint( 5, 7 ), flag );
}
return QIcon( QPixmap::fromImage( img ) );
}
}
}
#endif
dictionaryIcon = dictionaryNativeIcon = QIcon( ":/icons/forvo.png" ); dictionaryIcon = dictionaryNativeIcon = QIcon( ":/icons/forvo.png" );
dictionaryIconLoaded = true; dictionaryIconLoaded = true;
} }