]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Port to KStandardAction::DeleteFile
[dolphin.git] / src / views / dolphinview.cpp
index 30298d2e1efe356d50f62a09d8f2db8e063920ea..63f6252ed41cf177a6118c76e5ccce6097d637d3 100644 (file)
@@ -454,10 +454,6 @@ void DolphinView::reload()
     QDataStream saveStream(&viewState, QIODevice::WriteOnly);
     saveState(saveStream);
 
     QDataStream saveStream(&viewState, QIODevice::WriteOnly);
     saveState(saveStream);
 
-    const KFileItemList itemList = selectedItems();
-    m_selectedUrls.clear();
-    m_selectedUrls = itemList.urlList();
-
     setUrl(url());
     loadDirectory(url(), true);
 
     setUrl(url());
     loadDirectory(url(), true);
 
@@ -585,7 +581,6 @@ void DolphinView::setUrl(const QUrl& url)
 
     clearSelection();
 
 
     clearSelection();
 
-    emit urlAboutToBeChanged(url);
     m_url = url;
 
     hideToolTip();
     m_url = url;
 
     hideToolTip();
@@ -1023,7 +1018,7 @@ void DolphinView::slotItemHovered(int index)
         const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
         itemRect.moveTo(pos);
 
         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);
     }
 
     emit requestItemInfo(item);
@@ -1212,6 +1207,9 @@ void DolphinView::restoreState(QDataStream& stream)
     // Restore the current item that had the keyboard focus
     stream >> m_currentItemUrl;
 
     // 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;
 
     // Restore the view position
     stream >> m_restoredContentsPosition;
 
@@ -1236,6 +1234,9 @@ void DolphinView::saveState(QDataStream& stream)
         stream << QUrl();
     }
 
         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();
     // Save view position
     const qreal x = m_container->horizontalScrollBar()->value();
     const qreal y = m_container->verticalScrollBar()->value();
@@ -1370,6 +1371,7 @@ void DolphinView::updateViewState()
             }
         }
 
             }
         }
 
+        selectionManager->beginAnchoredSelection(selectionManager->currentItem());
         selectionManager->setSelectedItems(selectedItems);
     }
 }
         selectionManager->setSelectedItems(selectedItems);
     }
 }
@@ -1536,7 +1538,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
             KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
             KJobWidgets::setWindow(job, this);
             KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
             KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
             KJobWidgets::setWindow(job, this);
             KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
-            job->ui()->setAutoErrorHandlingEnabled(true);
+            job->uiDelegate()->setAutoErrorHandlingEnabled(true);
 
             if (!newNameExistsAlready) {
                 // Only connect the result signal if there is no item with the new name
 
             if (!newNameExistsAlready) {
                 // Only connect the result signal if there is no item with the new name