Extract cloud bulk upload loop helper
This commit is contained in:
@@ -218,6 +218,23 @@ std::shared_ptr<NodeProgressBar> create_cloud_bulk_upload_progress(
|
||||
return app.show_progress(progress_plan.title, progress_plan.total);
|
||||
}
|
||||
|
||||
void execute_cloud_bulk_upload_files(
|
||||
App& app,
|
||||
const std::vector<std::string>& names,
|
||||
const std::shared_ptr<NodeProgressBar>& bulk_progress)
|
||||
{
|
||||
[[maybe_unused]] gl_state gl;
|
||||
for (const auto& n : names)
|
||||
{
|
||||
std::string path = app.data_path + "/" + n;
|
||||
execute_cloud_upload_transfer(app, path, std::string(), std::function<void(float)> {});
|
||||
|
||||
if (bulk_progress) {
|
||||
bulk_progress->increment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void close_cloud_bulk_upload_progress(std::shared_ptr<NodeProgressBar>& progress)
|
||||
{
|
||||
if (progress) {
|
||||
@@ -275,16 +292,7 @@ public:
|
||||
void upload_all_bulk_files() override
|
||||
{
|
||||
auto names = Asset::list_files(app_.data_path, ".*\\.ppi");
|
||||
[[maybe_unused]] gl_state gl;
|
||||
for (const auto& n : names)
|
||||
{
|
||||
std::string path = app_.data_path + "/" + n;
|
||||
execute_cloud_upload_transfer(app_, path, std::string(), std::function<void(float)> {});
|
||||
|
||||
if (bulk_progress_) {
|
||||
bulk_progress_->increment();
|
||||
}
|
||||
}
|
||||
execute_cloud_bulk_upload_files(app_, names, bulk_progress_);
|
||||
}
|
||||
|
||||
void end_bulk_upload() override
|
||||
|
||||
Reference in New Issue
Block a user