]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix selection issue for Information Panel
authorPeter Penz <peter.penz19@gmail.com>
Tue, 6 Dec 2011 17:49:12 +0000 (18:49 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 6 Dec 2011 17:53:42 +0000 (18:53 +0100)
When the selection changes during the Information Panel is
invisible, it still should get applied so that when making the
Information Panel visible again a valid selection is shown.

Thanks to A. Janardhan Reddy for the patch!

(Additionally the obsolete check for an empty selection has
been removed, as this cannot happen anymore with the new view
engine)

BUG: 281452
FIXED-IN: 4.8.0

src/panels/information/informationpanel.cpp

index 286861c59e2457b8108569ed9e9ca3ff1fb2cd98..3b4747b77dc51f38ba1d864b14da87822868c90d 100644 (file)
@@ -48,21 +48,13 @@ InformationPanel::~InformationPanel()
 
 void InformationPanel::setSelection(const KFileItemList& selection)
 {
-    if (!isVisible()) {
-        return;
-    }
+    m_selection = selection;
+    m_fileItem = KFileItem();
 
-    if (selection.isEmpty() && m_selection.isEmpty()) {
-        // The selection has not really changed, only the current index.
-        // QItemSelectionModel emits a signal in this case and it is less
-        // expensive doing the check this way instead of patching
-        // DolphinView::emitSelectionChanged().
+    if (!isVisible()) {
         return;
     }
 
-    m_selection = selection;
-    m_fileItem = KFileItem();
-
     const int count = selection.count();
     if (count == 0) {
         if (!isEqualToShownUrl(url())) {