Core: Enable context menu for document-less editors

Change-Id: I92edf53230d34cb222dcc82391b8046e09c7599d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Orgad Shaneh
2014-07-22 12:08:43 +03:00
committed by Orgad Shaneh
parent 95d22fc972
commit f51553b228
2 changed files with 7 additions and 4 deletions

View File

@@ -317,12 +317,14 @@ void EditorToolBar::listContextMenu(QPoint pos)
d->m_editorList->currentIndex());
QString fileName = entry ? entry->fileName() : QString();
QString shortFileName = entry ? QFileInfo(fileName).fileName() : QString();
if (fileName.isEmpty() || shortFileName.isEmpty())
return;
QMenu menu;
QAction *copyPath = menu.addAction(tr("Copy Full Path to Clipboard"));
QAction *copyFileName = menu.addAction(tr("Copy File Name to Clipboard"));
menu.addSeparator();
if (fileName.isEmpty() || shortFileName.isEmpty()) {
copyPath->setEnabled(false);
copyFileName->setEnabled(false);
}
EditorManager::addSaveAndCloseEditorActions(&menu, entry);
menu.addSeparator();
EditorManager::addNativeDirAndOpenWithActions(&menu, entry);