forked from qt-creator/qt-creator
CppEditor: Only open refactored file in editor if we have a position
It's just confusing to the user otherwise. Fixes: QTCREATORBUG-27114 Change-Id: I127d97ca165af0eb751cd6479d0ec0ffec480c17 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -3476,18 +3476,24 @@ public:
|
|||||||
};
|
};
|
||||||
for (auto spec : classLayout) {
|
for (auto spec : classLayout) {
|
||||||
const auto iter = m_headerFileCode.find(spec);
|
const auto iter = m_headerFileCode.find(spec);
|
||||||
if (iter != m_headerFileCode.end())
|
if (iter != m_headerFileCode.end()) {
|
||||||
insertAndIndent(m_headerFile, headerLocationFor(spec), *iter);
|
const InsertionLocation loc = headerLocationFor(spec);
|
||||||
|
m_headerFile->setOpenEditor(true, m_headerFile->position(loc.line(), loc.column()));
|
||||||
|
insertAndIndent(m_headerFile, loc, *iter);
|
||||||
}
|
}
|
||||||
if (!m_sourceFileCode.isEmpty() && m_sourceFileInsertionPoint.isValid())
|
}
|
||||||
|
if (!m_sourceFileCode.isEmpty() && m_sourceFileInsertionPoint.isValid()) {
|
||||||
|
m_sourceFile->setOpenEditor(true, m_sourceFile->position(
|
||||||
|
m_sourceFileInsertionPoint.line(),
|
||||||
|
m_sourceFileInsertionPoint.column()));
|
||||||
insertAndIndent(m_sourceFile, m_sourceFileInsertionPoint, m_sourceFileCode);
|
insertAndIndent(m_sourceFile, m_sourceFileInsertionPoint, m_sourceFileCode);
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_headerFileChangeSet.isEmpty()) {
|
if (!m_headerFileChangeSet.isEmpty()) {
|
||||||
m_headerFile->setChangeSet(m_headerFileChangeSet);
|
m_headerFile->setChangeSet(m_headerFileChangeSet);
|
||||||
m_headerFile->apply();
|
m_headerFile->apply();
|
||||||
}
|
}
|
||||||
if (!m_sourceFileChangeSet.isEmpty()) {
|
if (!m_sourceFileChangeSet.isEmpty()) {
|
||||||
m_sourceFile->setOpenEditor();
|
|
||||||
m_sourceFile->setChangeSet(m_sourceFileChangeSet);
|
m_sourceFile->setChangeSet(m_sourceFileChangeSet);
|
||||||
m_sourceFile->apply();
|
m_sourceFile->apply();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user