forked from qt-creator/qt-creator
ProjectExplorer: Use already-open visible editor, if available
... when following links from the issues pane. Fixes: QTCREATORBUG-13961 Change-Id: I799e34f8fa789ef824b3b4aa2a075c938d6f1271 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -46,7 +46,8 @@ bool ShowInEditorTaskHandler::canHandle(const Task &task) const
|
|||||||
void ShowInEditorTaskHandler::handle(const Task &task)
|
void ShowInEditorTaskHandler::handle(const Task &task)
|
||||||
{
|
{
|
||||||
QFileInfo fi(task.file.toFileInfo());
|
QFileInfo fi(task.file.toFileInfo());
|
||||||
Core::EditorManager::openEditorAt(fi.filePath(), task.movedLine);
|
Core::EditorManager::openEditorAt(fi.filePath(), task.movedLine, {}, {},
|
||||||
|
Core::EditorManager::SwitchSplitIfAlreadyVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *ShowInEditorTaskHandler::createAction(QObject *parent) const
|
QAction *ShowInEditorTaskHandler::createAction(QObject *parent) const
|
||||||
|
@@ -237,8 +237,10 @@ void TaskView::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
{
|
{
|
||||||
if (m_linksActive && m_mouseButtonPressed == Qt::LeftButton) {
|
if (m_linksActive && m_mouseButtonPressed == Qt::LeftButton) {
|
||||||
const Location loc = locationForPos(e->pos());
|
const Location loc = locationForPos(e->pos());
|
||||||
if (!loc.file.isEmpty())
|
if (!loc.file.isEmpty()) {
|
||||||
Core::EditorManager::openEditorAt(loc.file.toString(), loc.line, loc.column);
|
Core::EditorManager::openEditorAt(loc.file.toString(), loc.line, loc.column, {},
|
||||||
|
Core::EditorManager::SwitchSplitIfAlreadyVisible);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mouse was released, activate links again
|
// Mouse was released, activate links again
|
||||||
|
Reference in New Issue
Block a user