forked from qt-creator/qt-creator
Core: Enable context menu for document-less editors
Change-Id: I92edf53230d34cb222dcc82391b8046e09c7599d Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
95d22fc972
commit
f51553b228
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user