[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kfile
From:       Peter Penz <peter.penz () gmx ! at>
Date:       2010-05-01 16:28:57
Message-ID: 20100501162857.E6F24AC8AA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1121543 by ppenz:

Update the layout if the text for a URL-navigator button cannot be resolved synchronously.

BUG: 229867

 M  +3 -0      kurlnavigator.cpp  
 M  +3 -0      kurlnavigatorbutton.cpp  
 M  +15 -0     kurlnavigatorbutton_p.h  


--- trunk/KDE/kdelibs/kfile/kurlnavigator.cpp #1121542:1121543
@@ -634,6 +634,8 @@
                         q, SLOT(dropUrls(const KUrl&, QDropEvent*)));
                 connect(button, SIGNAL(clicked(KUrl, Qt::MouseButton)),
                         q, SLOT(slotNavigatorButtonClicked(KUrl, Qt::MouseButton)));
+                connect(button, SIGNAL(finishedTextResolving()),
+                        q, SLOT(updateButtonVisibility()));
                 appendWidget(button);
             } else {
                 button = m_navButtons[idx - startIndex];
@@ -703,6 +705,7 @@
     foreach (const KUrlNavigatorButton* button, m_navButtons) {
         requiredButtonWidth += button->minimumWidth();
     }
+
     if (requiredButtonWidth > availableWidth) {
         // At least one button must be hidden. This implies that the
         // drop-down button must get visible, which again decreases the
--- trunk/KDE/kdelibs/kfile/kurlnavigatorbutton.cpp #1121542:1121543
@@ -75,6 +75,7 @@
         KIO::StatJob* job = KIO::stat(m_url, KIO::HideProgressInfo);
         connect(job, SIGNAL(result(KJob*)),
                 this, SLOT(statFinished(KJob*)));
+        emit startedTextResolving();
     }
 }
 
@@ -398,6 +399,8 @@
             name = m_url.fileName();
         }
         setText(name);
+
+        emit finishedTextResolving();
     }
 }
 
--- trunk/KDE/kdelibs/kfile/kurlnavigatorbutton_p.h #1121542:1121543
@@ -85,6 +85,21 @@
 
     void clicked(const KUrl& url, Qt::MouseButton button);
 
+    /**
+     * Is emitted, if KUrlNavigatorButton::setUrl() cannot resolve
+     * the text synchronously and KUrlNavigator::text() will return
+     * an empty string in this case. The signal finishedTextResolving() is
+     * emitted, as soon as the text has been resolved.
+     */
+    void startedTextResolving();
+
+    /**
+     * Is emitted, if the asynchronous resolving of the text has
+     * been finished (see startTextResolving()).
+     * KUrlNavigatorButton::text() contains the resolved text.
+     */
+    void finishedTextResolving();
+
 protected:
     virtual void paintEvent(QPaintEvent* event);
     virtual void enterEvent(QEvent* event);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic