Merge remote-tracking branch 'origin/6.0'
Change-Id: I773141d47e3f2b773da51f2e26ef53b93bb28f90
23
.github/workflows/build_cmake.yml
vendored
@@ -364,13 +364,20 @@ jobs:
|
|||||||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||||
message("::set-output name=timestamp::${current_date}")
|
message("::set-output name=timestamp::${current_date}")
|
||||||
|
|
||||||
|
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}" github_workspace)
|
||||||
|
include(${github_workspace}/cmake/QtCreatorIDEBranding.cmake)
|
||||||
|
string(REPLACE "." ";" IDE_VERSION_LIST ${IDE_VERSION_DISPLAY})
|
||||||
|
list(GET IDE_VERSION_LIST 0 IDE_VERSION_MAJOR)
|
||||||
|
message("::set-output name=ide_major_version::${IDE_VERSION_MAJOR}")
|
||||||
|
|
||||||
|
|
||||||
- name: ccache cache files
|
- name: ccache cache files
|
||||||
uses: actions/cache@v1.1.0
|
uses: actions/cache@v1.1.0
|
||||||
with:
|
with:
|
||||||
path: .ccache
|
path: .ccache
|
||||||
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.ide_major_version }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ matrix.config.name }}-ccache-
|
${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.ide_major_version }}
|
||||||
|
|
||||||
- name: Install system libs
|
- name: Install system libs
|
||||||
shell: cmake -P {0}
|
shell: cmake -P {0}
|
||||||
@@ -415,10 +422,10 @@ jobs:
|
|||||||
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
|
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
|
||||||
set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros")
|
set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros")
|
||||||
set(ENV{CCACHE_COMPRESS} "true")
|
set(ENV{CCACHE_COMPRESS} "true")
|
||||||
set(ENV{CCACHE_COMPRESSLEVEL} "6")
|
set(ENV{CCACHE_COMPRESSLEVEL} "9")
|
||||||
set(ENV{CCACHE_MAXSIZE} "800M")
|
set(ENV{CCACHE_MAXSIZE} "400M")
|
||||||
if ("${{ matrix.config.cxx }}" STREQUAL "cl")
|
if ("${{ matrix.config.cxx }}" STREQUAL "cl")
|
||||||
set(ENV{CCACHE_MAXSIZE} "1200M")
|
set(ENV{CCACHE_MAXSIZE} "600M")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
@@ -491,10 +498,10 @@ jobs:
|
|||||||
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
|
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
|
||||||
set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros")
|
set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros")
|
||||||
set(ENV{CCACHE_COMPRESS} "true")
|
set(ENV{CCACHE_COMPRESS} "true")
|
||||||
set(ENV{CCACHE_COMPRESSLEVEL} "6")
|
set(ENV{CCACHE_COMPRESSLEVEL} "9")
|
||||||
set(ENV{CCACHE_MAXSIZE} "800M")
|
set(ENV{CCACHE_MAXSIZE} "400M")
|
||||||
if ("${{ matrix.config.cxx }}" STREQUAL "cl")
|
if ("${{ matrix.config.cxx }}" STREQUAL "cl")
|
||||||
set(ENV{CCACHE_MAXSIZE} "1200M")
|
set(ENV{CCACHE_MAXSIZE} "600M")
|
||||||
endif()
|
endif()
|
||||||
execute_process(COMMAND ccache -s)
|
execute_process(COMMAND ccache -s)
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@@ -104,6 +104,9 @@
|
|||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++}.
|
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++}.
|
||||||
|
\note The settings displayed here depend on which plugins you have
|
||||||
|
enabled. If the Clang Format plugin is enabled, you'll see the
|
||||||
|
settings described in \l{Automatic Formatting and Indentation}.
|
||||||
\li In the \uicontrol {Current settings} field, select the settings to
|
\li In the \uicontrol {Current settings} field, select the settings to
|
||||||
modify and click \uicontrol Copy.
|
modify and click \uicontrol Copy.
|
||||||
\image qtcreator-options-code-style-cpp.png "C++ Code Style options"
|
\image qtcreator-options-code-style-cpp.png "C++ Code Style options"
|
||||||
@@ -250,6 +253,10 @@
|
|||||||
the cursor is located within leading white space, select \uicontrol {In
|
the cursor is located within leading white space, select \uicontrol {In
|
||||||
Leading White Space}.
|
Leading White Space}.
|
||||||
|
|
||||||
|
Your highlight definition file can contain definitions for both multi and
|
||||||
|
single line comments. To apply the single line comment definition when
|
||||||
|
commenting out a selection, select \uicontrol {Prefer single line comments}.
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
\section1 Specifying Settings for Content
|
\section1 Specifying Settings for Content
|
||||||
|
|
||||||
@@ -298,13 +305,5 @@
|
|||||||
pointers to functions and pointers to arrays.
|
pointers to functions and pointers to arrays.
|
||||||
|
|
||||||
\image qtcreator-pointers-references.png "Pointers and References options"
|
\image qtcreator-pointers-references.png "Pointers and References options"
|
||||||
|
|
||||||
\section1 Naming Getters
|
|
||||||
|
|
||||||
To prefer getter names without the string \e get, select the
|
|
||||||
\uicontrol {Prefer getter names without "get"} check box in the
|
|
||||||
\uicontrol {Getter and Setter} tab.
|
|
||||||
|
|
||||||
\image qtcreator-code-style-getter-setter.png
|
|
||||||
\endif
|
\endif
|
||||||
*/
|
*/
|
||||||
|
@@ -57,7 +57,7 @@ Item {
|
|||||||
_zoomFactor = cameraState[1];
|
_zoomFactor = cameraState[1];
|
||||||
camera.position = cameraState[2];
|
camera.position = cameraState[2];
|
||||||
camera.rotation = cameraState[3];
|
camera.rotation = cameraState[3];
|
||||||
_generalHelper.zoomCamera(camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
_zoomFactor, false);
|
_zoomFactor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ Item {
|
|||||||
_zoomFactor = 1;
|
_zoomFactor = 1;
|
||||||
camera.position = _defaultCameraPosition;
|
camera.position = _defaultCameraPosition;
|
||||||
camera.eulerRotation = _defaultCameraRotation;
|
camera.eulerRotation = _defaultCameraRotation;
|
||||||
_generalHelper.zoomCamera(camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
_zoomFactor, false);
|
_zoomFactor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,21 +114,21 @@ Item {
|
|||||||
if (!camera)
|
if (!camera)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_zoomFactor = _generalHelper.zoomCamera(camera, distance, _defaultCameraLookAtDistance,
|
_zoomFactor = _generalHelper.zoomCamera(view3d, camera, distance, _defaultCameraLookAtDistance,
|
||||||
_lookAtPoint, _zoomFactor, true);
|
_lookAtPoint, _zoomFactor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCameraChanged: {
|
onCameraChanged: {
|
||||||
if (camera && _prevCamera) {
|
if (camera && _prevCamera) {
|
||||||
// Reset zoom on previous camera to ensure it's properties are good to copy to new cam
|
// Reset zoom on previous camera to ensure it's properties are good to copy to new cam
|
||||||
_generalHelper.zoomCamera(_prevCamera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, _prevCamera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
1, false);
|
1, false);
|
||||||
|
|
||||||
camera.position = _prevCamera.position;
|
camera.position = _prevCamera.position;
|
||||||
camera.rotation = _prevCamera.rotation;
|
camera.rotation = _prevCamera.rotation;
|
||||||
|
|
||||||
// Apply correct zoom to new camera
|
// Apply correct zoom to new camera
|
||||||
_generalHelper.zoomCamera(camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
_zoomFactor, false);
|
_zoomFactor, false);
|
||||||
}
|
}
|
||||||
_prevCamera = camera;
|
_prevCamera = camera;
|
||||||
|
@@ -57,7 +57,7 @@ Item {
|
|||||||
_zoomFactor = cameraState[1];
|
_zoomFactor = cameraState[1];
|
||||||
camera.position = cameraState[2];
|
camera.position = cameraState[2];
|
||||||
camera.rotation = cameraState[3];
|
camera.rotation = cameraState[3];
|
||||||
_generalHelper.zoomCamera(camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
_zoomFactor, false);
|
_zoomFactor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ Item {
|
|||||||
_zoomFactor = 1;
|
_zoomFactor = 1;
|
||||||
camera.position = _defaultCameraPosition;
|
camera.position = _defaultCameraPosition;
|
||||||
camera.eulerRotation = _defaultCameraRotation;
|
camera.eulerRotation = _defaultCameraRotation;
|
||||||
_generalHelper.zoomCamera(camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
_zoomFactor, false);
|
_zoomFactor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,21 +114,21 @@ Item {
|
|||||||
if (!camera)
|
if (!camera)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_zoomFactor = _generalHelper.zoomCamera(camera, distance, _defaultCameraLookAtDistance,
|
_zoomFactor = _generalHelper.zoomCamera(view3d, camera, distance, _defaultCameraLookAtDistance,
|
||||||
_lookAtPoint, _zoomFactor, true);
|
_lookAtPoint, _zoomFactor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCameraChanged: {
|
onCameraChanged: {
|
||||||
if (camera && _prevCamera) {
|
if (camera && _prevCamera) {
|
||||||
// Reset zoom on previous camera to ensure it's properties are good to copy to new cam
|
// Reset zoom on previous camera to ensure it's properties are good to copy to new cam
|
||||||
_generalHelper.zoomCamera(_prevCamera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, _prevCamera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
1, false);
|
1, false);
|
||||||
|
|
||||||
camera.position = _prevCamera.position;
|
camera.position = _prevCamera.position;
|
||||||
camera.rotation = _prevCamera.rotation;
|
camera.rotation = _prevCamera.rotation;
|
||||||
|
|
||||||
// Apply correct zoom to new camera
|
// Apply correct zoom to new camera
|
||||||
_generalHelper.zoomCamera(camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
_generalHelper.zoomCamera(view3d, camera, 0, _defaultCameraLookAtDistance, _lookAtPoint,
|
||||||
_zoomFactor, false);
|
_zoomFactor, false);
|
||||||
}
|
}
|
||||||
_prevCamera = camera;
|
_prevCamera = camera;
|
||||||
|
@@ -176,14 +176,7 @@ void CameraGeometry::fillVertexData(QByteArray &vertexData, QByteArray &indexDat
|
|||||||
QRectF rect = m_viewPortRect;
|
QRectF rect = m_viewPortRect;
|
||||||
if (rect.isNull())
|
if (rect.isNull())
|
||||||
rect = QRectF(0, 0, 1000, 1000); // Let's have some visualization for null viewports
|
rect = QRectF(0, 0, 1000, 1000); // Let's have some visualization for null viewports
|
||||||
if (qobject_cast<QQuick3DOrthographicCamera *>(m_camera)) {
|
|
||||||
// For some reason ortho cameras show double what projection suggests,
|
|
||||||
// so give them doubled viewport to match visualization to actual camera view
|
|
||||||
camera->calculateGlobalVariables(QRectF(0, 0, rect.width() * 2.0,
|
|
||||||
rect.height() * 2.0));
|
|
||||||
} else {
|
|
||||||
camera->calculateGlobalVariables(rect);
|
camera->calculateGlobalVariables(rect);
|
||||||
}
|
|
||||||
m = camera->projection.inverted();
|
m = camera->projection.inverted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -130,8 +130,9 @@ QVector3D GeneralHelper::panCamera(QQuick3DCamera *camera, const QMatrix4x4 star
|
|||||||
return startLookAt + delta;
|
return startLookAt + delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
float GeneralHelper::zoomCamera(QQuick3DCamera *camera, float distance, float defaultLookAtDistance,
|
float GeneralHelper::zoomCamera(QQuick3DViewport *viewPort, QQuick3DCamera *camera, float distance,
|
||||||
const QVector3D &lookAt, float zoomFactor, bool relative)
|
float defaultLookAtDistance, const QVector3D &lookAt,
|
||||||
|
float zoomFactor, bool relative)
|
||||||
{
|
{
|
||||||
// Emprically determined divisor for nice zoom
|
// Emprically determined divisor for nice zoom
|
||||||
float multiplier = 1.f + (distance / 40.f);
|
float multiplier = 1.f + (distance / 40.f);
|
||||||
@@ -140,7 +141,16 @@ float GeneralHelper::zoomCamera(QQuick3DCamera *camera, float distance, float de
|
|||||||
|
|
||||||
if (qobject_cast<QQuick3DOrthographicCamera *>(camera)) {
|
if (qobject_cast<QQuick3DOrthographicCamera *>(camera)) {
|
||||||
// Ortho camera we can simply scale
|
// Ortho camera we can simply scale
|
||||||
camera->setScale(QVector3D(newZoomFactor, newZoomFactor, newZoomFactor));
|
float orthoFactor = newZoomFactor;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
if (viewPort) {
|
||||||
|
if (const QQuickWindow *w = viewPort->window())
|
||||||
|
orthoFactor *= w->devicePixelRatio();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Q_UNUSED(viewPort)
|
||||||
|
#endif
|
||||||
|
camera->setScale(QVector3D(orthoFactor, orthoFactor, orthoFactor));
|
||||||
} else if (qobject_cast<QQuick3DPerspectiveCamera *>(camera)) {
|
} else if (qobject_cast<QQuick3DPerspectiveCamera *>(camera)) {
|
||||||
// Perspective camera is zoomed by moving camera forward or backward while keeping the
|
// Perspective camera is zoomed by moving camera forward or backward while keeping the
|
||||||
// look-at point the same
|
// look-at point the same
|
||||||
@@ -249,7 +259,8 @@ QVector4D GeneralHelper::focusNodesToCamera(QQuick3DCamera *camera, float defaul
|
|||||||
float divisor = closeUp ? 900.f : 725.f;
|
float divisor = closeUp ? 900.f : 725.f;
|
||||||
|
|
||||||
float newZoomFactor = updateZoom ? qBound(.01f, maxExtent / divisor, 100.f) : oldZoom;
|
float newZoomFactor = updateZoom ? qBound(.01f, maxExtent / divisor, 100.f) : oldZoom;
|
||||||
float cameraZoomFactor = zoomCamera(camera, 0, defaultLookAtDistance, lookAt, newZoomFactor, false);
|
float cameraZoomFactor = zoomCamera(viewPort, camera, 0, defaultLookAtDistance, lookAt,
|
||||||
|
newZoomFactor, false);
|
||||||
|
|
||||||
return QVector4D(lookAt, cameraZoomFactor);
|
return QVector4D(lookAt, cameraZoomFactor);
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ public:
|
|||||||
const QVector3D &startPosition, const QVector3D &startLookAt,
|
const QVector3D &startPosition, const QVector3D &startLookAt,
|
||||||
const QVector3D &pressPos, const QVector3D ¤tPos,
|
const QVector3D &pressPos, const QVector3D ¤tPos,
|
||||||
float zoomFactor);
|
float zoomFactor);
|
||||||
Q_INVOKABLE float zoomCamera(QQuick3DCamera *camera, float distance,
|
Q_INVOKABLE float zoomCamera(QQuick3DViewport *viewPort, QQuick3DCamera *camera, float distance,
|
||||||
float defaultLookAtDistance, const QVector3D &lookAt,
|
float defaultLookAtDistance, const QVector3D &lookAt,
|
||||||
float zoomFactor, bool relative);
|
float zoomFactor, bool relative);
|
||||||
Q_INVOKABLE QVector4D focusNodesToCamera(QQuick3DCamera *camera, float defaultLookAtDistance,
|
Q_INVOKABLE QVector4D focusNodesToCamera(QQuick3DCamera *camera, float defaultLookAtDistance,
|
||||||
|
@@ -1623,14 +1623,20 @@ void ClangdClient::Private::handleFindUsagesResult(quint64 key, const QList<Loca
|
|||||||
|
|
||||||
for (const Location &loc : locations)
|
for (const Location &loc : locations)
|
||||||
refData->fileData[loc.uri()].rangesAndLineText << qMakePair(loc.range(), QString());
|
refData->fileData[loc.uri()].rangesAndLineText << qMakePair(loc.range(), QString());
|
||||||
for (auto it = refData->fileData.begin(); it != refData->fileData.end(); ++it) {
|
for (auto it = refData->fileData.begin(); it != refData->fileData.end();) {
|
||||||
const QStringList lines = SymbolSupport::getFileContents(it.key().toFilePath());
|
const Utils::FilePath filePath = it.key().toFilePath();
|
||||||
|
if (!filePath.exists()) { // https://github.com/clangd/clangd/issues/935
|
||||||
|
it = refData->fileData.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const QStringList lines = SymbolSupport::getFileContents(filePath);
|
||||||
it->fileContent = lines.join('\n');
|
it->fileContent = lines.join('\n');
|
||||||
for (auto &rangeWithText : it.value().rangesAndLineText) {
|
for (auto &rangeWithText : it.value().rangesAndLineText) {
|
||||||
const int lineNo = rangeWithText.first.start().line();
|
const int lineNo = rangeWithText.first.start().line();
|
||||||
if (lineNo >= 0 && lineNo < lines.size())
|
if (lineNo >= 0 && lineNo < lines.size())
|
||||||
rangeWithText.second = lines.at(lineNo);
|
rangeWithText.second = lines.at(lineNo);
|
||||||
}
|
}
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
qCDebug(clangdLog) << "document count is" << refData->fileData.size();
|
qCDebug(clangdLog) << "document count is" << refData->fileData.size();
|
||||||
|
@@ -398,7 +398,7 @@ bool ClangdTextMark::addToolTipContent(QLayout *target) const
|
|||||||
return c && c->reachable() && c->hasDiagnostic(DocumentUri::fromFilePath(fp), diag);
|
return c && c->reachable() && c->hasDiagnostic(DocumentUri::fromFilePath(fp), diag);
|
||||||
};
|
};
|
||||||
target->addWidget(ClangDiagnosticWidget::createWidget({m_diagnostic},
|
target->addWidget(ClangDiagnosticWidget::createWidget({m_diagnostic},
|
||||||
ClangDiagnosticWidget::ToolTip, canApplyFixIt, "clangd"));
|
ClangDiagnosticWidget::ToolTip, canApplyFixIt, m_client ? m_client->name() : "clangd"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -636,7 +636,7 @@ void ClangdTestTooltips::test()
|
|||||||
helpItem = h;
|
helpItem = h;
|
||||||
loop.quit();
|
loop.quit();
|
||||||
};
|
};
|
||||||
connect(client(), &ClangdClient::helpItemGathered, handler);
|
connect(client(), &ClangdClient::helpItemGathered, &loop, handler);
|
||||||
|
|
||||||
QTextCursor cursor(doc->document());
|
QTextCursor cursor(doc->document());
|
||||||
const int pos = Utils::Text::positionInText(doc->document(), line, column);
|
const int pos = Utils::Text::positionInText(doc->document(), line, column);
|
||||||
|
@@ -420,6 +420,8 @@ const QList<Client *> LanguageClientManager::clientsForProject(
|
|||||||
|
|
||||||
void LanguageClientManager::openDocumentWithClient(TextEditor::TextDocument *document, Client *client)
|
void LanguageClientManager::openDocumentWithClient(TextEditor::TextDocument *document, Client *client)
|
||||||
{
|
{
|
||||||
|
if (!document)
|
||||||
|
return;
|
||||||
Client *currentClient = clientForDocument(document);
|
Client *currentClient = clientForDocument(document);
|
||||||
if (client == currentClient)
|
if (client == currentClient)
|
||||||
return;
|
return;
|
||||||
|
@@ -202,6 +202,18 @@ void updateCodeActionRefactoringMarker(Client *client,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char clientExtrasName[] = "__qtcreator_client_extras__";
|
||||||
|
|
||||||
|
class ClientExtras : public QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ClientExtras(QObject *parent) : QObject(parent) { setObjectName(clientExtrasName); };
|
||||||
|
|
||||||
|
QPointer<QAction> m_popupAction;
|
||||||
|
QPointer<Client> m_client;
|
||||||
|
QPointer<QAction> m_outlineAction;
|
||||||
|
};
|
||||||
|
|
||||||
void updateEditorToolBar(Core::IEditor *editor)
|
void updateEditorToolBar(Core::IEditor *editor)
|
||||||
{
|
{
|
||||||
auto *textEditor = qobject_cast<BaseTextEditor *>(editor);
|
auto *textEditor = qobject_cast<BaseTextEditor *>(editor);
|
||||||
@@ -214,29 +226,31 @@ void updateEditorToolBar(Core::IEditor *editor)
|
|||||||
TextDocument *document = textEditor->textDocument();
|
TextDocument *document = textEditor->textDocument();
|
||||||
Client *client = LanguageClientManager::clientForDocument(textEditor->textDocument());
|
Client *client = LanguageClientManager::clientForDocument(textEditor->textDocument());
|
||||||
|
|
||||||
static QHash<QWidget *, QAction *> actions;
|
ClientExtras *extras = widget->findChild<ClientExtras *>(clientExtrasName,
|
||||||
|
Qt::FindDirectChildrenOnly);
|
||||||
if (actions.contains(widget)) {
|
if (!extras) {
|
||||||
auto action = actions[widget];
|
if (!client)
|
||||||
|
return;
|
||||||
|
extras = new ClientExtras(widget);
|
||||||
|
}
|
||||||
|
if (extras->m_popupAction) {
|
||||||
if (client) {
|
if (client) {
|
||||||
action->setText(client->name());
|
extras->m_popupAction->setText(client->name());
|
||||||
} else {
|
} else {
|
||||||
widget->toolBar()->removeAction(action);
|
widget->toolBar()->removeAction(extras->m_popupAction);
|
||||||
actions.remove(widget);
|
delete extras->m_popupAction;
|
||||||
delete action;
|
|
||||||
}
|
}
|
||||||
} else if (client) {
|
} else if (client) {
|
||||||
const QIcon icon = Utils::Icon({{":/languageclient/images/languageclient.png",
|
const QIcon icon = Utils::Icon({{":/languageclient/images/languageclient.png",
|
||||||
Utils::Theme::IconsBaseColor}})
|
Utils::Theme::IconsBaseColor}}).icon();
|
||||||
.icon();
|
extras->m_popupAction = widget->toolBar()->addAction(
|
||||||
actions[widget] = widget->toolBar()->addAction(
|
icon, client->name(), [document = QPointer(document)] {
|
||||||
icon, client->name(), [document]() {
|
|
||||||
auto menu = new QMenu;
|
auto menu = new QMenu;
|
||||||
auto clientsGroup = new QActionGroup(menu);
|
auto clientsGroup = new QActionGroup(menu);
|
||||||
clientsGroup->setExclusive(true);
|
clientsGroup->setExclusive(true);
|
||||||
for (auto client : LanguageClientManager::clientsSupportingDocument(document)) {
|
for (auto client : LanguageClientManager::clientsSupportingDocument(document)) {
|
||||||
auto action = clientsGroup->addAction(client->name());
|
auto action = clientsGroup->addAction(client->name());
|
||||||
auto reopen = [action, client = QPointer<Client>(client), document]() {
|
auto reopen = [action, client = QPointer(client), document] {
|
||||||
if (!client)
|
if (!client)
|
||||||
return;
|
return;
|
||||||
LanguageClientManager::openDocumentWithClient(document, client);
|
LanguageClientManager::openDocumentWithClient(document, client);
|
||||||
@@ -247,37 +261,32 @@ void updateEditorToolBar(Core::IEditor *editor)
|
|||||||
QObject::connect(action, &QAction::triggered, reopen);
|
QObject::connect(action, &QAction::triggered, reopen);
|
||||||
}
|
}
|
||||||
menu->addActions(clientsGroup->actions());
|
menu->addActions(clientsGroup->actions());
|
||||||
menu->addAction("Inspect Language Clients", []() {
|
if (!clientsGroup->actions().isEmpty())
|
||||||
|
menu->addSeparator();
|
||||||
|
menu->addAction("Inspect Language Clients", [] {
|
||||||
LanguageClientManager::showInspector();
|
LanguageClientManager::showInspector();
|
||||||
});
|
});
|
||||||
menu->addAction("Manage...", []() {
|
menu->addAction("Manage...", [] {
|
||||||
Core::ICore::showOptionsDialog(Constants::LANGUAGECLIENT_SETTINGS_PAGE);
|
Core::ICore::showOptionsDialog(Constants::LANGUAGECLIENT_SETTINGS_PAGE);
|
||||||
});
|
});
|
||||||
menu->popup(QCursor::pos());
|
menu->popup(QCursor::pos());
|
||||||
});
|
});
|
||||||
QObject::connect(widget, &QWidget::destroyed, [widget]() {
|
|
||||||
actions.remove(widget);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static QHash<QWidget *, QPair<Client *, QAction *>> outlines;
|
if (!extras->m_client || extras->m_client != client ||
|
||||||
|
!LanguageClientOutlineWidgetFactory::clientSupportsDocumentSymbols(client, document)) {
|
||||||
if (outlines.contains(widget)) {
|
if (extras->m_outlineAction) {
|
||||||
auto outline = outlines[widget];
|
widget->toolBar()->removeAction(extras->m_outlineAction);
|
||||||
if (outline.first != client
|
delete extras->m_outlineAction;
|
||||||
|| !LanguageClientOutlineWidgetFactory::clientSupportsDocumentSymbols(client,
|
|
||||||
document)) {
|
|
||||||
auto oldAction = outline.second;
|
|
||||||
widget->toolBar()->removeAction(oldAction);
|
|
||||||
delete oldAction;
|
|
||||||
outlines.remove(widget);
|
|
||||||
}
|
}
|
||||||
|
extras->m_client.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!outlines.contains(widget)) {
|
if (!extras->m_client) {
|
||||||
if (QWidget *comboBox = LanguageClientOutlineWidgetFactory::createComboBox(client, editor)) {
|
if (QWidget *comboBox = LanguageClientOutlineWidgetFactory::createComboBox(client, editor)) {
|
||||||
outlines[widget] = {client,
|
extras->m_client = client;
|
||||||
widget->insertExtraToolBarWidget(TextEditorWidget::Left, comboBox)};
|
extras->m_outlineAction = widget->insertExtraToolBarWidget(TextEditorWidget::Left,
|
||||||
|
comboBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -892,14 +892,14 @@ bool isPositioner(const SelectionContext &context)
|
|||||||
|
|
||||||
bool layoutOptionVisible(const SelectionContext &context)
|
bool layoutOptionVisible(const SelectionContext &context)
|
||||||
{
|
{
|
||||||
return multiSelectionAndInBaseState(context)
|
return selectionCanBeLayoutedAndQtQuickLayoutPossible(context)
|
||||||
|| singleSelectionAndInQtQuickLayout(context)
|
|| singleSelectionAndInQtQuickLayout(context)
|
||||||
|| isLayout(context);
|
|| isLayout(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool positionOptionVisible(const SelectionContext &context)
|
bool positionOptionVisible(const SelectionContext &context)
|
||||||
{
|
{
|
||||||
return multiSelectionAndInBaseState(context)
|
return selectionCanBeLayouted(context)
|
||||||
|| isPositioner(context);
|
|| isPositioner(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,9 +83,11 @@ ChooseFromPropertyListDialog *ChooseFromPropertyListDialog::createIfNeeded(
|
|||||||
// Common base types cause too many rarely valid matches, so they are ignored
|
// Common base types cause too many rarely valid matches, so they are ignored
|
||||||
const QSet<TypeName> ignoredTypes {"<cpp>.QObject",
|
const QSet<TypeName> ignoredTypes {"<cpp>.QObject",
|
||||||
"<cpp>.QQuickItem",
|
"<cpp>.QQuickItem",
|
||||||
|
"<cpp>.QQuick3DObject",
|
||||||
"QtQuick.Item",
|
"QtQuick.Item",
|
||||||
"QtQuick3D.Object3D",
|
"QtQuick3D.Object3D",
|
||||||
"QtQuick3D.Node"};
|
"QtQuick3D.Node",
|
||||||
|
"QtQuick3D.Particles3D.ParticleSystem3D"};
|
||||||
|
|
||||||
for (const auto &propName : propNames) {
|
for (const auto &propName : propNames) {
|
||||||
const TypeName testType = metaInfo.propertyTypeName(propName);
|
const TypeName testType = metaInfo.propertyTypeName(propName);
|
||||||
|
@@ -320,7 +320,7 @@ QList<ModelNode> filteredList(const NodeListProperty &property, bool filter, boo
|
|||||||
if (arg.hasAuxiliaryData(auxProp))
|
if (arg.hasAuxiliaryData(auxProp))
|
||||||
return arg.auxiliaryData(auxProp).toBool();
|
return arg.auxiliaryData(auxProp).toBool();
|
||||||
const bool value = QmlItemNode::isValidQmlItemNode(arg) || NodeHints::fromModelNode(arg).visibleInNavigator();
|
const bool value = QmlItemNode::isValidQmlItemNode(arg) || NodeHints::fromModelNode(arg).visibleInNavigator();
|
||||||
arg.setAuxiliaryData(auxProp, value);
|
arg.setAuxiliaryDataWithoutLock(auxProp, value);
|
||||||
return value;
|
return value;
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
|
@@ -189,6 +189,7 @@ public:
|
|||||||
|
|
||||||
QVariant auxiliaryData(const PropertyName &name) const;
|
QVariant auxiliaryData(const PropertyName &name) const;
|
||||||
void setAuxiliaryData(const PropertyName &name, const QVariant &data) const;
|
void setAuxiliaryData(const PropertyName &name, const QVariant &data) const;
|
||||||
|
void setAuxiliaryDataWithoutLock(const PropertyName &name, const QVariant &data) const;
|
||||||
void removeAuxiliaryData(const PropertyName &name) const;
|
void removeAuxiliaryData(const PropertyName &name) const;
|
||||||
bool hasAuxiliaryData(const PropertyName &name) const;
|
bool hasAuxiliaryData(const PropertyName &name) const;
|
||||||
const QHash<PropertyName, QVariant> &auxiliaryData() const;
|
const QHash<PropertyName, QVariant> &auxiliaryData() const;
|
||||||
|
@@ -1045,6 +1045,11 @@ void ModelNode::setAuxiliaryData(const PropertyName &name, const QVariant &data)
|
|||||||
m_model.data()->d->setAuxiliaryData(internalNode(), name, data);
|
m_model.data()->d->setAuxiliaryData(internalNode(), name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModelNode::setAuxiliaryDataWithoutLock(const PropertyName &name, const QVariant &data) const
|
||||||
|
{
|
||||||
|
m_model.data()->d->setAuxiliaryData(internalNode(), name, data);
|
||||||
|
}
|
||||||
|
|
||||||
void ModelNode::removeAuxiliaryData(const PropertyName &name) const
|
void ModelNode::removeAuxiliaryData(const PropertyName &name) const
|
||||||
{
|
{
|
||||||
Internal::WriteLocker locker(m_model.data());
|
Internal::WriteLocker locker(m_model.data());
|
||||||
|
@@ -325,25 +325,17 @@ public:
|
|||||||
if (isCheckRunning(documentRevision, position))
|
if (isCheckRunning(documentRevision, position))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
abortHandlers();
|
|
||||||
|
|
||||||
// Update invocation data
|
// Update invocation data
|
||||||
m_documentRevision = documentRevision;
|
m_documentRevision = documentRevision;
|
||||||
m_position = position;
|
m_position = position;
|
||||||
m_callback = callback;
|
m_callback = callback;
|
||||||
|
|
||||||
// Re-initialize process data
|
restart();
|
||||||
m_currentHandlerIndex = 0;
|
|
||||||
m_bestHandler = nullptr;
|
|
||||||
m_highestHandlerPriority = -1;
|
|
||||||
|
|
||||||
// Start checking
|
|
||||||
checkNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCheckRunning(int documentRevision, int position) const
|
bool isCheckRunning(int documentRevision, int position) const
|
||||||
{
|
{
|
||||||
return m_currentHandlerIndex <= m_handlers.size()
|
return m_currentHandlerIndex >= 0
|
||||||
&& m_documentRevision == documentRevision
|
&& m_documentRevision == documentRevision
|
||||||
&& m_position == position;
|
&& m_position == position;
|
||||||
}
|
}
|
||||||
@@ -376,6 +368,7 @@ public:
|
|||||||
checkNext();
|
checkNext();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_currentHandlerIndex = -1;
|
||||||
|
|
||||||
// All were queried, run the best
|
// All were queried, run the best
|
||||||
if (m_bestHandler) {
|
if (m_bestHandler) {
|
||||||
@@ -384,11 +377,36 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handlerRemoved(BaseHoverHandler *handler)
|
||||||
|
{
|
||||||
|
if (m_lastHandlerInfo.handler == handler)
|
||||||
|
m_lastHandlerInfo = LastHandlerInfo();
|
||||||
|
if (m_currentHandlerIndex >= 0)
|
||||||
|
restart();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void abortHandlers()
|
void abortHandlers()
|
||||||
{
|
{
|
||||||
for (BaseHoverHandler *handler : m_handlers)
|
for (BaseHoverHandler *handler : m_handlers)
|
||||||
handler->abort();
|
handler->abort();
|
||||||
|
m_currentHandlerIndex = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void restart()
|
||||||
|
{
|
||||||
|
abortHandlers();
|
||||||
|
|
||||||
|
if (m_handlers.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Re-initialize process data
|
||||||
|
m_currentHandlerIndex = 0;
|
||||||
|
m_bestHandler = nullptr;
|
||||||
|
m_highestHandlerPriority = -1;
|
||||||
|
|
||||||
|
// Start checking
|
||||||
|
checkNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditorWidget *m_widget;
|
TextEditorWidget *m_widget;
|
||||||
@@ -5457,6 +5475,7 @@ void TextEditorWidget::addHoverHandler(BaseHoverHandler *handler)
|
|||||||
void TextEditorWidget::removeHoverHandler(BaseHoverHandler *handler)
|
void TextEditorWidget::removeHoverHandler(BaseHoverHandler *handler)
|
||||||
{
|
{
|
||||||
d->m_hoverHandlers.removeAll(handler);
|
d->m_hoverHandlers.removeAll(handler);
|
||||||
|
d->m_hoverHandlerRunner.handlerRemoved(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
@@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
static char VERSION[] = "Version";
|
static char VERSION[] = "Version";
|
||||||
|
@@ -35,8 +35,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
// CMakeTools file stuff:
|
// CMakeTools file stuff:
|
||||||
const char COUNT[] = "CMakeTools.Count";
|
const char COUNT[] = "CMakeTools.Count";
|
||||||
const char PREFIX[] = "CMakeTools.";
|
const char PREFIX[] = "CMakeTools.";
|
||||||
@@ -92,7 +90,7 @@ bool AddCMakeOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
if (current == "--path") {
|
if (current == "--path") {
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_path = QDir::fromNativeSeparators(next);
|
m_path = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (next.isNull()) {
|
if (next.isNull()) {
|
||||||
@@ -211,7 +209,7 @@ QVariantMap AddCMakeOperation::addCMake(const QVariantMap &map, const QString &i
|
|||||||
data << KeyValuePair({cm, ID_KEY}, QVariant(id));
|
data << KeyValuePair({cm, ID_KEY}, QVariant(id));
|
||||||
data << KeyValuePair({cm, DISPLAYNAME_KEY}, QVariant(displayName));
|
data << KeyValuePair({cm, DISPLAYNAME_KEY}, QVariant(displayName));
|
||||||
data << KeyValuePair({cm, AUTODETECTED_KEY}, QVariant(true));
|
data << KeyValuePair({cm, AUTODETECTED_KEY}, QVariant(true));
|
||||||
data << KeyValuePair({cm, PATH_KEY}, QVariant(path));
|
data << KeyValuePair({cm, PATH_KEY}, Utils::FilePath::fromUserInput(path).toVariant());
|
||||||
KeyValuePairList extraList;
|
KeyValuePairList extraList;
|
||||||
foreach (const KeyValuePair &pair, extra)
|
foreach (const KeyValuePair &pair, extra)
|
||||||
extraList << KeyValuePair(QStringList({cm}) << pair.key, pair.value);
|
extraList << KeyValuePair(QStringList({cm}) << pair.key, pair.value);
|
||||||
|
@@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
const char VERSION[] = "Version";
|
const char VERSION[] = "Version";
|
||||||
@@ -108,7 +106,7 @@ bool AddDebuggerOperation::setArguments(const QStringList &args)
|
|||||||
if (next.isNull())
|
if (next.isNull())
|
||||||
return false;
|
return false;
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_binary = QDir::fromNativeSeparators(next);
|
m_binary = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +211,8 @@ QVariantMap AddDebuggerOperation::addDebugger(const QVariantMap &map,
|
|||||||
|
|
||||||
data << KeyValuePair(QStringList() << debugger << QLatin1String(ABIS), QVariant(abis));
|
data << KeyValuePair(QStringList() << debugger << QLatin1String(ABIS), QVariant(abis));
|
||||||
data << KeyValuePair(QStringList() << debugger << QLatin1String(ENGINE_TYPE), QVariant(engine));
|
data << KeyValuePair(QStringList() << debugger << QLatin1String(ENGINE_TYPE), QVariant(engine));
|
||||||
data << KeyValuePair(QStringList() << debugger << QLatin1String(BINARY), QVariant(binary));
|
data << KeyValuePair(QStringList() << debugger << QLatin1String(BINARY),
|
||||||
|
Utils::FilePath::fromUserInput(binary).toVariant());
|
||||||
|
|
||||||
data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1));
|
data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1));
|
||||||
|
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -185,7 +184,7 @@ bool AddKitOperation::setArguments(const QStringList &args)
|
|||||||
if (next.isNull())
|
if (next.isNull())
|
||||||
return false;
|
return false;
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_sysRoot = QDir::fromNativeSeparators(next);
|
m_sysRoot = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -649,7 +648,7 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
|
|||||||
if (!device.isNull())
|
if (!device.isNull())
|
||||||
data << KeyValuePair({kit, DATA, DEVICE_ID}, QVariant(device));
|
data << KeyValuePair({kit, DATA, DEVICE_ID}, QVariant(device));
|
||||||
if (!sysRoot.isNull())
|
if (!sysRoot.isNull())
|
||||||
data << KeyValuePair({kit, DATA, SYSROOT}, QVariant(sysRoot));
|
data << KeyValuePair({kit, DATA, SYSROOT}, Utils::FilePath::fromUserInput(sysRoot).toVariant());
|
||||||
for (auto i = tcs.constBegin(); i != tcs.constEnd(); ++i)
|
for (auto i = tcs.constBegin(); i != tcs.constEnd(); ++i)
|
||||||
data << KeyValuePair({kit, DATA, TOOLCHAIN, i.key()}, QVariant(i.value()));
|
data << KeyValuePair({kit, DATA, TOOLCHAIN, i.key()}, QVariant(i.value()));
|
||||||
if (!qtId.isNull())
|
if (!qtId.isNull())
|
||||||
|
@@ -33,10 +33,12 @@
|
|||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
// Qt version file stuff:
|
// Qt version file stuff:
|
||||||
const char PREFIX[] = "QtVersion.";
|
const char PREFIX[] = "QtVersion.";
|
||||||
const char VERSION[] = "Version";
|
const char VERSION[] = "Version";
|
||||||
@@ -297,7 +299,7 @@ QVariantMap AddQtOperation::addQt(const QVariantMap &map,
|
|||||||
const QString qt = QString::fromLatin1(PREFIX) + QString::number(versionCount);
|
const QString qt = QString::fromLatin1(PREFIX) + QString::number(versionCount);
|
||||||
|
|
||||||
// Sanitize qmake path:
|
// Sanitize qmake path:
|
||||||
QString saneQmake = QDir::cleanPath(QDir::fromNativeSeparators(qmake));
|
FilePath saneQmake = FilePath::fromUserInput(qmake);
|
||||||
|
|
||||||
// insert data:
|
// insert data:
|
||||||
KeyValuePairList data;
|
KeyValuePairList data;
|
||||||
@@ -305,7 +307,7 @@ QVariantMap AddQtOperation::addQt(const QVariantMap &map,
|
|||||||
data << KeyValuePair(QStringList() << qt << QLatin1String(DISPLAYNAME), QVariant(displayName));
|
data << KeyValuePair(QStringList() << qt << QLatin1String(DISPLAYNAME), QVariant(displayName));
|
||||||
data << KeyValuePair(QStringList() << qt << QLatin1String(AUTODETECTED), QVariant(true));
|
data << KeyValuePair(QStringList() << qt << QLatin1String(AUTODETECTED), QVariant(true));
|
||||||
data << KeyValuePair(QStringList() << qt << QLatin1String(AUTODETECTION_SOURCE), QVariant(sdkId));
|
data << KeyValuePair(QStringList() << qt << QLatin1String(AUTODETECTION_SOURCE), QVariant(sdkId));
|
||||||
data << KeyValuePair(QStringList() << qt << QLatin1String(QMAKE), QVariant(saneQmake));
|
data << KeyValuePair(QStringList() << qt << QLatin1String(QMAKE), saneQmake.toVariant());
|
||||||
data << KeyValuePair(QStringList() << qt << QLatin1String(TYPE), QVariant(type));
|
data << KeyValuePair(QStringList() << qt << QLatin1String(TYPE), QVariant(type));
|
||||||
data << KeyValuePair(QStringList() << qt << ABIS, QVariant(abis));
|
data << KeyValuePair(QStringList() << qt << ABIS, QVariant(abis));
|
||||||
|
|
||||||
|
@@ -35,8 +35,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
// ToolChain file stuff:
|
// ToolChain file stuff:
|
||||||
const char COUNT[] = "ToolChain.Count";
|
const char COUNT[] = "ToolChain.Count";
|
||||||
const char PREFIX[] = "ToolChain.";
|
const char PREFIX[] = "ToolChain.";
|
||||||
@@ -106,7 +104,7 @@ bool AddToolChainOperation::setArguments(const QStringList &args)
|
|||||||
|
|
||||||
if (current == "--path") {
|
if (current == "--path") {
|
||||||
++i; // skip next;
|
++i; // skip next;
|
||||||
m_path = QDir::fromNativeSeparators(next);
|
m_path = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +276,7 @@ QVariantMap AddToolChainOperation::addToolChain(const QVariantMap &map, const QS
|
|||||||
data << KeyValuePair({tc, LANGUAGE_KEY_V2}, QVariant(newLang));
|
data << KeyValuePair({tc, LANGUAGE_KEY_V2}, QVariant(newLang));
|
||||||
data << KeyValuePair({tc, DISPLAYNAME}, QVariant(displayName));
|
data << KeyValuePair({tc, DISPLAYNAME}, QVariant(displayName));
|
||||||
data << KeyValuePair({tc, AUTODETECTED}, QVariant(true));
|
data << KeyValuePair({tc, AUTODETECTED}, QVariant(true));
|
||||||
data << KeyValuePair({tc, PATH}, QVariant(path));
|
data << KeyValuePair({tc, PATH}, Utils::FilePath::fromUserInput(path).toVariant());
|
||||||
data << KeyValuePair({tc, TARGET_ABI}, QVariant(abi));
|
data << KeyValuePair({tc, TARGET_ABI}, QVariant(abi));
|
||||||
QVariantList abis;
|
QVariantList abis;
|
||||||
QStringList abiStrings = supportedAbis.split(',');
|
QStringList abiStrings = supportedAbis.split(',');
|
||||||
|