┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-24 15:00:38 +0000
committerPeter Penz <[email protected]>2007-03-24 15:00:38 +0000
commit0ac441acbe51a222d9094a5457e564a97bd60478 (patch)
tree2ea7c6f7a9afc0f03e658d8ec314203b5806a5b4
parent7c1f67d529bc00a60c59562fc3339a28594a1c15 (diff)
improve error handling by queueing old messages
svn path=/trunk/KDE/kdebase/apps/; revision=646091
-rw-r--r--src/statusbarmessagelabel.cpp17
-rw-r--r--src/statusbarmessagelabel.h2
2 files changed, 9 insertions, 10 deletions
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.