diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphincontextmenu.cpp | 9 | ||||
| -rw-r--r-- | src/dolphinmainwindow.cpp | 8 | ||||
| -rw-r--r-- | src/dolphinpart.cpp | 9 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 2568f503f..6c1fa4ad3 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -31,6 +31,7 @@ #include <KPluginMetaData> #include <KStandardAction> #include <KToolBar> +#include <kio_version.h> #include <QApplication> #include <QClipboard> @@ -175,7 +176,11 @@ void DolphinContextMenu::addDirectoryItemContextMenu() // set up 'Create New' menu DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow); newFileMenu->checkUpToDate(); +#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) + newFileMenu->setWorkingDirectory(m_fileInfo.url()); +#else newFileMenu->setPopupFiles(QList<QUrl>() << m_fileInfo.url()); +#endif newFileMenu->setEnabled(selectedItemsProps.supportsWriting()); connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater); connect(newFileMenu, &DolphinNewFileMenu::directoryCreated, newFileMenu, &DolphinNewFileMenu::deleteLater); @@ -280,7 +285,11 @@ void DolphinContextMenu::addViewportContextMenu() // Set up and insert 'Create New' menu KNewFileMenu* newFileMenu = m_mainWindow->newFileMenu(); newFileMenu->checkUpToDate(); +#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) + newFileMenu->setWorkingDirectory(m_baseUrl); +#else newFileMenu->setPopupFiles(QList<QUrl>() << m_baseUrl); +#endif addMenu(newFileMenu->menu()); // Show "open with" menu items even if the dir is empty, because there are legitimate diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 2a2ac3637..39b820387 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -661,12 +661,20 @@ void DolphinMainWindow::readProperties(const KConfigGroup& group) void DolphinMainWindow::updateNewMenu() { m_newFileMenu->checkUpToDate(); +#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) + m_newFileMenu->setWorkingDirectory(activeViewContainer()->url()); +#else m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url()); +#endif } void DolphinMainWindow::createDirectory() { +#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) + m_newFileMenu->setWorkingDirectory(activeViewContainer()->url()); +#else m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url()); +#endif m_newFileMenu->createDirectory(); } diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index fdc550431..8f2279d45 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -33,6 +33,7 @@ #include <KPluginMetaData> #include <KSharedConfig> #include <KTerminalLauncherJob> +#include <kio_version.h> #include <QActionGroup> #include <QApplication> @@ -589,7 +590,11 @@ void DolphinPart::updateNewMenu() // As requested by KNewFileMenu : m_newFileMenu->checkUpToDate(); // And set the files that the menu apply on : +#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) + m_newFileMenu->setWorkingDirectory(url()); +#else m_newFileMenu->setPopupFiles(QList<QUrl>() << url()); +#endif } void DolphinPart::updateStatusBar() @@ -604,7 +609,11 @@ void DolphinPart::updateProgress(int percent) void DolphinPart::createDirectory() { +#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) + m_newFileMenu->setWorkingDirectory(url()); +#else m_newFileMenu->setPopupFiles(QList<QUrl>() << url()); +#endif m_newFileMenu->createDirectory(); } |
