]> 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 6681dc30dbf6998b8f6283c6b87efb92a7e3939d..3b4747b77dc51f38ba1d864b14da87822868c90d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006-2009 by Peter Penz <peter.penz@gmx.at>             *
+ *   Copyright (C) 2006-2009 by Peter Penz <peter.penz19@gmail.com>        *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -20,8 +20,8 @@
 #include "informationpanel.h"
 
 #include "informationpanelcontent.h"
-#include <kio/job.h>
-#include <kdirnotify.h>
+#include <KIO/Job>
+#include <KDirNotify>
 #include <QApplication>
 #include <QShowEvent>
 #include <QVBoxLayout>
@@ -46,30 +46,15 @@ InformationPanel::~InformationPanel()
 {
 }
 
-QSize InformationPanel::sizeHint() const
-{
-    QSize size = Panel::sizeHint();
-    size.setWidth(minimumSizeHint().width());
-    return size;
-}
-
 void InformationPanel::setSelection(const KFileItemList& selection)
 {
-    if (!isVisible()) {
-        return;
-    }
+    m_selection = selection;
+    m_fileItem = KFileItem();
 
-    if ((selection.count() == 0) && (m_selection.count() == 0)) {
-        // 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())) {
@@ -353,7 +338,7 @@ void InformationPanel::init()
 
     org::kde::KDirNotify* dirNotify = new org::kde::KDirNotify(QString(), QString(),
                                                                QDBusConnection::sessionBus(), this);
-    connect(dirNotify, SIGNAL(FileRenamed(QString, QString)), SLOT(slotFileRenamed(QString, QString)));
+    connect(dirNotify, SIGNAL(FileRenamed(QString,QString)), SLOT(slotFileRenamed(QString,QString)));
     connect(dirNotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString)));
     connect(dirNotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList)));
     connect(dirNotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList)));
@@ -364,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;