forked from qt-creator/qt-creator
EditorManager: Avoid using sender()
Change-Id: I9965f26f6c2dc3a496e8d80ceb061e54ee1c0956 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -2433,11 +2433,10 @@ void EditorManagerPrivate::copyFilePathFromContextMenu()
|
|||||||
|
|
||||||
void EditorManagerPrivate::copyLocationFromContextMenu()
|
void EditorManagerPrivate::copyLocationFromContextMenu()
|
||||||
{
|
{
|
||||||
const auto action = qobject_cast<const QAction *>(sender());
|
if (!d->m_contextMenuEntry)
|
||||||
if (!d->m_contextMenuEntry || !action)
|
|
||||||
return;
|
return;
|
||||||
const QString text = d->m_contextMenuEntry->fileName().toUserOutput()
|
const QString text = d->m_contextMenuEntry->fileName().toUserOutput()
|
||||||
+ QLatin1Char(':') + action->data().toString();
|
+ QLatin1Char(':') + m_copyLocationContextAction->data().toString();
|
||||||
setClipboardAndSelection(text);
|
setClipboardAndSelection(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user