]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Make cursor keys always trigger a statusbar update
authorSebastian Dörner <sebastian@sebastian-doerner.de>
Wed, 23 Mar 2011 23:45:14 +0000 (00:45 +0100)
committerSebastian Dörner <sebastian@sebastian-doerner.de>
Thu, 24 Mar 2011 21:43:45 +0000 (22:43 +0100)
When the selection is changed using the cursor keys, the statusbar
should be updated. Until now, this didn't actually happen directly after
an operation ending in a OperationCompletedMessage, because the
OperationCompletedMessage was protected.

This patch changes the behaviour to only protect ErrorMessages in the
ViewContainer. When an OperationCompletedMessage was issued very
recently, it keeps being protected by DolphinStatusbar itself.

Statusbar updates in the ViewContainer are only triggered by
a) user actions (move keyboard focus, enter something in the filter bar)
b) finished filed jobs

In case a), the update is desired, also overriding
OperationCompletedMessages.
In case b), the OperationCompletedMessage issued by the file command is
issues so shortly before the call to updateStatusBar, that the
DolphinStatusBar skips the message anyway (see
DolphinStatusBar::setMessage).

BUG: 193847
FIXED-IN: 4.7.0
REVIEW: 100939

src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h

index 540f3895435cbde8a4b353e3edb8894419c02bfc..6deb7b8464f0cd749f6b8efdddd2bcae8accf118 100644 (file)
@@ -288,21 +288,12 @@ void DolphinViewContainer::updateStatusBar()
 {
     m_statusBarTimestamp.start();
 
 {
     m_statusBarTimestamp.start();
 
-    // As the item count information is less important
-    // in comparison with other messages, it should only
-    // be shown if:
-    // - the status bar is empty or
-    // - shows already the item count information or
-    // - shows only a not very important information
     const QString newMessage = m_view->statusBarText();
     const QString newMessage = m_view->statusBarText();
-    const QString currentMessage = m_statusBar->message();
-    const bool updateStatusBarMsg = currentMessage.isEmpty()
-                                    || (currentMessage == m_statusBar->defaultText())
-                                    || (m_statusBar->type() == DolphinStatusBar::Information);
-
     m_statusBar->setDefaultText(newMessage);
 
     m_statusBar->setDefaultText(newMessage);
 
-    if (updateStatusBarMsg) {
+    // We don't want to override errors. Other messages are only protected by
+    // the Statusbar itself depending on timings (see DolphinStatusBar::setMessage).
+    if (m_statusBar->type() != DolphinStatusBar::Error) {
         m_statusBar->setMessage(newMessage, DolphinStatusBar::Default);
     }
 }
         m_statusBar->setMessage(newMessage, DolphinStatusBar::Default);
     }
 }
index 8ddc9d059b4666335ce77566352d14b52e49abef..82b105a4a4f1e4a2b41d5e4e61b85428f59c068f 100644 (file)
@@ -139,6 +139,9 @@ private slots:
      * of selected files and the sum of the filesize is shown. The update
      * is done asynchronously, as getting the sum of the
      * filesizes can be an expensive operation.
      * of selected files and the sum of the filesize is shown. The update
      * is done asynchronously, as getting the sum of the
      * filesizes can be an expensive operation.
+     * Unless a previous OperationCompletedMessage was set very shortly before
+     * calling this method, it will be overwritten (see DolphinStatusBar::setMessage).
+     * Previous ErrorMessages however are always preserved.
      */
     void delayedStatusBarUpdate();
 
      */
     void delayedStatusBarUpdate();