Bug 257394 - When switching between views progress updater appears
Summary: When switching between views progress updater appears
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-20 09:25 UTC by Dmitry Kazakov
Modified: 2010-12-11 11:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Kazakov 2010-11-20 09:25:00 UTC
Version:           unspecified
OS:                Linux

The progress updater appears on 0% level and do not hide on switch.

Reproducible: Didn't try
Comment 1 Dmitry Kazakov 2010-12-08 18:59:58 UTC
commit 51a17e0104a7c2adda418bd4786ccb32c14e897f
branch master
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Wed Dec 8 20:43:39 2010 +0300

    Fixed a split-view-statusbar-visibility bug
    
    KoView::showAllStatusBarItems should take into account whether the
    items of the status bar are hidden manually. If that is so, there is
    no reason to show them explicitly.
    
    BUG:257394

diff --git a/libs/main/KoView.cpp b/libs/main/KoView.cpp
index 7a75d3b..b09603d 100644
--- a/libs/main/KoView.cpp
+++ b/libs/main/KoView.cpp
@@ -81,9 +81,16 @@ public:
     {
     public:
         StatusBarItem() // for QValueList
-                : m_widget(0), m_visible(false) {}
+            : m_widget(0),
+              m_connected(false),
+              m_hidden(false) {}
+
         StatusBarItem(QWidget * widget, int stretch, bool permanent)
-                : m_widget(widget), m_stretch(stretch), m_permanent(permanent), m_visible(false) {}
+            : m_widget(widget),
+              m_stretch(stretch),
+              m_permanent(permanent),
+              m_connected(false),
+              m_hidden(false) {}
 
         bool operator==(const StatusBarItem& rhs) {
             return m_widget == rhs.m_widget;
@@ -99,28 +106,32 @@ public:
 
         void ensureItemShown(KStatusBar * sb) {
             Q_ASSERT(m_widget);
-            if (!m_visible) {
+            if (!m_connected) {
                 if (m_permanent)
                     sb->addPermanentWidget(m_widget, m_stretch);
                 else
                     sb->addWidget(m_widget, m_stretch);
 
-                m_visible = true;
-                m_widget->show();
+                if(!m_hidden)
+                    m_widget->show();
+
+                m_connected = true;
             }
         }
         void ensureItemHidden(KStatusBar * sb) {
-            if (m_visible) {
+            if (m_connected) {
+                m_hidden = m_widget->isHidden();
                 sb->removeWidget(m_widget);
-                m_visible = false;
                 m_widget->hide();
+                m_connected = false;
             }
         }
     private:
         QWidget * m_widget;
         int m_stretch;
         bool m_permanent;
-        bool m_visible;  // true when the item has been added to the statusbar
+        bool m_connected;
+        bool m_hidden;
     };
 
     QList<StatusBarItem> statusBarItems; // Our statusbar items
Comment 2 Cyrille Berger 2010-12-11 11:40:48 UTC
SVN commit 1205508 by berger:

Fixed a split-view-statusbar-visibility bug
    
    KoView::showAllStatusBarItems should take into account whether the
    items of the status bar are hidden manually. If that is so, there is
    no reason to show them explicitly.

Patch by dmitry, backport of 51a17e0104a7c2adda418bd4786ccb32c14e897f, reviewed by me.
    
CCBUG:257394


 M  +18 -7     KoView.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1205508