forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/5.0'
Change-Id: I75aab10a066ce0e2d322663db7723825043fa9c8
This commit is contained in:
21
.github/workflows/build_cmake.yml
vendored
21
.github/workflows/build_cmake.yml
vendored
@@ -455,6 +455,11 @@ jobs:
|
|||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||||
string(REPLACE "x86" "x64" Python3_EXECUTABLE "${Python3_EXECUTABLE}")
|
string(REPLACE "x86" "x64" Python3_EXECUTABLE "${Python3_EXECUTABLE}")
|
||||||
|
|
||||||
|
set(WITH_TESTS "--with-tests")
|
||||||
|
if (${{github.ref}} MATCHES "tags/v")
|
||||||
|
unset(WITH_TESTS)
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND python
|
COMMAND python
|
||||||
-u
|
-u
|
||||||
@@ -465,7 +470,7 @@ jobs:
|
|||||||
--qt-path "${{ steps.qt.outputs.qt_dir }}"
|
--qt-path "${{ steps.qt.outputs.qt_dir }}"
|
||||||
--llvm-path "${{ steps.libclang.outputs.libclang_dir }}"
|
--llvm-path "${{ steps.libclang.outputs.libclang_dir }}"
|
||||||
--python3 "${Python3_EXECUTABLE}"
|
--python3 "${Python3_EXECUTABLE}"
|
||||||
--with-tests
|
${WITH_TESTS}
|
||||||
${CDB_OPTION}
|
${CDB_OPTION}
|
||||||
${ELFUTILS_OPTION}
|
${ELFUTILS_OPTION}
|
||||||
--add-config=-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
--add-config=-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||||
@@ -597,12 +602,10 @@ jobs:
|
|||||||
config:
|
config:
|
||||||
- {
|
- {
|
||||||
name: "Windows Latest MSVC", artifact: "Windows-MSVC",
|
name: "Windows Latest MSVC", artifact: "Windows-MSVC",
|
||||||
is_msvc: true,
|
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
name: "Windows Latest MinGW", artifact: "Windows-MinGW",
|
name: "Windows Latest MinGW", artifact: "Windows-MinGW",
|
||||||
is_msvc: false,
|
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
}
|
}
|
||||||
- {
|
- {
|
||||||
@@ -629,21 +632,21 @@ jobs:
|
|||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- name: Download wininterrupt artifact
|
- name: Download wininterrupt artifact
|
||||||
if: runner.os == 'Windows'
|
if: contains(matrix.config.artifact, 'Windows')
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- name: Download qtcreatorcdbext artifact
|
- name: Download qtcreatorcdbext artifact
|
||||||
if: runner.os == 'Windows' && matrix.config.is_msvc
|
if: matrix.config.artifact == 'Windows-MSVC'
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- name: Download disk image artifact
|
- name: Download disk image artifact
|
||||||
if: runner.os == 'macOS'
|
if: matrix.config.artifact == 'macOS'
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg
|
name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg
|
||||||
@@ -680,7 +683,7 @@ jobs:
|
|||||||
asset_content_type: application/x-gtar
|
asset_content_type: application/x-gtar
|
||||||
|
|
||||||
- name: Upload wininterrupt to Release
|
- name: Upload wininterrupt to Release
|
||||||
if: runner.os == 'Windows'
|
if: contains(matrix.config.artifact, 'Windows')
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -691,7 +694,7 @@ jobs:
|
|||||||
asset_content_type: application/x-gtar
|
asset_content_type: application/x-gtar
|
||||||
|
|
||||||
- name: Upload qtcreatorcdbext to Release
|
- name: Upload qtcreatorcdbext to Release
|
||||||
if: runner.os == 'Windows' && matrix.config.is_msvc
|
if: matrix.config.artifact == 'Windows-MSVC'
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -702,7 +705,7 @@ jobs:
|
|||||||
asset_content_type: application/x-gtar
|
asset_content_type: application/x-gtar
|
||||||
|
|
||||||
- name: Upload disk image to Release
|
- name: Upload disk image to Release
|
||||||
if: runner.os == 'macOS'
|
if: matrix.config.artifact == 'macOS'
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@@ -353,7 +353,7 @@ we thank the authors who made this possible:
|
|||||||
|
|
||||||
Roberto Raggi <roberto.raggi@gmail.com>
|
Roberto Raggi <roberto.raggi@gmail.com>
|
||||||
|
|
||||||
QtCreator/src/shared/cplusplus
|
QtCreator/src/libs/3rdparty/cplusplus
|
||||||
|
|
||||||
Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
|
Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
|
||||||
|
|
||||||
|
@@ -441,7 +441,7 @@
|
|||||||
\li \b{Open Source front-end for C++ (license MIT)}, enhanced for use
|
\li \b{Open Source front-end for C++ (license MIT)}, enhanced for use
|
||||||
in \QC.\br
|
in \QC.\br
|
||||||
Roberto Raggi <roberto.raggi@gmail.com>\br
|
Roberto Raggi <roberto.raggi@gmail.com>\br
|
||||||
QtCreator/src/shared/cplusplus\br\br
|
QtCreator/src/libs/3rdparty/cplusplus\br\br
|
||||||
|
|
||||||
\li \b{ANGLE Library (Windows)}
|
\li \b{ANGLE Library (Windows)}
|
||||||
|
|
||||||
|
@@ -303,38 +303,59 @@ SecondColumnLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This connection is meant to update the popups y-position and the main scrollviews
|
||||||
|
// height as soon as the height of the color picker changes. Initially the height of the
|
||||||
|
// color picker is 0 until its completion is done.
|
||||||
|
Connections {
|
||||||
|
target: colorPicker
|
||||||
|
function onHeightChanged() {
|
||||||
|
cePopup.setPopupY()
|
||||||
|
cePopup.setMainScrollViewHeight()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onOpened: {
|
onOpened: {
|
||||||
|
cePopup.setPopupY()
|
||||||
|
cePopup.setMainScrollViewHeight()
|
||||||
|
}
|
||||||
|
onYChanged: cePopup.setMainScrollViewHeight()
|
||||||
|
onHeightChanged: cePopup.setMainScrollViewHeight()
|
||||||
|
|
||||||
|
function setMainScrollViewHeight() {
|
||||||
if (Controller.mainScrollView === null)
|
if (Controller.mainScrollView === null)
|
||||||
return
|
return
|
||||||
|
|
||||||
var mapped = preview.mapToItem(Controller.mainScrollView.contentItem, cePopup.x, cePopup.y)
|
var mapped = preview.mapToItem(Controller.mainScrollView.contentItem, cePopup.x, cePopup.y)
|
||||||
Controller.mainScrollView.temporaryHeight = mapped.y + cePopup.height + 20
|
Controller.mainScrollView.temporaryHeight = mapped.y + cePopup.height
|
||||||
|
+ StudioTheme.Values.colorEditorPopupMargin
|
||||||
}
|
}
|
||||||
|
|
||||||
onHeightChanged: {
|
function setPopupY() {
|
||||||
if (Controller.mainScrollView === null)
|
if (Controller.mainScrollView === null)
|
||||||
return
|
return
|
||||||
|
|
||||||
var mapped = preview.mapToItem(Controller.mainScrollView.contentItem, cePopup.x, cePopup.y)
|
var tmp = preview.mapToItem(Controller.mainScrollView.contentItem, preview.x, preview.y)
|
||||||
Controller.mainScrollView.temporaryHeight = mapped.y + cePopup.height + 20
|
cePopup.y = Math.max(-tmp.y + StudioTheme.Values.colorEditorPopupMargin,
|
||||||
|
cePopup.__defaultY)
|
||||||
}
|
}
|
||||||
|
|
||||||
onClosed: {
|
onClosed: Controller.mainScrollView.temporaryHeight = 0
|
||||||
Controller.mainScrollView.temporaryHeight = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
x: - StudioTheme.Values.colorEditorPopupWidth * 0.5
|
property real __defaultX: - StudioTheme.Values.colorEditorPopupWidth * 0.5
|
||||||
+ preview.width * 0.5
|
+ preview.width * 0.5
|
||||||
y: - StudioTheme.Values.colorEditorPopupMargin
|
property real __defaultY: - StudioTheme.Values.colorEditorPopupPadding
|
||||||
- (StudioTheme.Values.colorEditorPopupSpacing * 2)
|
- (StudioTheme.Values.colorEditorPopupSpacing * 2)
|
||||||
- StudioTheme.Values.defaultControlHeight
|
- StudioTheme.Values.defaultControlHeight
|
||||||
- StudioTheme.Values.colorEditorPopupLineHeight
|
- StudioTheme.Values.colorEditorPopupLineHeight
|
||||||
- colorPicker.height * 0.5
|
- colorPicker.height * 0.5
|
||||||
+ preview.height * 0.5
|
+ preview.height * 0.5
|
||||||
|
|
||||||
|
x: cePopup.__defaultX
|
||||||
|
y: cePopup.__defaultY
|
||||||
|
|
||||||
width: StudioTheme.Values.colorEditorPopupWidth
|
width: StudioTheme.Values.colorEditorPopupWidth
|
||||||
height: colorColumn.height + sectionColumn.height
|
height: colorColumn.height + sectionColumn.height
|
||||||
+ StudioTheme.Values.colorEditorPopupMargin + 2 // TODO magic number
|
+ StudioTheme.Values.colorEditorPopupPadding + 2 // TODO magic number
|
||||||
|
|
||||||
padding: StudioTheme.Values.border
|
padding: StudioTheme.Values.border
|
||||||
margins: -1 // If not defined margin will be -1
|
margins: -1 // If not defined margin will be -1
|
||||||
@@ -353,7 +374,7 @@ SecondColumnLayout {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.margins: StudioTheme.Values.colorEditorPopupMargin
|
anchors.margins: StudioTheme.Values.colorEditorPopupPadding
|
||||||
spacing: StudioTheme.Values.colorEditorPopupSpacing
|
spacing: StudioTheme.Values.colorEditorPopupSpacing
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
@@ -714,7 +735,7 @@ SecondColumnLayout {
|
|||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: sectionColumn
|
id: sectionColumn
|
||||||
anchors.topMargin: StudioTheme.Values.colorEditorPopupMargin
|
anchors.topMargin: StudioTheme.Values.colorEditorPopupPadding
|
||||||
anchors.top: colorColumn.bottom
|
anchors.top: colorColumn.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@@ -27,57 +27,57 @@ import QtQuick 2.15
|
|||||||
import StudioTheme 1.0 as StudioTheme
|
import StudioTheme 1.0 as StudioTheme
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: innerObject
|
id: root
|
||||||
|
|
||||||
property variant backendValue
|
property variant backendValue
|
||||||
property color textColor: StudioTheme.Values.themeTextColor
|
property color textColor: StudioTheme.Values.themeTextColor
|
||||||
property variant valueFromBackend: backendValue === undefined ? 0 : backendValue.value
|
property variant valueFromBackend: root.backendValue === undefined ? 0 : root.backendValue.value
|
||||||
property bool baseStateFlag: isBaseState
|
property bool baseStateFlag: isBaseState
|
||||||
property bool isInModel: {
|
property bool isInModel: {
|
||||||
if (backendValue !== undefined && backendValue.isInModel !== undefined)
|
if (root.backendValue !== undefined && root.backendValue.isInModel !== undefined)
|
||||||
return backendValue.isInModel
|
return root.backendValue.isInModel
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
property bool isInSubState: {
|
property bool isInSubState: {
|
||||||
if (backendValue !== undefined && backendValue.isInSubState !== undefined)
|
if (root.backendValue !== undefined && root.backendValue.isInSubState !== undefined)
|
||||||
return backendValue.isInSubState
|
return root.backendValue.isInSubState
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
property bool highlight: textColor === __changedTextColor
|
property bool highlight: root.textColor === root.__changedTextColor
|
||||||
property bool errorState: false
|
property bool errorState: false
|
||||||
|
|
||||||
readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor
|
readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor
|
||||||
readonly property color __changedTextColor: StudioTheme.Values.themeInteraction
|
readonly property color __changedTextColor: StudioTheme.Values.themeInteraction
|
||||||
readonly property color __errorTextColor: StudioTheme.Values.themeError
|
readonly property color __errorTextColor: StudioTheme.Values.themeError
|
||||||
|
|
||||||
onBackendValueChanged: evaluate()
|
onBackendValueChanged: root.evaluate()
|
||||||
onValueFromBackendChanged: evaluate()
|
onValueFromBackendChanged: root.evaluate()
|
||||||
onBaseStateFlagChanged: evaluate()
|
onBaseStateFlagChanged: root.evaluate()
|
||||||
onIsInModelChanged: evaluate()
|
onIsInModelChanged: root.evaluate()
|
||||||
onIsInSubStateChanged: evaluate()
|
onIsInSubStateChanged: root.evaluate()
|
||||||
onErrorStateChanged: evaluate()
|
onErrorStateChanged: root.evaluate()
|
||||||
|
|
||||||
function evaluate() {
|
function evaluate() {
|
||||||
if (innerObject.backendValue === undefined)
|
if (root.backendValue === undefined)
|
||||||
return
|
return
|
||||||
|
|
||||||
if (innerObject.errorState) {
|
if (root.errorState) {
|
||||||
innerObject.textColor = __errorTextColor
|
root.textColor = root.__errorTextColor
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (innerObject.baseStateFlag) {
|
if (root.baseStateFlag) {
|
||||||
if (innerObject.backendValue.isInModel)
|
if (root.backendValue.isInModel)
|
||||||
innerObject.textColor = __changedTextColor
|
root.textColor = root.__changedTextColor
|
||||||
else
|
else
|
||||||
innerObject.textColor = __defaultTextColor
|
root.textColor = root.__defaultTextColor
|
||||||
} else {
|
} else {
|
||||||
if (innerObject.backendValue.isInSubState)
|
if (root.backendValue.isInSubState)
|
||||||
innerObject.textColor = StudioTheme.Values.themeChangedStateText
|
root.textColor = StudioTheme.Values.themeChangedStateText
|
||||||
else
|
else
|
||||||
innerObject.textColor = __defaultTextColor
|
root.textColor = root.__defaultTextColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -185,9 +185,10 @@ QtObject {
|
|||||||
// Color Editor Popup
|
// Color Editor Popup
|
||||||
property real colorEditorPopupWidth: 4 * values.colorEditorPopupSpinBoxWidth
|
property real colorEditorPopupWidth: 4 * values.colorEditorPopupSpinBoxWidth
|
||||||
+ 3 * values.controlGap
|
+ 3 * values.controlGap
|
||||||
+ 2 * values.colorEditorPopupMargin
|
+ 2 * values.colorEditorPopupPadding
|
||||||
property real colorEditorPopupHeight: 800
|
property real colorEditorPopupHeight: 800
|
||||||
property real colorEditorPopupMargin: 10
|
property real colorEditorPopupPadding: 10
|
||||||
|
property real colorEditorPopupMargin: 20
|
||||||
|
|
||||||
property real colorEditorPopupSpacing: 10
|
property real colorEditorPopupSpacing: 10
|
||||||
property real colorEditorPopupLineHeight: 60
|
property real colorEditorPopupLineHeight: 60
|
||||||
|
1
src/libs/3rdparty/sqlite/config.h
vendored
1
src/libs/3rdparty/sqlite/config.h
vendored
@@ -88,3 +88,4 @@
|
|||||||
#define SQLITE_OMIT_EXPLAIN 1
|
#define SQLITE_OMIT_EXPLAIN 1
|
||||||
#define SQLITE_OMIT_TRACE 1
|
#define SQLITE_OMIT_TRACE 1
|
||||||
#define SQLITE_DEFAULT_LOCKING_MODE 1
|
#define SQLITE_DEFAULT_LOCKING_MODE 1
|
||||||
|
#define SQLITE_WIN32_GETVERSIONEX 0
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/htmldocextractor.h>
|
#include <utils/htmldocextractor.h>
|
||||||
|
|
||||||
|
#include <QVersionNumber>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
HelpItem::HelpItem() = default;
|
HelpItem::HelpItem() = default;
|
||||||
@@ -165,31 +167,66 @@ QString HelpItem::extractContent(bool extended) const
|
|||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::pair<QUrl, int> extractVersion(const QUrl &url)
|
// The following is only correct under the specific current conditions, and it will
|
||||||
|
// always be quite some guessing as long as the version information does not
|
||||||
|
// include separators for major vs minor vs patch version.
|
||||||
|
static QVersionNumber qtVersionHeuristic(const QString &digits)
|
||||||
|
{
|
||||||
|
if (digits.count() > 6 || digits.count() < 3)
|
||||||
|
return {}; // suspicious version number
|
||||||
|
|
||||||
|
for (const QChar &digit : digits)
|
||||||
|
if (!digit.isDigit())
|
||||||
|
return {}; // we should have only digits
|
||||||
|
|
||||||
|
// When we have 3 digits, we split it like: ABC -> A.B.C
|
||||||
|
// When we have 4 digits, we split it like: ABCD -> A.BC.D
|
||||||
|
// When we have 5 digits, we split it like: ABCDE -> A.BC.DE
|
||||||
|
// When we have 6 digits, we split it like: ABCDEF -> AB.CD.EF
|
||||||
|
switch (digits.count()) {
|
||||||
|
case 3:
|
||||||
|
return QVersionNumber(digits.mid(0, 1).toInt(),
|
||||||
|
digits.mid(1, 1).toInt(),
|
||||||
|
digits.mid(2, 1).toInt());
|
||||||
|
case 4:
|
||||||
|
return QVersionNumber(digits.mid(0, 1).toInt(),
|
||||||
|
digits.mid(1, 2).toInt(),
|
||||||
|
digits.mid(3, 1).toInt());
|
||||||
|
case 5:
|
||||||
|
return QVersionNumber(digits.mid(0, 1).toInt(),
|
||||||
|
digits.mid(1, 2).toInt(),
|
||||||
|
digits.mid(3, 2).toInt());
|
||||||
|
case 6:
|
||||||
|
return QVersionNumber(digits.mid(0, 2).toInt(),
|
||||||
|
digits.mid(2, 2).toInt(),
|
||||||
|
digits.mid(4, 2).toInt());
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::pair<QUrl, QVersionNumber> extractVersion(const QUrl &url)
|
||||||
{
|
{
|
||||||
const QString host = url.host();
|
const QString host = url.host();
|
||||||
const QStringList hostParts = host.split('.');
|
const QStringList hostParts = host.split('.');
|
||||||
if (hostParts.size() == 4 && (host.startsWith("com.trolltech.")
|
if (hostParts.size() == 4 && (host.startsWith("com.trolltech.")
|
||||||
|| host.startsWith("org.qt-project."))) {
|
|| host.startsWith("org.qt-project."))) {
|
||||||
bool ok = false;
|
const QVersionNumber version = qtVersionHeuristic(hostParts.at(3));
|
||||||
// the following is only correct under the specific current conditions, and it will
|
if (!version.isNull()) {
|
||||||
// always be quite some guessing as long as the version information does not
|
|
||||||
// include separators for major vs minor vs patch version
|
|
||||||
const int version = hostParts.at(3).toInt(&ok);
|
|
||||||
if (ok) {
|
|
||||||
QUrl urlWithoutVersion(url);
|
QUrl urlWithoutVersion(url);
|
||||||
urlWithoutVersion.setHost(hostParts.mid(0, 3).join('.'));
|
urlWithoutVersion.setHost(hostParts.mid(0, 3).join('.'));
|
||||||
return {urlWithoutVersion, version};
|
return {urlWithoutVersion, version};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {url, 0};
|
return {url, {}};
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort primary by "url without version" and seconday by "version"
|
// sort primary by "url without version" and seconday by "version"
|
||||||
static bool helpUrlLessThan(const QUrl &a, const QUrl &b)
|
static bool helpUrlLessThan(const QUrl &a, const QUrl &b)
|
||||||
{
|
{
|
||||||
const std::pair<QUrl, int> va = extractVersion(a);
|
const std::pair<QUrl, QVersionNumber> va = extractVersion(a);
|
||||||
const std::pair<QUrl, int> vb = extractVersion(b);
|
const std::pair<QUrl, QVersionNumber> vb = extractVersion(b);
|
||||||
const QString sa = va.first.toString();
|
const QString sa = va.first.toString();
|
||||||
const QString sb = vb.first.toString();
|
const QString sb = vb.first.toString();
|
||||||
if (sa == sb)
|
if (sa == sb)
|
||||||
@@ -260,10 +297,10 @@ static const HelpItem::Links getBestLink(const HelpItem::Links &links)
|
|||||||
// This is to ensure that if we succeeded with an ID lookup, and we have e.g. Qt5 and Qt4
|
// This is to ensure that if we succeeded with an ID lookup, and we have e.g. Qt5 and Qt4
|
||||||
// documentation, that we only return the Qt5 link even though the Qt5 and Qt4 URLs look
|
// documentation, that we only return the Qt5 link even though the Qt5 and Qt4 URLs look
|
||||||
// different.
|
// different.
|
||||||
int highestVersion = -1;
|
QVersionNumber highestVersion;
|
||||||
HelpItem::Link bestLink;
|
HelpItem::Link bestLink;
|
||||||
for (const HelpItem::Link &link : links) {
|
for (const HelpItem::Link &link : links) {
|
||||||
const int version = extractVersion(link.second).second;
|
const QVersionNumber version = extractVersion(link.second).second;
|
||||||
if (version > highestVersion) {
|
if (version > highestVersion) {
|
||||||
highestVersion = version;
|
highestVersion = version;
|
||||||
bestLink = link;
|
bestLink = link;
|
||||||
|
@@ -33,7 +33,8 @@
|
|||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/filepath.h>
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
|
|
||||||
@@ -269,14 +271,51 @@ void TestQtProjectImporter::deleteDirectoryData(void *directoryData) const
|
|||||||
delete static_cast<DirectoryData *>(directoryData);
|
delete static_cast<DirectoryData *>(directoryData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QStringList additionalFilesToCopy(const BaseQtVersion *qt)
|
||||||
|
{
|
||||||
|
// This is a hack and only works with local, "standard" installations of Qt
|
||||||
|
const int major = qt->qtVersion().majorVersion;
|
||||||
|
if (major >= 6) {
|
||||||
|
if (HostOsInfo::isMacHost()) {
|
||||||
|
return {"lib/QtCore.framework/Versions/A/QtCore"};
|
||||||
|
} else if (HostOsInfo::isWindowsHost()) {
|
||||||
|
const QString release = QString("bin/Qt%1Core.dll").arg(major);
|
||||||
|
const QString debug = QString("bin/Qt%1Cored.dll").arg(major);
|
||||||
|
const FilePath base = qt->qmakeFilePath().parentDir().parentDir();
|
||||||
|
if (base.pathAppended(release).exists())
|
||||||
|
return {release};
|
||||||
|
if (base.pathAppended(debug).exists())
|
||||||
|
return {debug};
|
||||||
|
return {release};
|
||||||
|
} else if (HostOsInfo::isLinuxHost()) {
|
||||||
|
const QString core = QString("lib/libQt%1Core.so.%1").arg(major);
|
||||||
|
const QDir base(qt->qmakeFilePath().parentDir().parentDir().pathAppended("lib").toString());
|
||||||
|
const QStringList icuLibs = Utils::transform(base.entryList({"libicu*.so.*"}), [](const QString &lib) { return QString("lib/" + lib); });
|
||||||
|
return QStringList(core) + icuLibs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
static Utils::FilePath setupQmake(const BaseQtVersion *qt, const QString &path)
|
static Utils::FilePath setupQmake(const BaseQtVersion *qt, const QString &path)
|
||||||
{
|
{
|
||||||
const QFileInfo fi = QFileInfo(qt->qmakeFilePath().toFileInfo().canonicalFilePath());
|
// This is a hack and only works with local, "standard" installations of Qt
|
||||||
const QString qmakeFile = path + "/" + fi.fileName();
|
const FilePath qmake = qt->qmakeFilePath().canonicalPath();
|
||||||
if (!QFile::copy(fi.absoluteFilePath(), qmakeFile))
|
const QString qmakeFile = "bin/" + qmake.fileName();
|
||||||
return Utils::FilePath();
|
const FilePath source = qmake.parentDir().parentDir();
|
||||||
|
const FilePath target = FilePath::fromString(path);
|
||||||
|
|
||||||
return Utils::FilePath::fromString(qmakeFile);
|
const QStringList filesToCopy = QStringList(qmakeFile) + additionalFilesToCopy(qt);
|
||||||
|
for (const QString &file : filesToCopy) {
|
||||||
|
const FilePath sourceFile = source.pathAppended(file);
|
||||||
|
const FilePath targetFile = target.pathAppended(file);
|
||||||
|
if (!targetFile.parentDir().ensureWritableDir() || !sourceFile.copyFile(targetFile)) {
|
||||||
|
qDebug() << "Failed to copy" << sourceFile.toString() << "to" << targetFile.toString();
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return target.pathAppended(qmakeFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtSupportPlugin::testQtProjectImporter_oneProject_data()
|
void QtSupportPlugin::testQtProjectImporter_oneProject_data()
|
||||||
|
Submodule src/shared/qbs updated: 351461d368...27bd9ac836
Reference in New Issue
Block a user