From dcc62050e3cb6174a556a81ced3b084b9067fbbe Mon Sep 17 00:00:00 2001 From: Tvangeste Date: Tue, 11 Jun 2013 21:31:58 +0200 Subject: [PATCH] Refactoring the edit dictionary functionality a bit --- mainwindow.cc | 9 +++------ mainwindow.hh | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mainwindow.cc b/mainwindow.cc index e7cd2c10..5aa134df 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -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 ); } } } diff --git a/mainwindow.hh b/mainwindow.hh index 500d6028..c81e6ee5 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -245,7 +245,7 @@ private slots: void openDictionaryFolder( QString const & id ); - void editDictionary ( sptr< Dictionary::Class > dict ); + void editDictionary ( Dictionary::Class * dict ); private slots: