ProgressReport.h header

#include <ew/core/ProgressReport.h>

Namespace ew::core

ProgressReport struct

struct ew::core::ProgressReport

How far a long-running operation has got, and what it is doing at this moment.

One shape for every long operation in the engine, so a UI can render any of them with the same widget. Before this existed the codebase had two disagreeing shapes – the conversion orchestrator reported (int done, int total, QString activity) while the HTTP client reported (qint64 received, qint64 total) with no label – and anything wanting to show both had to know each one separately.

Members

qint64 ew::core::foundation::ProgressReport::done = 0

Units of work finished so far. Units are the operation's own (files, entities, bytes); a caller should render the ratio and activity, never assume what one unit means.

qint64 ew::core::foundation::ProgressReport::total = 0

Total units of work, or 0 when the operation cannot say yet – see isIndeterminate. qint64 rather than int because byte counts are a legitimate unit and a large import or download overflows 32 bits.

QString ew::core::foundation::ProgressReport::activity

A short label for the step now under way, e.g. "Timeline: chapter-3.md". Meant to be shown beside a progress bar, so it should stay short enough not to resize the dialog.

bool ew::core::foundation::ProgressReport::isIndeterminate() const

True when the total is not yet known, so a caller should show a busy indicator rather than a percentage. Real operations pass through this state: a conversion counts its files before it can say how many AI calls it will make, and reports "scanning" until it can.