Changeset View
Changeset View
Standalone View
Standalone View
core/libs/progressmanager/progressmanager.cpp
Context not available. | |||||
123 | { | 123 | { | ||
---|---|---|---|---|---|
124 | if (!d->canceled) | 124 | if (!d->canceled) | ||
125 | { | 125 | { | ||
126 | setProgress(100); | 126 | setProgress(d->total); | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | emit progressItemCompleted(this); | 129 | emit progressItemCompleted(this); | ||
Context not available. | |||||
236 | void ProgressItem::updateProgress() | 236 | void ProgressItem::updateProgress() | ||
237 | { | 237 | { | ||
238 | int total = d->total; | 238 | int total = d->total; | ||
239 | setProgress(total? d->completed * 100 / total : 0); | 239 | int completed = d->completed; | ||
240 | setProgress(total ? completed : 0); | ||||
240 | } | 241 | } | ||
241 | 242 | | |||
242 | bool ProgressItem::advance(unsigned int v) | 243 | bool ProgressItem::advance(unsigned int v) | ||
Context not available. | |||||
249 | void ProgressItem::setTotalItems(unsigned int v) | 250 | void ProgressItem::setTotalItems(unsigned int v) | ||
250 | { | 251 | { | ||
251 | d->total.fetchAndStoreOrdered(v); | 252 | d->total.fetchAndStoreOrdered(v); | ||
253 | emit progressItemTotal(this, v); | ||||
252 | } | 254 | } | ||
253 | 255 | | |||
254 | void ProgressItem::incTotalItems(unsigned int v) | 256 | void ProgressItem::incTotalItems(unsigned int v) | ||
255 | { | 257 | { | ||
256 | d->total.fetchAndAddOrdered(v); | 258 | d->total.fetchAndAddOrdered(v); | ||
259 | emit progressItemTotal(this, d->total); | ||||
257 | } | 260 | } | ||
258 | 261 | | |||
259 | unsigned int ProgressItem::totalItems() const | 262 | unsigned int ProgressItem::totalItems() const | ||
Context not available. | |||||
512 | connect(t, SIGNAL(progressItemProgress(ProgressItem*,uint)), | 515 | connect(t, SIGNAL(progressItemProgress(ProgressItem*,uint)), | ||
513 | this, SIGNAL(progressItemProgress(ProgressItem*,uint))); | 516 | this, SIGNAL(progressItemProgress(ProgressItem*,uint))); | ||
514 | 517 | | |||
518 | connect(t, SIGNAL(progressItemTotal(ProgressItem*,uint)), | ||||
519 | this, SIGNAL(progressItemTotal(ProgressItem*,uint))); | ||||
520 | | ||||
515 | connect(t, SIGNAL(progressItemAdded(ProgressItem*)), | 521 | connect(t, SIGNAL(progressItemAdded(ProgressItem*)), | ||
516 | this, SIGNAL(progressItemAdded(ProgressItem*))); | 522 | this, SIGNAL(progressItemAdded(ProgressItem*))); | ||
517 | 523 | | |||
Context not available. |