src/mainwindow.cpp
/**
 * @brief MainWindow::on_localModels_activated Change the loaded translation model to something else.
 * @param index index of the selected item in the localModels combobox.
 */
@brief MainWindow::on_localModels_activated Change the loaded translation model to something else.
@param index index of the selected item in the localModels combobox.
@brief MainWindow :: on_localModels_activated Change the loaded translation model to something else . @param index index of the selected item in the localModels combobox .
void MainWindow::on_localModels_activated(int index) {
    QVariant data = ui_->localModels->itemData(index);
    if (data.canConvert<Model>() && data.value<Model>().isLocal()) {
        settings_.translationModel.setValue(data.value<Model>().path);
    } else if (data.canConvert<Model>()) {
        downloadModel(data.value<Model>());
    } else if (data == Action::FetchRemoteModels) {
        models_.fetchRemoteModels();
    } else {
        qDebug() << "Unknown option: " << data;
    }
}
void MainWindow :: on_localModels_activated ( int index ) { QVariant data = ui_ -> localModels -> itemData ( index ) ; if ( data . canConvert < Model > ( ) && data . value < Model > ( ) . isLocal ( ) ) { settings_ . translationModel . setValue ( data . value < Model > ( ) . path ) ; } else if ( data . canConvert < Model > ( ) ) { downloadModel ( data . value < Model > ( ) ) ; } else if ( data == Action :: FetchRemoteModels ) { models_ . fetchRemoteModels ( ) ; } else { qDebug ( ) << " " << data ; } }
@brief MainWindow::on_localModels_activated Change the loaded translation model to something else.
@brief MainWindow :: on_localModels_activated Change the loaded translation model to something else .