From: Peter Penz Date: Sat, 24 Mar 2007 15:00:38 +0000 (+0000) Subject: improve error handling by queueing old messages X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/0ac441acbe51a222d9094a5457e564a97bd60478?ds=sidebyside improve error handling by queueing old messages svn path=/trunk/KDE/kdebase/apps/; revision=646091 --- diff --git a/src/statusbarmessagelabel.cpp b/src/statusbarmessagelabel.cpp index 6b528d802..c870406d3 100644 --- a/src/statusbarmessagelabel.cpp +++ b/src/statusbarmessagelabel.cpp @@ -61,22 +61,21 @@ StatusBarMessageLabel::~StatusBarMessageLabel() 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; diff --git a/src/statusbarmessagelabel.h b/src/statusbarmessagelabel.h index 154915e4c..9f7c7a4a6 100644 --- a/src/statusbarmessagelabel.h +++ b/src/statusbarmessagelabel.h @@ -36,7 +36,7 @@ class QTimer; /** * @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.