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

Method updateMessage

kdevplatform/shell/statusbar.cpp:158–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void StatusBar::updateMessage(const IStatus* justInsertedMessage)
159{
160 if (m_timer->isActive()) {
161 m_timer->stop();
162 if (const auto subtrahend = m_time.elapsed()) {
163 subtractFromEachMessageTimeout(subtrahend, justInsertedMessage);
164 }
165 }
166
167 int timeout = 0;
168
169 QStringList messages;
170 messages.reserve(m_messages.size());
171 for (const Message& m : std::as_const(m_messages)) {
172 if (m.timeout < 0) {
173 continue;
174 }
175 messages.append(m.text);
176
177 if (m.timeout == 0) {
178 continue;
179 }
180 if (timeout)
181 timeout = qMin(timeout, m.timeout);
182 else
183 timeout = m.timeout;
184 }
185
186 if (!messages.isEmpty())
187 QStatusBar::showMessage(messages.join(QLatin1String("; ")));
188 else
189 QStatusBar::clearMessage();
190
191 if (timeout) {
192 Q_ASSERT(timeout > 0);
193 m_time.start();
194 m_timer->start(timeout);
195 }
196}
197
198void StatusBar::clearMessage( IStatus* status )
199{

Callers

nothing calls this directly

Calls 9

stopMethod · 0.80
elapsedMethod · 0.80
joinMethod · 0.80
isActiveMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
isEmptyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected