diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-20 21:03:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-20 21:03:21 +0100 |
| commit | afa2982b4b62dfb7fb5612b99e1c33f453866255 (patch) | |
| tree | be8af4ea19ab67dec83ca7e80eaa870ccd6956eb | |
| parent | f3848d724f0d193b09fea26138fa38f4a3fd321c (diff) | |
White space: copy_to_drive_job.{cc,h}
| -rw-r--r-- | src/lib/copy_to_drive_job.cc | 24 | ||||
| -rw-r--r-- | src/lib/copy_to_drive_job.h | 14 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/copy_to_drive_job.cc b/src/lib/copy_to_drive_job.cc index bd46ba469..253f438f6 100644 --- a/src/lib/copy_to_drive_job.cc +++ b/src/lib/copy_to_drive_job.cc @@ -42,17 +42,17 @@ using boost::optional; CopyToDriveJob::CopyToDriveJob(std::vector<boost::filesystem::path> const& dcps, Drive drive, Nanomsg& nanomsg) - : Job (shared_ptr<Film>()) - , _dcps (dcps) - , _drive (drive) - , _nanomsg (nanomsg) + : Job(shared_ptr<Film>()) + , _dcps(dcps) + , _drive(drive) + , _nanomsg(nanomsg) { } string -CopyToDriveJob::name () const +CopyToDriveJob::name() const { if (_dcps.size() == 1) { return fmt::format(_("Copying {}\nto {}"), _dcps[0].filename().string(), _drive.description()); @@ -63,13 +63,13 @@ CopyToDriveJob::name () const string -CopyToDriveJob::json_name () const +CopyToDriveJob::json_name() const { return N_("copy"); } void -CopyToDriveJob::run () +CopyToDriveJob::run() { LOG_DISK("Sending write requests to disk {} for:", _drive.device()); for (auto dcp: _dcps) { @@ -83,7 +83,7 @@ CopyToDriveJob::run () request += "\n"; if (!_nanomsg.send(request, 2000)) { LOG_DISK("Failed to send write request."); - throw CommunicationFailedError (); + throw CommunicationFailedError(); } enum State { @@ -101,7 +101,7 @@ CopyToDriveJob::run () switch (response->type()) { case DiskWriterBackEndResponse::Type::OK: - set_state (FINISHED_OK); + set_state(FINISHED_OK); return; case DiskWriterBackEndResponse::Type::PONG: break; @@ -109,21 +109,21 @@ CopyToDriveJob::run () throw CopyError(response->error_message(), response->ext4_error_number(), response->platform_error_number()); case DiskWriterBackEndResponse::Type::FORMAT_PROGRESS: if (state == SETUP) { - sub (_("Formatting drive")); + sub(_("Formatting drive")); state = FORMAT; } set_progress(response->progress()); break; case DiskWriterBackEndResponse::Type::COPY_PROGRESS: if (state == FORMAT) { - sub (_("Copying DCP")); + sub(_("Copying DCP")); state = COPY; } set_progress(response->progress()); break; case DiskWriterBackEndResponse::Type::VERIFY_PROGRESS: if (state == COPY) { - sub (_("Verifying copied files")); + sub(_("Verifying copied files")); state = VERIFY; } set_progress(response->progress()); diff --git a/src/lib/copy_to_drive_job.h b/src/lib/copy_to_drive_job.h index 8616a05d2..d29eb5691 100644 --- a/src/lib/copy_to_drive_job.h +++ b/src/lib/copy_to_drive_job.h @@ -25,18 +25,18 @@ class CopyToDriveJob : public Job { public: - CopyToDriveJob (std::vector<boost::filesystem::path> const& dcps, Drive drive, Nanomsg& nanomsg); + CopyToDriveJob(std::vector<boost::filesystem::path> const& dcps, Drive drive, Nanomsg& nanomsg); - std::string name () const override; - std::string json_name () const override; - void run () override; - bool enable_notify () const override { + std::string name() const override; + std::string json_name() const override; + void run() override; + bool enable_notify() const override { return true; } private: - void count (boost::filesystem::path dir, uint64_t& total_bytes); - void copy (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total); + void count(boost::filesystem::path dir, uint64_t& total_bytes); + void copy(boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total); std::vector<boost::filesystem::path> _dcps; Drive _drive; Nanomsg& _nanomsg; |
