void *download_thread_f(gpointer data) { Installer* inst = (Installer*) data; std::vector<Job*>& jobs = inst->GetJobs(); try { for (size_t i = 0; i < jobs.size(); i++) { Job *j = jobs.at(i); inst->SetCurrentJob(j); j->Fetch(); } } catch (std::exception& e) { std::string message = e.what(); inst->SetError(message); inst->SetRunning(false); } catch (std::string& e) { inst->SetError(e); inst->SetRunning(false); } catch (...) { std::string message = "Unknown error"; inst->SetError(message); inst->SetRunning(false); } inst->DownloadDone(); return NULL; }
void *download_thread_f(gpointer data) { Installer* inst = (Installer*) data; std::vector<Job*>& jobs = inst->GetJobs(); try { for (size_t i = 0; i < jobs.size(); i++) { Job *j = jobs.at(i); inst->SetCurrentJob(j); j->Fetch(); // Wait for an unzip job to finish before actually cancelling if (Installer::instance->GetStage() == Installer::CANCEL_REQUEST) { Installer::instance->SetStage(Installer::CANCELLED); return NULL; } } } catch (std::exception& e) { std::string message = e.what(); inst->SetError(message); return NULL; } catch (std::string& e) { inst->SetError(e); return NULL; } catch (...) { std::string message = "Unknown error"; inst->SetError(message); return NULL; } inst->SetStage(Installer::PREINSTALL); return NULL; }