Merge pull request #1854 from xiaoyifang/opt/clean-unused-parameter

opt: remove unused parameter
This commit is contained in:
xiaoyifang 2024-10-23 08:23:58 +08:00 committed by GitHub
commit 3e16a0cccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 3 additions and 12 deletions

View file

@ -456,7 +456,7 @@ string StardictDictionary::handleResource( char type, char const * resource, siz
// See "Type identifiers" at http://www.huzheng.org/stardict/StarDictFileFormat // See "Type identifiers" at http://www.huzheng.org/stardict/StarDictFileFormat
switch ( type ) { switch ( type ) {
case 'x': // Xdxf content case 'x': // Xdxf content
return Xdxf2Html::convert( string( resource, size ), Xdxf2Html::STARDICT, NULL, this, &resourceZip ); return Xdxf2Html::convert( string( resource, size ), Xdxf2Html::STARDICT, NULL, this );
case 'h': // Html content case 'h': // Html content
{ {
QString articleText = QString( "<div class=\"sdct_h\">" ) + QString::fromUtf8( resource, size ) + "</div>"; QString articleText = QString( "<div class=\"sdct_h\">" ) + QString::fromUtf8( resource, size ) + "</div>";

View file

@ -633,7 +633,6 @@ void XdxfDictionary::loadArticle( uint32_t address, string & articleText, QStrin
Xdxf2Html::XDXF, Xdxf2Html::XDXF,
idxHeader.hasAbrv ? &abrv : NULL, idxHeader.hasAbrv ? &abrv : NULL,
this, this,
&resourceZip,
fType == Logical, fType == Logical,
idxHeader.revisionNumber, idxHeader.revisionNumber,
headword ); headword );

View file

@ -70,7 +70,6 @@ string convert( string const & in,
DICT_TYPE type, DICT_TYPE type,
map< string, string > const * pAbrv, map< string, string > const * pAbrv,
Dictionary::Class * dictPtr, Dictionary::Class * dictPtr,
IndexedZip * resourceZip,
bool isLogicalFormat, bool isLogicalFormat,
unsigned revisionNumber, unsigned revisionNumber,
QString * headword ) QString * headword )

View file

@ -27,7 +27,6 @@ string convert( string const &,
DICT_TYPE type, DICT_TYPE type,
map< string, string > const * pAbrv, map< string, string > const * pAbrv,
Dictionary::Class * dictPtr, Dictionary::Class * dictPtr,
IndexedZip * resourceZip,
bool isLogicalFormat = false, bool isLogicalFormat = false,
unsigned revisionNumber = 0, unsigned revisionNumber = 0,
QString * headword = 0 ); QString * headword = 0 );

View file

@ -1141,11 +1141,6 @@ void ArticleView::openLink( QUrl const & url, QUrl const & ref, QString const &
} }
ResourceToSaveHandler * ArticleView::saveResource( const QUrl & url, const QString & fileName ) ResourceToSaveHandler * ArticleView::saveResource( const QUrl & url, const QString & fileName )
{
return saveResource( url, webview->url(), fileName );
}
ResourceToSaveHandler * ArticleView::saveResource( const QUrl & url, const QUrl & ref, const QString & fileName )
{ {
ResourceToSaveHandler * handler = new ResourceToSaveHandler( this, fileName ); ResourceToSaveHandler * handler = new ResourceToSaveHandler( this, fileName );
sptr< Dictionary::DataRequest > req; sptr< Dictionary::DataRequest > req;
@ -1659,7 +1654,7 @@ void ArticleView::contextMenuRequested( QPoint const & pos )
if ( !fileName.isEmpty() ) { if ( !fileName.isEmpty() ) {
QFileInfo fileInfo( fileName ); QFileInfo fileInfo( fileName );
emit storeResourceSavePath( QDir::toNativeSeparators( fileInfo.absoluteDir().absolutePath() ) ); emit storeResourceSavePath( QDir::toNativeSeparators( fileInfo.absoluteDir().absolutePath() ) );
saveResource( url, webview->url(), fileName ); saveResource( url, fileName );
} }
} }
else if ( result == openImageAction ) { else if ( result == openImageAction ) {
@ -1682,7 +1677,7 @@ void ArticleView::contextMenuRequested( QPoint const & pos )
if ( !fileName.isEmpty() ) { if ( !fileName.isEmpty() ) {
QFileInfo fileInfo( fileName ); QFileInfo fileInfo( fileName );
auto handler = saveResource( url, webview->url(), fileName ); auto handler = saveResource( url, fileName );
if ( !handler->isEmpty() ) { if ( !handler->isEmpty() ) {
connect( handler, &ResourceToSaveHandler::done, this, [ fileName ]() { connect( handler, &ResourceToSaveHandler::done, this, [ fileName ]() {

View file

@ -248,7 +248,6 @@ public:
void setActiveArticleId( QString const & ); void setActiveArticleId( QString const & );
ResourceToSaveHandler * saveResource( const QUrl & url, const QString & fileName ); ResourceToSaveHandler * saveResource( const QUrl & url, const QString & fileName );
ResourceToSaveHandler * saveResource( const QUrl & url, const QUrl & ref, const QString & fileName );
void findText( QString & text, void findText( QString & text,
const QWebEnginePage::FindFlags & f, const QWebEnginePage::FindFlags & f,