Changeset View
Changeset View
Standalone View
Standalone View
src/dolphincontextmenu.cpp
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Line(s) | 178 | if (exec(m_pos) == restoreAction) { | |||
---|---|---|---|---|---|
187 | job->uiDelegate()->setAutoErrorHandlingEnabled(true); | 187 | job->uiDelegate()->setAutoErrorHandlingEnabled(true); | ||
188 | } | 188 | } | ||
189 | } | 189 | } | ||
190 | 190 | | |||
191 | void DolphinContextMenu::openItemContextMenu() | 191 | void DolphinContextMenu::openItemContextMenu() | ||
192 | { | 192 | { | ||
193 | Q_ASSERT(!m_fileInfo.isNull()); | 193 | Q_ASSERT(!m_fileInfo.isNull()); | ||
194 | 194 | | |||
195 | QAction* openSymlinkDestinationFolder = nullptr; | ||||
195 | QAction* openParentAction = nullptr; | 196 | QAction* openParentAction = nullptr; | ||
196 | QAction* openParentInNewWindowAction = nullptr; | 197 | QAction* openParentInNewWindowAction = nullptr; | ||
197 | QAction* openParentInNewTabAction = nullptr; | 198 | QAction* openParentInNewTabAction = nullptr; | ||
198 | QAction* addToPlacesAction = nullptr; | 199 | QAction* addToPlacesAction = nullptr; | ||
199 | const KFileItemListProperties& selectedItemsProps = selectedItemsProperties(); | 200 | const KFileItemListProperties& selectedItemsProps = selectedItemsProperties(); | ||
200 | 201 | | |||
201 | if (m_selectedItems.count() == 1) { | 202 | if (m_selectedItems.count() == 1) { | ||
202 | if (m_fileInfo.isDir()) { | 203 | if (m_fileInfo.isLink()) { | ||
204 | addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_symlink_destination_folder"))); | ||||
205 | addSeparator(); | ||||
206 | } else if (m_fileInfo.isDir()) { | ||||
203 | // setup 'Create New' menu | 207 | // setup 'Create New' menu | ||
204 | DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow); | 208 | DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow); | ||
205 | const DolphinView* view = m_mainWindow->activeViewContainer()->view(); | 209 | const DolphinView* view = m_mainWindow->activeViewContainer()->view(); | ||
206 | newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown()); | 210 | newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown()); | ||
207 | newFileMenu->checkUpToDate(); | 211 | newFileMenu->checkUpToDate(); | ||
208 | newFileMenu->setPopupFiles(m_fileInfo.url()); | 212 | newFileMenu->setPopupFiles(m_fileInfo.url()); | ||
209 | newFileMenu->setEnabled(selectedItemsProps.supportsWriting()); | 213 | newFileMenu->setEnabled(selectedItemsProps.supportsWriting()); | ||
210 | connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater); | 214 | connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater); | ||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
300 | if (activatedAction) { | 304 | if (activatedAction) { | ||
301 | if (activatedAction == addToPlacesAction) { | 305 | if (activatedAction == addToPlacesAction) { | ||
302 | const QUrl selectedUrl(m_fileInfo.url()); | 306 | const QUrl selectedUrl(m_fileInfo.url()); | ||
303 | if (selectedUrl.isValid()) { | 307 | if (selectedUrl.isValid()) { | ||
304 | PlacesItemModel model; | 308 | PlacesItemModel model; | ||
305 | const QString text = selectedUrl.fileName(); | 309 | const QString text = selectedUrl.fileName(); | ||
306 | model.createPlacesItem(text, selectedUrl, KIO::iconNameForUrl(selectedUrl)); | 310 | model.createPlacesItem(text, selectedUrl, KIO::iconNameForUrl(selectedUrl)); | ||
307 | } | 311 | } | ||
312 | } else if (activatedAction == openSymlinkDestinationFolder) { | ||||
313 | | ||||
308 | } else if (activatedAction == openParentAction) { | 314 | } else if (activatedAction == openParentAction) { | ||
309 | m_command = OpenParentFolder; | 315 | m_command = OpenParentFolder; | ||
310 | } else if (activatedAction == openParentInNewWindowAction) { | 316 | } else if (activatedAction == openParentInNewWindowAction) { | ||
311 | m_command = OpenParentFolderInNewWindow; | 317 | m_command = OpenParentFolderInNewWindow; | ||
312 | } else if (activatedAction == openParentInNewTabAction) { | 318 | } else if (activatedAction == openParentInNewTabAction) { | ||
313 | m_command = OpenParentFolderInNewTab; | 319 | m_command = OpenParentFolderInNewTab; | ||
314 | } | 320 | } | ||
315 | } | 321 | } | ||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |