void StatusBarMessageLabel::setMessage(const QString& text,
DolphinStatusBar::Type type)
{
+ if ((text == m_text) && (type == m_type)) {
+ return;
+ }
+
if (m_type == DolphinStatusBar::Error) {
- // If an error is shown currently, other error messages get queued.
- // Non-error messages are ignored if there are pending error messages.
if (type == DolphinStatusBar::Error) {
- m_pendingMessages.append(text);
- return;
+ m_pendingMessages.insert(0, m_text);
}
- if ((m_state != Default) || !m_pendingMessages.isEmpty()) {
+ else if ((m_state != Default) || !m_pendingMessages.isEmpty()) {
+ // a non-error message should not be shown, as there
+ // are other pending error messages in the queue
return;
}
}
- if ((text == m_text) && (type == m_type)) {
- return;
- }
-
m_text = text;
m_type = type;
/**
* @brief Represents a message text label as part of the status bar.
*
- * Dependant from the given type automatically a corresponding icon
+ * Dependent from the given type automatically a corresponding icon
* is shown in front of the text. For message texts having the type
* DolphinStatusBar::Error a dynamic color blending is done to get the
* attention from the user.