]> cloud.milkyroute.net Git - dolphin.git/commitdiff
improve error handling by queueing old messages
authorPeter Penz <peter.penz19@gmail.com>
Sat, 24 Mar 2007 15:00:38 +0000 (15:00 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 24 Mar 2007 15:00:38 +0000 (15:00 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=646091

src/statusbarmessagelabel.cpp
src/statusbarmessagelabel.h

index 6b528d802b50cc04b2c168fe0865c2e9952a6bfb..c870406d3419258b66f90a51a27f9aba6c8c83cb 100644 (file)
@@ -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;
 
index 154915e4cc5ebaad5dae7331350c02c83cd92aea..9f7c7a4a6c6c8d6ef57fc1b140e060082f36aff0 100644 (file)
@@ -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.