예제 #1
0
void ConfigCenter::commit()
{
  m_root.dir.pkgData = trim(m_root.dir.pkgData);
  for(StringVector::size_type i = 0;i < m_root.os.transactReadAhead.size();i++)
    m_root.os.transactReadAhead[i] = trim(m_root.os.transactReadAhead[i]);
  for(ConfProvideVector::size_type i = 0;i < m_root.provide.size();i++)
    {
      ConfProvide& provide = m_root.provide[i];
      provide.name = trim(provide.name);
      for(StringVector::size_type k = 0;k < provide.providers.size();k++)
	provide.providers[k] = trim(provide.providers[k]);
    }
  for(ConfRepoVector::size_type i = 0;i < m_root.repo.size();i++)
    {
      ConfRepo& repo = m_root.repo[i];
      repo.name = trim(repo.name);
      repo.url = trim(repo.url);
      repo.vendor = trim(repo.vendor);
      for(StringVector::size_type k = 0;k < repo.arch.size();k++)
	repo.arch[k] = trim(repo.arch[k]);
      for(StringVector::size_type k = 0;k < repo.components.size();k++)
	repo.components[k] = trim(repo.components[k]);
    }
  ConfigAdapter::checkValues();
  for(StringValueVector::size_type i = 0;i < m_stringValues.size();i++)
    if (m_stringValues[i].path.size() == 2 &&
	m_stringValues[i].path[0] == "repo" &&
	m_stringValues[i].path[1] == "url" &&
	!checkUrl(*m_stringValues[i].value))
      throwConfigException(ConfigException::InvalidUrl, m_stringValues[i]);
}
예제 #2
0
파일: videofile.cpp 프로젝트: boddicheg/rgl
void VideoFile::start() {
    if (isMovieExist() || checkUrl()) {
        m_file = cv::VideoCapture(m_videoFileName);
        emit initiated();
    } else {
        throw std::logic_error("Something wrong with this capture source");
    }
}
예제 #3
0
void QImageGrabberMjpeg::setSource(QString str)
{
    QUrl checkUrl(str);
    if (checkUrl.isValid()) {
        currentUrl = checkUrl;
    } else {
        qWarning() << "invalid URL:" << str;
    }
}