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

Method doWork

kdevplatform/shell/sourceformatterjob.cpp:50–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void SourceFormatterJob::doWork()
51{
52 // TODO: consider to use ExecuteCompositeJob, with every file a separate subjob
53 switch (m_workState) {
54 case WorkIdle:
55 m_workState = WorkFormat;
56 m_fileIndex = 0;
57 emit showProgress(this, 0, 0, 0);
58 emit showMessage(this, i18np("Reformatting one file",
59 "Reformatting %1 files",
60 m_fileList.length()));
61
62 QMetaObject::invokeMethod(this, "doWork", Qt::QueuedConnection);
63 break;
64 case WorkFormat:
65 if (m_fileIndex < m_fileList.length()) {
66 emit showProgress(this, 0, m_fileList.length(), m_fileIndex);
67 formatFile(m_fileList[m_fileIndex]);
68
69 // trigger formatting of next file
70 ++m_fileIndex;
71 QMetaObject::invokeMethod(this, "doWork", Qt::QueuedConnection);
72 } else {
73 m_workState = WorkIdle;
74 emitResult();
75 }
76 break;
77 case WorkCancelled:
78 break;
79 }
80}
81
82void SourceFormatterJob::start()
83{

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected