]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Fix item highlighting through DBus
[dolphin.git] / src / views / dolphinview.cpp
index a00d485c85dc3c4008712a686915cb1df09eeb67..590fe336b76e23d1cacd9161903bce871a777e0c 100644 (file)
@@ -40,7 +40,6 @@
 #include <KIO/JobUiDelegate>
 #include <KIO/Paste>
 #include <KIO/PasteJob>
-#include <KIO/PreviewJob>
 #include <KIO/RenameFileDialog>
 #include <KJobWidgets>
 #include <KLocalizedString>
@@ -235,6 +234,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
 
 DolphinView::~DolphinView()
 {
+    disconnect(m_container->controller(), &KItemListController::modelChanged, this, &DolphinView::slotModelChanged);
 }
 
 QUrl DolphinView::url() const
@@ -1490,6 +1490,16 @@ bool DolphinView::itemsExpandable() const
     return m_mode == DetailsView;
 }
 
+bool DolphinView::isExpanded(const KFileItem& item) const
+{
+    Q_ASSERT(item.isDir());
+    Q_ASSERT(items().contains(item));
+    if (!itemsExpandable()) {
+        return false;
+    }
+    return m_model->isExpanded(m_model->index(item));
+}
+
 void DolphinView::restoreState(QDataStream& stream)
 {
     // Read the version number of the view state and check if the version is supported.