Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
Dolphin
Commits
513fe3bb
Commit
513fe3bb
authored
Dec 14, 2021
by
Nicolas Fella
Browse files
Port from KNewFileMenu::setPopupFiles to KNewFileMenu::setWorkingDirectory
The former is deprecated
parent
05941a52
Pipeline
#204946
passed with stage
in 6 minutes and 35 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/dolphincontextmenu.cpp
View file @
513fe3bb
...
...
@@ -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
...
...
src/dolphinmainwindow.cpp
View file @
513fe3bb
...
...
@@ -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
();
}
...
...
src/dolphinpart.cpp
View file @
513fe3bb
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment