MCPcopy Create free account
hub / github.com/KDE/kdevelop / showProgress

Method showProgress

kdevplatform/shell/statusbar.cpp:249–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void StatusBar::showProgress( IStatus* status, int minimum, int maximum, int value)
250{
251 QPointer<QObject> context = dynamic_cast<QObject*>(status);
252 QTimer::singleShot(0, this, [this, context, status, minimum, maximum, value]() {
253 if (!context)
254 return;
255 auto progressItemIt = m_progressItems.find(status);
256 if (progressItemIt == m_progressItems.end()) {
257 // Transfer an existing status message (if any) to the new progress item where it belongs.
258 const auto statusMessage = takeMessage(status);
259 bool canBeCanceled = false;
260 progressItemIt = m_progressItems.insert(status, m_progressController->createProgressItem(
261 ProgressManager::createUniqueID(), status->statusName(), statusMessage, canBeCanceled));
262 }
263
264 ProgressItem* i = *progressItemIt;
265 m_progressWidget->raise();
266 m_progressDialog->raise();
267 if( minimum == 0 && maximum == 0 ) {
268 i->setUsesBusyIndicator( true );
269 } else {
270 i->setUsesBusyIndicator( false );
271 i->setProgress( 100*value/maximum );
272 }
273 });
274}
275
276}
277

Callers

nothing calls this directly

Calls 7

createProgressItemMethod · 0.80
setUsesBusyIndicatorMethod · 0.80
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
statusNameMethod · 0.45
setProgressMethod · 0.45

Tested by

no test coverage detected