예제 #1
0
void Updater::PerformUpdateStep()
{
  // Wait until the download is done
  while (_downloadManager->hasPendingDownloads())
  {
    // For catching terminations
    _downloadManager->process();

    if (_downloadManager->HasFailedDownloads())
    {
      // Lets continue downloading. Fetch as much as we can.
    }

    notifyDownloadProgress();
    NotifyFullUpdateProgress();
    Util::Wait(100);
  }

  Logger::warning("Downloading finished");

  if (_downloadManager->HasFailedDownloads())
  {
    Logger::warning("Some downloads failed. Check log above for details.");
  }

  if (_downloadProgressCallback.isValid())
  {
    _downloadProgressCallback->onDownloadFinish();
  }
}
예제 #2
0
void Updater::downloadSingleFile(const DownloadPtr& download)
{
  int downloadId = _downloadManager->add(download);

  while( _downloadManager->hasPendingDownloads() )
  {
    _downloadManager->process();

    notifyDownloadProgress();

    for (int i = 0; i < 50; ++i)
        Util::Wait(10);
  }

  if( _downloadProgressCallback.isValid() )
  {
    _downloadProgressCallback->onDownloadFinish();
  }

  _downloadManager->remove(downloadId);
}
	void Java_com_fennex_modules_ExpansionSupport_notifyDownloadProgress(JNIEnv* env, jobject thiz, jfloat percent, jlong totalSize)
	{
		notifyDownloadProgress((float) percent, (long) totalSize);
	}