Esempio n. 1
0
void SamView::addTestConfiguration()
{
  TestConfigurationWidget *config(0) ;
  if(getBackendType() == TestConfigurationWidget::SPHINX)
    config = new SphinxTestConfigurationWidget(this);
  else if(getBackendType() == TestConfigurationWidget::JHTK)
    config = new JuliusTestConfigurationWidget(this);

  addTestConfiguration(config);
}
Esempio n. 2
0
bool SSProfile::isValid() const
{
    QFile backendFile(backend);
    bool valid = SSValidator::validatePort(server_port) && SSValidator::validatePort(local_port) && SSValidator::validateMethod(method);
    valid = valid && (backendFile.exists() || getBackendType() == SSProfile::LIBQSS);

    if (server.isEmpty() || local_addr.isEmpty() || timeout.toInt() < 1 || !valid) {
        return false;
    }
    else {
        return true;
    }
}
Esempio n. 3
0
bool SSProfile::isBackendMatchType()
{
    QFile file(backend);
    if (!file.exists()) {
        if (getBackendType() == SSProfile::LIBQSS && backend.isEmpty()) {
            return true;
        }
        qWarning() << "Backend does not exist. You can safely ignore this message if you're changing the backend type.";
        return false;
    }

    file.open(QIODevice::ReadOnly | QIODevice::Text);
    if (!file.isReadable() || !file.isOpen()) {
        qWarning() << "Cannot read from backend.";
        return false;
    }

    SSProfile::BackendType rType;
    QString ident(file.readLine());
    file.close();
    if (ident.contains("node")) {
        rType = NODEJS;
    }
    else if (ident.contains("python")) {
        rType = PYTHON;
    }
    else {
        if (backend.contains("ss-local")) {
            rType = LIBEV;//libev
        }
        else {
            rType = GO;//Go
        }
    }

    return (rType == this->getBackendType());
}