Skip to content

Commit

Permalink
clean: don't reinvent fileName(); (xiaoyifang#2138)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlebantongying authored Feb 9, 2025
1 parent 1c2d6c4 commit d083fe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/dict/slob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,7 @@ SlobDictionary::SlobDictionary( string const & id, string const & indexFile, vec

dictionaryName = sf.getDictionaryName().toStdString();
if ( dictionaryName.empty() ) {
QString name = QDir::fromNativeSeparators( dictionaryFiles[ 0 ].c_str() );
auto n = name.lastIndexOf( '/' );
dictionaryName = name.mid( n + 1 ).toStdString();
dictionaryName = QFileInfo( QString::fromStdString( dictionaryFiles[ 0 ] ) ).fileName().toStdString();
}

// Full-text search parameters
Expand Down
4 changes: 1 addition & 3 deletions src/dict/zim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ ZimDictionary::ZimDictionary( string const & id, string const & indexFile, vecto

dictionaryName = df.getMetadata( "Title" );
if ( dictionaryName.empty() ) {
QString name = QDir::fromNativeSeparators( dictionaryFiles[ 0 ].c_str() );
int n = name.lastIndexOf( '/' );
dictionaryName = name.mid( n + 1 ).toStdString();
dictionaryName = QFileInfo( QString::fromStdString( dictionaryFiles[ 0 ] ) ).fileName().toStdString();
}

// Full-text search parameters
Expand Down

0 comments on commit d083fe2

Please sign in to comment.