]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
fixed memory leaks (thanks to David for fixing this in KDirOperator)
[dolphin.git] / src / dolphinview.cpp
index 41bee6972315c62846ee2ffd4933ffb377c3a604..c2ea5ff2847dcbc71b3292327eceee0d3dc08c40 100644 (file)
@@ -147,6 +147,7 @@ void DolphinView::setActive(bool active)
     }
 
     m_active = active;
+    m_selectionModel->clearSelection();
 
     QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
     if (active) {
@@ -816,7 +817,7 @@ void DolphinView::updateCutItems()
 
 void DolphinView::showHoverInformation(const KFileItem& item)
 {
-    if (hasSelection()) {
+    if (hasSelection() || !m_active) {
         return;
     }
 
@@ -825,7 +826,9 @@ void DolphinView::showHoverInformation(const KFileItem& item)
 
 void DolphinView::clearHoverInformation()
 {
-    emit requestItemInfo(KFileItem());
+    if (m_active) {
+        emit requestItemInfo(KFileItem());
+    }
 }
 
 
@@ -861,10 +864,11 @@ void DolphinView::createView()
     view->setItemDelegate(m_fileItemDelegate);
 
     view->setModel(m_proxyModel);
-    if(m_selectionModel)
-       view->setSelectionModel(m_selectionModel);
-    else
+    if (m_selectionModel != 0) {
+        view->setSelectionModel(m_selectionModel);
+    } else {
         m_selectionModel = view->selectionModel();
+    }
 
     m_selectionModel->setParent(this);  //Reparent the selection model.  We do not want it to be deleted when we delete the model