X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/fb210d6ec42f1a8fb301c187ca09c4e7647459ef..272aa65bb55dd31f58e8a8e24ea7bc8bd2712daa:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index d8c27526b..52b3e8d6a 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -65,6 +65,8 @@ #include #include +#include + #include #include #include @@ -207,6 +209,13 @@ DolphinMainWindow::DolphinMainWindow() : connect(KSycoca::self(), QOverload<>::of(&KSycoca::databaseChanged), this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); QTimer::singleShot(0, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); + + m_fileItemActions.setParentWidget(this); +#if KIO_VERSION >= QT_VERSION_CHECK(5, 82, 0) + connect(&m_fileItemActions, &KFileItemActions::error, this, [this](const QString &errorMessage) { + showErrorMessage(errorMessage); + }); +#endif } DolphinMainWindow::~DolphinMainWindow() @@ -230,20 +239,6 @@ QVector DolphinMainWindow::viewContainers() const return viewContainers; } -void DolphinMainWindow::setViewsWithInvalidPathsToHome() -{ - const QVector theViewContainers = viewContainers(); - for (DolphinViewContainer *viewContainer : theViewContainers) { - - // Only consider local dirs, not remote locations and abstract protocols - if (viewContainer->url().isLocalFile()) { - if (!QFileInfo::exists(viewContainer->url().toLocalFile())) { - viewContainer->setUrl(QUrl::fromLocalFile(QDir::homePath())); - } - } - } -} - void DolphinMainWindow::openDirectories(const QList& dirs, bool splitView) { m_tabWidget->openDirectories(dirs, splitView); @@ -1125,7 +1120,7 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos, const QUrl& url, const QList& customActions) { - QPointer contextMenu = new DolphinContextMenu(this, pos, item, url); + QPointer contextMenu = new DolphinContextMenu(this, pos, item, url, &m_fileItemActions); contextMenu.data()->setCustomActions(customActions); const DolphinContextMenu::Command command = contextMenu.data()->open();