Renamed completed to is_completed

This commit is contained in:
Pranav Srinivas Kumar
2019-12-04 11:19:17 -06:00
parent 30c943d55d
commit e5c312f688
2 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ public:
return std::min(static_cast<size_t>(_progress), size_t(100)); return std::min(static_cast<size_t>(_progress), size_t(100));
} }
bool completed() const { return _completed; } bool is_completed() const { return _completed; }
private: private:
float _progress{0.0}; float _progress{0.0};

View File

@@ -71,7 +71,7 @@ int main() {
auto job1 = [&p1, &index1, &status_text1]() { auto job1 = [&p1, &index1, &status_text1]() {
while (true) { while (true) {
if (p1.completed()) if (p1.is_completed())
break; break;
p1.set_postfix_text(status_text1[index1 % status_text1.size()]); p1.set_postfix_text(status_text1[index1 % status_text1.size()]);
p1.set_progress(index1 * 10); p1.set_progress(index1 * 10);
@@ -102,7 +102,7 @@ int main() {
if (p3.current() + 2 >= 100) if (p3.current() + 2 >= 100)
p3.set_prefix_text("Reading package list... Done"); p3.set_prefix_text("Reading package list... Done");
p3.tick(); p3.tick();
if (p3.completed()) { if (p3.is_completed()) {
break; break;
} }
std::this_thread::sleep_for(std::chrono::milliseconds(25)); std::this_thread::sleep_for(std::chrono::milliseconds(25));
@@ -135,7 +135,7 @@ int main() {
else if (ticks >= 98) else if (ticks >= 98)
p2.set_postfix_text("Done"); p2.set_postfix_text("Done");
p2.tick(); p2.tick();
if (p2.completed()) if (p2.is_completed())
break; break;
std::this_thread::sleep_for(std::chrono::milliseconds(30)); std::this_thread::sleep_for(std::chrono::milliseconds(30));
} }
@@ -158,7 +158,7 @@ int main() {
auto job5 = [&p5]() { auto job5 = [&p5]() {
while (true) { while (true) {
p5.tick(); p5.tick();
if (p5.completed()) { if (p5.is_completed()) {
break; break;
} }
std::this_thread::sleep_for(std::chrono::milliseconds(75)); std::this_thread::sleep_for(std::chrono::milliseconds(75));
@@ -189,7 +189,7 @@ int main() {
if (p4.current() + 2 >= 100) if (p4.current() + 2 >= 100)
p4.set_postfix_text("State restored to Restore_Point_1241531"); p4.set_postfix_text("State restored to Restore_Point_1241531");
p4.tick(); p4.tick();
if (p4.completed()) { if (p4.is_completed()) {
break; break;
} }
std::this_thread::sleep_for(std::chrono::milliseconds(50)); std::this_thread::sleep_for(std::chrono::milliseconds(50));