]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/informationpanel.cpp
Adding license header in kitemlistviewaccessible
[dolphin.git] / src / panels / information / informationpanel.cpp
index 9bfb711c65dd18edf0983b84376983a3a82f0998..eda74f3b506938c9658d12e6b2663d0f1fc124d0 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "informationpanelcontent.h"
 #include <KIO/Job>
+#include <KIO/JobUiDelegate>
 #include <KDirNotify>
 #include <QApplication>
 #include <QShowEvent>
@@ -48,21 +49,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())) {
@@ -190,6 +183,9 @@ void InformationPanel::showItemInfo()
             // No item is hovered and no selection has been done: provide
             // an item for the currently shown directory.
             m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
+            if (m_folderStatJob->ui()) {
+                m_folderStatJob->ui()->setWindow(this);
+            }
             connect(m_folderStatJob, SIGNAL(result(KJob*)),
                     this, SLOT(slotFolderStatFinished(KJob*)));
         } else {
@@ -346,7 +342,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)));
@@ -357,6 +353,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;