]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/informationpanel.cpp
Fix selection issue for Information Panel
[dolphin.git] / src / panels / information / informationpanel.cpp
index d45ef8ea45195248d4c7615ab02bce6c5378e1ca..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())) {
@@ -357,6 +349,7 @@ void InformationPanel::init()
     connect(m_content, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
 
     QVBoxLayout* layout = new QVBoxLayout(this);
+    layout->setContentsMargins(0, 0, 0, 0);
     layout->addWidget(m_content);
 
     m_initialized = true;