mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Refactoring the edit dictionary functionality a bit
This commit is contained in:
parent
9ed26287b2
commit
dcc62050e3
|
@ -3457,7 +3457,7 @@ void MainWindow::showDictionaryInfo( const QString & id )
|
|||
}
|
||||
else if ( result == DictInfo::EDIT_DICTIONARY)
|
||||
{
|
||||
editDictionary( dictionaries[x] );
|
||||
editDictionary( dictionaries[x].get() );
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -3465,7 +3465,7 @@ void MainWindow::showDictionaryInfo( const QString & id )
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::editDictionary( sptr< Dictionary::Class > dict )
|
||||
void MainWindow::editDictionary( Dictionary::Class * dict )
|
||||
{
|
||||
QString dictFilename = dict->getMainFilename();
|
||||
if( !cfg.editDictionaryCommandLine.isEmpty() && !dictFilename.isEmpty() )
|
||||
|
@ -3592,10 +3592,7 @@ void MainWindow::foundDictsContextMenuRequested( const QPoint &pos )
|
|||
else
|
||||
if( result && result == editAction )
|
||||
{
|
||||
QString command( cfg.editDictionaryCommandLine );
|
||||
command.replace( "%GDDICT%", "\"" + dictFilename + "\"" );
|
||||
if( !QProcess::startDetached( command ) )
|
||||
QApplication::beep();
|
||||
editDictionary( pDict );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ private slots:
|
|||
|
||||
void openDictionaryFolder( QString const & id );
|
||||
|
||||
void editDictionary ( sptr< Dictionary::Class > dict );
|
||||
void editDictionary ( Dictionary::Class * dict );
|
||||
|
||||
private slots:
|
||||
|
||||
|
|
Loading…
Reference in a new issue