]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Don't ignore tag clicks in the tooltips
[dolphin.git] / src / views / dolphinview.cpp
index f5ba63d1ee41511cb06f43353dd90180c527c6f3..e60e85fdbcec4a46455fe265b0deda53e8f20eef 100644 (file)
@@ -29,6 +29,7 @@
 #include <QGraphicsSceneDragDropEvent>
 #include <QTimer>
 #include <QScrollBar>
+#include <QPixmapCache>
 #include <QPointer>
 #include <QMenu>
 #include <QVBoxLayout>
@@ -181,6 +182,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
             this, &DolphinView::slotSelectionChanged);
 
     m_toolTipManager = new ToolTipManager(this);
+    connect(m_toolTipManager, &ToolTipManager::urlActivated, this, &DolphinView::urlActivated);
 
     m_versionControlObserver = new VersionControlObserver(this);
     m_versionControlObserver->setModel(m_model);
@@ -453,10 +455,6 @@ void DolphinView::reload()
     QDataStream saveStream(&viewState, QIODevice::WriteOnly);
     saveState(saveStream);
 
-    const KFileItemList itemList = selectedItems();
-    m_selectedUrls.clear();
-    m_selectedUrls = itemList.urlList();
-
     setUrl(url());
     loadDirectory(url(), true);
 
@@ -584,7 +582,6 @@ void DolphinView::setUrl(const QUrl& url)
 
     clearSelection();
 
-    emit urlAboutToBeChanged(url);
     m_url = url;
 
     hideToolTip();
@@ -731,6 +728,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
     switch (event->type()) {
     case QEvent::PaletteChange:
         updatePalette();
+        QPixmapCache::clear();
         break;
 
     case QEvent::KeyPress:
@@ -1021,7 +1019,7 @@ void DolphinView::slotItemHovered(int index)
         const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
         itemRect.moveTo(pos);
 
-        m_toolTipManager->showToolTip(item, itemRect);
+        m_toolTipManager->showToolTip(item, itemRect, nativeParentWidget()->windowHandle());
     }
 
     emit requestItemInfo(item);
@@ -1210,6 +1208,9 @@ void DolphinView::restoreState(QDataStream& stream)
     // Restore the current item that had the keyboard focus
     stream >> m_currentItemUrl;
 
+    // Restore the previously selected items
+    stream >> m_selectedUrls;
+
     // Restore the view position
     stream >> m_restoredContentsPosition;
 
@@ -1234,6 +1235,9 @@ void DolphinView::saveState(QDataStream& stream)
         stream << QUrl();
     }
 
+    // Save the selected urls
+    stream << selectedItems().urlList();
+
     // Save view position
     const qreal x = m_container->horizontalScrollBar()->value();
     const qreal y = m_container->verticalScrollBar()->value();
@@ -1368,6 +1372,7 @@ void DolphinView::updateViewState()
             }
         }
 
+        selectionManager->beginAnchoredSelection(selectionManager->currentItem());
         selectionManager->setSelectedItems(selectedItems);
     }
 }