forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/5.0'
Change-Id: If0cbc808d2c466aee81a77b3c078bac7a3d1e4cb
This commit is contained in:
@@ -77,8 +77,15 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
DesignerSupport::polishItems(quickWindow());
|
||||
|
||||
if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) {
|
||||
bool windowDirty = false;
|
||||
foreach (QQuickItem *item, allItems()) {
|
||||
if (item) {
|
||||
if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
|
||||
if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) {
|
||||
windowDirty = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (hasInstanceForObject(item)) {
|
||||
if (DesignerSupport::isDirty(item, DesignerSupport::ContentUpdateMask))
|
||||
m_dirtyInstanceSet.insert(instanceForObject(item));
|
||||
@@ -90,6 +97,7 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
Internal::QuickItemNodeInstance::updateDirtyNode(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clearChangedPropertyList();
|
||||
|
||||
@@ -97,6 +105,7 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
/* QQuickItem::grabToImage render path */
|
||||
/* TODO implement QQuickItem::grabToImage based rendering */
|
||||
/* sheduleRootItemRender(); */
|
||||
if (windowDirty)
|
||||
nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()}));
|
||||
} else {
|
||||
if (!m_dirtyInstanceSet.isEmpty()) {
|
||||
|
@@ -281,6 +281,12 @@ SecondColumnLayout {
|
||||
T.Popup {
|
||||
id: cePopup
|
||||
|
||||
WheelHandler {
|
||||
onWheel: function(event) {
|
||||
Controller.mainScrollView.flick(0, event.angleDelta.y * 5)
|
||||
}
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
if (Controller.mainScrollView === null)
|
||||
return
|
||||
|
@@ -61,7 +61,7 @@ Item {
|
||||
extendedFunctionButton.color = StudioTheme.Values.themeInteraction
|
||||
}
|
||||
} else {
|
||||
if (backendValue.complexNode !== null
|
||||
if (backendValue.complexNode !== undefined
|
||||
&& backendValue.complexNode.exists) {
|
||||
|
||||
} else {
|
||||
|
@@ -42,7 +42,7 @@ Item {
|
||||
function updatePos() {
|
||||
if (root.maximum > root.minimum) {
|
||||
var pos = (track.width - handle.width) * (root.value - root.minimum) / (root.maximum - root.minimum)
|
||||
return Math.min(Math.max(pos, 0), track.width - 8)
|
||||
return Math.min(Math.max(pos, 0), track.width - handle.width)
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
@@ -74,20 +74,24 @@ Item {
|
||||
Rectangle {
|
||||
id: handle
|
||||
width: StudioTheme.Values.hueSliderHandleWidth
|
||||
height: track.height
|
||||
height: track.height - 4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
smooth: true
|
||||
opacity: 0.9
|
||||
color: "transparent"
|
||||
radius: 2
|
||||
border.color: "black"
|
||||
border.width: 1
|
||||
x: root.updatePos()
|
||||
y: 2
|
||||
z: 1
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {color: "#2c2c2c" ; position: 0}
|
||||
GradientStop {color: "#343434" ; position: 0.15}
|
||||
GradientStop {color: "#373737" ; position: 1.0}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
color: "transparent"
|
||||
radius: 1
|
||||
border.color: "white"
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ Item {
|
||||
function updatePos() {
|
||||
if (root.maximum > root.minimum) {
|
||||
var pos = (track.width - handle.width) * (root.value - root.minimum) / (root.maximum - root.minimum)
|
||||
return Math.min(Math.max(pos, 0), track.width - 8)
|
||||
return Math.min(Math.max(pos, 0), track.width - handle.width)
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
@@ -77,20 +77,24 @@ Item {
|
||||
Rectangle {
|
||||
id: handle
|
||||
width: StudioTheme.Values.hueSliderHandleWidth
|
||||
height: track.height
|
||||
height: track.height - 4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
smooth: true
|
||||
opacity: 0.9
|
||||
color: "transparent"
|
||||
radius: 2
|
||||
border.color: "black"
|
||||
border.width: 1
|
||||
x: root.updatePos()
|
||||
y: 2
|
||||
z: 1
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {color: "#2c2c2c" ; position: 0}
|
||||
GradientStop {color: "#343434" ; position: 0.15}
|
||||
GradientStop {color: "#373737" ; position: 1.0}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
color: "transparent"
|
||||
radius: 1
|
||||
border.color: "white"
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -214,8 +214,10 @@ TextInput {
|
||||
}
|
||||
|
||||
onWheel: function(wheel) {
|
||||
if (!myControl.__wheelEnabled)
|
||||
if (!myControl.__wheelEnabled) {
|
||||
wheel.accepted = false
|
||||
return
|
||||
}
|
||||
|
||||
// Set stepSize according to used modifier key
|
||||
if (wheel.modifiers & Qt.ControlModifier)
|
||||
|
@@ -4,10 +4,10 @@ project(%{TestCaseName} LANGUAGES CXX)
|
||||
|
||||
@if "%{TestFrameWork}" == "QtTest"
|
||||
@if "%{RequireGUI}" == "true"
|
||||
find_package(QT NAMES Qt5 Qt6 COMPONENTS Gui Test REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui Test REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui Test REQUIRED)
|
||||
@else
|
||||
find_package(QT NAMES Qt5 Qt6 COMPONENTS Test REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Test REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED)
|
||||
@endif
|
||||
|
||||
@@ -32,7 +32,7 @@ target_link_libraries(%{TestCaseName} PRIVATE Qt${QT_VERSION_MAJOR}::Test)
|
||||
|
||||
@endif
|
||||
@if "%{TestFrameWork}" == "QtQuickTest"
|
||||
find_package(QT NAMES Qt5 Qt6 COMPONENTS QuickTest REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS QuickTest REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickTest REQUIRED)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
@@ -123,7 +123,7 @@ endif ()
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
@if "%{Catch2NeedsQt}" == "true"
|
||||
find_package(QT NAMES Qt5 Qt6 COMPONENTS Gui REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED)
|
||||
@endif
|
||||
|
||||
|
@@ -88,9 +88,8 @@ void FileInProjectFinder::setProjectDirectory(const FilePath &absoluteProjectPat
|
||||
if (absoluteProjectPath == m_projectDir)
|
||||
return;
|
||||
|
||||
const QFileInfo infoPath = absoluteProjectPath.toFileInfo();
|
||||
QTC_CHECK(absoluteProjectPath.isEmpty()
|
||||
|| (infoPath.exists() && infoPath.isAbsolute()));
|
||||
|| (absoluteProjectPath.exists() && absoluteProjectPath.isAbsolutePath()));
|
||||
|
||||
m_projectDir = absoluteProjectPath;
|
||||
m_cache.clear();
|
||||
|
@@ -388,8 +388,6 @@ bool FilePath::isRelativePath() const
|
||||
|
||||
FilePath FilePath::resolvePath(const QString &fileName) const
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
return {}; // FIXME: Isn't this odd?
|
||||
if (FileUtils::isAbsolutePath(fileName))
|
||||
return FilePath::fromString(QDir::cleanPath(fileName));
|
||||
return FilePath::fromString(QDir::cleanPath(toString() + QLatin1Char('/') + fileName));
|
||||
|
@@ -582,7 +582,7 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const
|
||||
}
|
||||
break;
|
||||
case PathChooser::Directory:
|
||||
if (filePath.isDir()) {
|
||||
if (filePath.exists() && !filePath.isDir()) {
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput());
|
||||
return false;
|
||||
|
@@ -42,7 +42,7 @@ Utils::FilePath TestOutputReader::constructSourceFilePath(const Utils::FilePath
|
||||
const QString &file)
|
||||
{
|
||||
const Utils::FilePath filePath = path.resolvePath(file);
|
||||
return filePath.exists() ? filePath : Utils::FilePath();
|
||||
return filePath.isReadableFile() ? filePath : Utils::FilePath();
|
||||
}
|
||||
|
||||
TestOutputReader::TestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface,
|
||||
|
@@ -277,9 +277,10 @@ void CMakeKitAspect::setup(Kit *k)
|
||||
return;
|
||||
|
||||
// Look for a suitable auto-detected one:
|
||||
const QString id = k->autoDetectionSource();
|
||||
const QString kitSource = k->autoDetectionSource();
|
||||
for (CMakeTool *tool : CMakeToolManager::cmakeTools()) {
|
||||
if (tool->detectionSource() == id) {
|
||||
const QString toolSource = tool->detectionSource();
|
||||
if (!toolSource.isEmpty() && toolSource == kitSource) {
|
||||
setCMakeTool(k, tool->id());
|
||||
return;
|
||||
}
|
||||
@@ -1043,8 +1044,6 @@ CMakeConfig CMakeConfigurationKitAspect::defaultConfiguration(const Kit *k)
|
||||
|
||||
QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const
|
||||
{
|
||||
Q_UNUSED(k)
|
||||
|
||||
// FIXME: Convert preload scripts
|
||||
CMakeConfig config = defaultConfiguration(k);
|
||||
const QStringList tmp
|
||||
|
@@ -110,6 +110,7 @@ public:
|
||||
, m_executable(item->filePath())
|
||||
, m_qchFile(item->qchFilePath())
|
||||
, m_versionDisplay(item->versionDisplay())
|
||||
, m_detectionSource(item->detectionSource())
|
||||
, m_isAutoRun(item->isAutoRun())
|
||||
, m_autodetected(item->isAutoDetected())
|
||||
, m_isSupported(item->hasFileApi())
|
||||
@@ -145,9 +146,10 @@ public:
|
||||
cmake.setFilePath(m_executable);
|
||||
m_isSupported = cmake.hasFileApi();
|
||||
|
||||
m_tooltip = tr("Version: %1<br>Supports fileApi: %2")
|
||||
.arg(cmake.versionDisplay())
|
||||
.arg(cmake.hasFileApi() ? tr("yes") : tr("no"));
|
||||
m_tooltip = tr("Version: %1").arg(cmake.versionDisplay());
|
||||
m_tooltip += "<br>" + tr("Supports fileApi: %1").arg(m_isSupported ? tr("yes") : tr("no"));
|
||||
m_tooltip += "<br>" + tr("Detection source: \"%1\"").arg(m_detectionSource);
|
||||
|
||||
m_versionDisplay = cmake.versionDisplay();
|
||||
}
|
||||
|
||||
@@ -223,6 +225,7 @@ public:
|
||||
FilePath m_executable;
|
||||
FilePath m_qchFile;
|
||||
QString m_versionDisplay;
|
||||
QString m_detectionSource;
|
||||
bool m_isAutoRun = true;
|
||||
bool m_pathExists = false;
|
||||
bool m_pathIsFile = false;
|
||||
@@ -362,6 +365,7 @@ void CMakeToolItemModel::apply()
|
||||
cmake->setDisplayName(item->m_name);
|
||||
cmake->setFilePath(item->m_executable);
|
||||
cmake->setQchFilePath(item->m_qchFile);
|
||||
cmake->setDetectionSource(item->m_detectionSource);
|
||||
cmake->setAutorun(item->m_isAutoRun);
|
||||
} else {
|
||||
toRegister.append(item);
|
||||
@@ -375,6 +379,7 @@ void CMakeToolItemModel::apply()
|
||||
cmake->setDisplayName(item->m_name);
|
||||
cmake->setFilePath(item->m_executable);
|
||||
cmake->setQchFilePath(item->m_qchFile);
|
||||
cmake->setDetectionSource(item->m_detectionSource);
|
||||
if (!CMakeToolManager::registerCMakeTool(std::move(cmake)))
|
||||
item->m_changed = true;
|
||||
}
|
||||
|
@@ -53,6 +53,7 @@ const char CMAKE_INFORMATION_QCH_FILE_PATH[] = "QchFile";
|
||||
// obsolete since Qt Creator 5. Kept for backward compatibility
|
||||
const char CMAKE_INFORMATION_AUTO_CREATE_BUILD_DIRECTORY[] = "AutoCreateBuildDirectory";
|
||||
const char CMAKE_INFORMATION_AUTODETECTED[] = "AutoDetected";
|
||||
const char CMAKE_INFORMATION_DETECTIONSOURCE[] = "DetectionSource";
|
||||
const char CMAKE_INFORMATION_READERTYPE[] = "ReaderType";
|
||||
|
||||
bool CMakeTool::Generator::matches(const QString &n, const QString &ex) const
|
||||
@@ -132,6 +133,7 @@ CMakeTool::CMakeTool(const QVariantMap &map, bool fromSdk) :
|
||||
//loading a CMakeTool from SDK is always autodetection
|
||||
if (!fromSdk)
|
||||
m_isAutoDetected = map.value(CMAKE_INFORMATION_AUTODETECTED, false).toBool();
|
||||
m_detectionSource = map.value(CMAKE_INFORMATION_DETECTIONSOURCE).toString();
|
||||
|
||||
setFilePath(FilePath::fromString(map.value(CMAKE_INFORMATION_COMMAND).toString()));
|
||||
|
||||
@@ -209,6 +211,7 @@ QVariantMap CMakeTool::toMap() const
|
||||
data.insert(CMAKE_INFORMATION_READERTYPE,
|
||||
Internal::readerTypeToString(m_readerType.value()));
|
||||
data.insert(CMAKE_INFORMATION_AUTODETECTED, m_isAutoDetected);
|
||||
data.insert(CMAKE_INFORMATION_DETECTIONSOURCE, m_detectionSource);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@@ -122,6 +122,8 @@ private:
|
||||
void fetchFromCapabilities() const;
|
||||
void parseFromCapabilities(const QString &input) const;
|
||||
|
||||
// Note: New items here need also be handled in CMakeToolItemModel::apply()
|
||||
// FIXME: Use a saner approach.
|
||||
Utils::Id m_id;
|
||||
QString m_displayName;
|
||||
Utils::FilePath m_executable;
|
||||
|
@@ -184,14 +184,14 @@ void CMakeToolManager::autoDetectCMakeForDevice(const FilePath &deviceRoot,
|
||||
const QString &detectionSource,
|
||||
QString *logMessage)
|
||||
{
|
||||
QStringList messages;
|
||||
QStringList messages{tr("Searching CMake binaries...")};
|
||||
const FilePaths candidates = {FilePath::fromString("cmake").onDevice(deviceRoot)};
|
||||
const Environment env = deviceRoot.deviceEnvironment();
|
||||
for (const FilePath &candidate : candidates) {
|
||||
const FilePath cmake = candidate.searchOnDevice(env.path());
|
||||
if (!cmake.isEmpty()) {
|
||||
registerCMakeByPath(cmake, detectionSource);
|
||||
messages.append(tr("Found CMake binary: %1").arg(cmake.toUserOutput()));
|
||||
messages.append(tr("Found \"%1\"").arg(cmake.toUserOutput()));
|
||||
}
|
||||
}
|
||||
if (logMessage)
|
||||
@@ -209,11 +209,28 @@ void CMakeToolManager::registerCMakeByPath(const FilePath &cmakePath, const QStr
|
||||
|
||||
auto newTool = std::make_unique<CMakeTool>(CMakeTool::ManualDetection, id);
|
||||
newTool->setFilePath(cmakePath);
|
||||
newTool->setDisplayName(cmakePath.toUserOutput());
|
||||
newTool->setDetectionSource(detectionSource);
|
||||
newTool->setDisplayName(cmakePath.toUserOutput());
|
||||
registerCMakeTool(std::move(newTool));
|
||||
}
|
||||
|
||||
void CMakeToolManager::removeDetectedCMake(const QString &detectionSource, QString *logMessage)
|
||||
{
|
||||
QStringList logMessages{tr("Removing CMake entries...")};
|
||||
while (true) {
|
||||
auto toRemove = Utils::take(d->m_cmakeTools, Utils::equal(&CMakeTool::detectionSource, detectionSource));
|
||||
if (!toRemove.has_value())
|
||||
break;
|
||||
logMessages.append(tr("Removed \"%1\"").arg((*toRemove)->displayName()));
|
||||
emit m_instance->cmakeRemoved((*toRemove)->id());
|
||||
}
|
||||
|
||||
ensureDefaultCMakeToolIsValid();
|
||||
updateDocumentation();
|
||||
if (logMessage)
|
||||
*logMessage = logMessages.join('\n');
|
||||
}
|
||||
|
||||
void CMakeToolManager::notifyAboutUpdate(CMakeTool *tool)
|
||||
{
|
||||
if (!tool || !Utils::contains(d->m_cmakeTools, tool))
|
||||
|
@@ -68,6 +68,7 @@ public slots:
|
||||
QString *logMessage);
|
||||
void registerCMakeByPath(const Utils::FilePath &cmakePath,
|
||||
const QString &detectionSource);
|
||||
void removeDetectedCMake(const QString &detectionSource, QString *logMessage);
|
||||
|
||||
signals:
|
||||
void cmakeAdded (const Utils::Id &id);
|
||||
|
@@ -211,9 +211,9 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList<CMakeTool *> &cmakeTo
|
||||
|
||||
int count = 0;
|
||||
for (const CMakeTool *item : cmakeTools) {
|
||||
QFileInfo fi = item->cmakeExecutable().toFileInfo();
|
||||
Utils::FilePath fi = item->cmakeExecutable();
|
||||
|
||||
if (fi.isExecutable()) {
|
||||
if (fi.isExecutableFile()) {
|
||||
QVariantMap tmp = item->toMap();
|
||||
if (tmp.isEmpty())
|
||||
continue;
|
||||
@@ -239,7 +239,7 @@ CMakeToolSettingsAccessor::cmakeTools(const QVariantMap &data, bool fromSdk) con
|
||||
|
||||
const QVariantMap dbMap = data.value(key).toMap();
|
||||
auto item = std::make_unique<CMakeTool>(dbMap, fromSdk);
|
||||
if (item->isAutoDetected() && !item->cmakeExecutable().toFileInfo().isExecutable()) {
|
||||
if (item->isAutoDetected() && !item->cmakeExecutable().isExecutableFile()) {
|
||||
qWarning() << QString::fromLatin1("CMakeTool \"%1\" (%2) dropped since the command is not executable.")
|
||||
.arg(item->cmakeExecutable().toUserOutput(), item->id().toString());
|
||||
continue;
|
||||
|
@@ -92,7 +92,9 @@ public:
|
||||
QVariant registerDebugger(const DebuggerItem &item);
|
||||
void readDebuggers(const FilePath &fileName, bool isSystem);
|
||||
void autoDetectCdbDebuggers();
|
||||
void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot, const QString &detectionSource);
|
||||
void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot,
|
||||
const QString &detectionSource,
|
||||
QString *logMessage = nullptr);
|
||||
void autoDetectUvscDebuggers();
|
||||
QString uniqueDisplayName(const QString &base);
|
||||
|
||||
@@ -715,7 +717,8 @@ static Utils::FilePaths searchGdbPathsFromRegistry()
|
||||
}
|
||||
|
||||
void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot,
|
||||
const QString &detectionSource)
|
||||
const QString &detectionSource,
|
||||
QString *logMessage)
|
||||
{
|
||||
const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
|
||||
"gdb.exe", "lldb", "lldb.exe", "lldb-[1-9]*",
|
||||
@@ -773,6 +776,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &de
|
||||
suspects.append(device->directoryEntries(globalPath, filters, QDir::Files | QDir::Executable));
|
||||
}
|
||||
|
||||
QStringList logMessages{tr("Searching debuggers...")};
|
||||
for (const FilePath &command : qAsConst(suspects)) {
|
||||
const auto commandMatches = [command](const DebuggerTreeItem *titem) {
|
||||
return titem->m_item.command() == command;
|
||||
@@ -796,7 +800,10 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &de
|
||||
const QString name = detectionSource.isEmpty() ? tr("System %1 at %2") : tr("Detected %1 at %2");
|
||||
item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput()));
|
||||
m_model->addDebugger(item);
|
||||
logMessages.append(tr("Found: \"%1\"").arg(name));
|
||||
}
|
||||
if (logMessage)
|
||||
*logMessage = logMessages.join('\n');
|
||||
}
|
||||
|
||||
void DebuggerItemManagerPrivate::autoDetectUvscDebuggers()
|
||||
@@ -1030,9 +1037,31 @@ void DebuggerItemManager::deregisterDebugger(const QVariant &id)
|
||||
}
|
||||
|
||||
void DebuggerItemManager::autoDetectDebuggersForDevice(const FilePath &deviceRoot,
|
||||
const QString &detectionSource)
|
||||
const QString &detectionSource,
|
||||
QString *logMessage)
|
||||
{
|
||||
d->autoDetectGdbOrLldbDebuggers(deviceRoot, detectionSource);
|
||||
d->autoDetectGdbOrLldbDebuggers(deviceRoot, detectionSource, logMessage);
|
||||
}
|
||||
|
||||
void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource,
|
||||
QString *logMessage)
|
||||
{
|
||||
QStringList logMessages{tr("Removing debugger entries...")};
|
||||
d->m_model->forItemsAtLevel<2>([detectionSource, &logMessages](DebuggerTreeItem *titem) {
|
||||
if (titem->m_item.detectionSource() == detectionSource) {
|
||||
logMessages.append(tr("Removed \"%1\"").arg(titem->m_item.displayName()));
|
||||
d->m_model->destroyItem(titem);
|
||||
return;
|
||||
}
|
||||
// FIXME: These items appeared in early docker development. Ok to remove for Creator 7.0.
|
||||
FilePath filePath = titem->m_item.command();
|
||||
if (filePath.scheme() + ':' + filePath.host() == detectionSource) {
|
||||
logMessages.append(tr("Removed \"%1\"").arg(titem->m_item.displayName()));
|
||||
d->m_model->destroyItem(titem);
|
||||
}
|
||||
});
|
||||
if (logMessage)
|
||||
*logMessage = logMessages.join('\n');
|
||||
}
|
||||
|
||||
} // namespace Debugger
|
||||
|
@@ -53,7 +53,9 @@ public:
|
||||
static void deregisterDebugger(const QVariant &id);
|
||||
|
||||
static void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot,
|
||||
const QString &detectionSource);
|
||||
const QString &detectionSource,
|
||||
QString *logMessage);
|
||||
static void removeDetectedDebuggers(const QString &detectionSource, QString *logMessage);
|
||||
|
||||
static const DebuggerItem *findByCommand(const Utils::FilePath &command);
|
||||
static const DebuggerItem *findById(const QVariant &id);
|
||||
|
@@ -724,6 +724,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
||||
{
|
||||
qRegisterMetaType<ContextData>("ContextData");
|
||||
qRegisterMetaType<DebuggerRunParameters>("DebuggerRunParameters");
|
||||
qRegisterMetaType<QString *>();
|
||||
|
||||
// Menu groups
|
||||
ActionContainer *mstart = ActionManager::actionContainer(PE::M_DEBUG_STARTDEBUGGING);
|
||||
@@ -1747,9 +1748,15 @@ void DebuggerPlugin::getEnginesState(QByteArray *json) const
|
||||
}
|
||||
|
||||
void DebuggerPlugin::autoDetectDebuggersForDevice(const FilePath &deviceRoot,
|
||||
const QString &detectionId)
|
||||
const QString &detectionSource,
|
||||
QString *logMessage)
|
||||
{
|
||||
dd->m_debuggerItemManager.autoDetectDebuggersForDevice(deviceRoot, detectionId);
|
||||
dd->m_debuggerItemManager.autoDetectDebuggersForDevice(deviceRoot, detectionSource, logMessage);
|
||||
}
|
||||
|
||||
void DebuggerPlugin::removeDetectedDebuggers(const QString &detectionSource, QString *logMessage)
|
||||
{
|
||||
dd->m_debuggerItemManager.removeDetectedDebuggers(detectionSource, logMessage);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::attachToQmlPort()
|
||||
|
@@ -59,10 +59,15 @@ private:
|
||||
Q_SLOT void getEnginesState(QByteArray *json) const;
|
||||
|
||||
// Called from DockerDevice
|
||||
Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot, const QString &detectionId);
|
||||
Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot,
|
||||
const QString &detectionId,
|
||||
QString *logMessage);
|
||||
Q_SLOT void removeDetectedDebuggers(const QString &detectionId, QString *logMessage);
|
||||
|
||||
QVector<QObject *> createTestObjects() const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
Q_DECLARE_METATYPE(QString *)
|
||||
|
@@ -471,26 +471,54 @@ DockerDeviceData &DockerDevice::data()
|
||||
|
||||
void KitDetectorPrivate::undoAutoDetect() const
|
||||
{
|
||||
emit q->logOutput(tr("Start removing auto-detected items associated with this docker image."));
|
||||
|
||||
emit q->logOutput('\n' + tr("Removing kits..."));
|
||||
for (Kit *kit : KitManager::kits()) {
|
||||
if (kit->autoDetectionSource() == m_sharedId) {
|
||||
emit q->logOutput(tr("Removing kit: %1").arg(kit->displayName()));
|
||||
emit q->logOutput(tr("Removed \"%1\"").arg(kit->displayName()));
|
||||
KitManager::deregisterKit(kit);
|
||||
}
|
||||
};
|
||||
|
||||
emit q->logOutput('\n' + tr("Removing Qt version entries..."));
|
||||
for (BaseQtVersion *qtVersion : QtVersionManager::versions()) {
|
||||
if (qtVersion->autodetectionSource() == m_sharedId) {
|
||||
emit q->logOutput(tr("Removing Qt version: %1").arg(qtVersion->displayName()));
|
||||
if (qtVersion->detectionSource() == m_sharedId) {
|
||||
emit q->logOutput(tr("Removed \"%1\"").arg(qtVersion->displayName()));
|
||||
QtVersionManager::removeVersion(qtVersion);
|
||||
}
|
||||
};
|
||||
|
||||
emit q->logOutput(tr("Tool chains not removed."));
|
||||
// for (ToolChain *toolChain : ToolChainManager::toolChains()) {
|
||||
// if (toolChain->autoDetectionSource() == id.toString())
|
||||
// // FIXME: Implement
|
||||
// };
|
||||
emit q->logOutput('\n' + tr("Removing toolchain entries..."));
|
||||
for (ToolChain *toolChain : ToolChainManager::toolChains()) {
|
||||
QString detectionSource = toolChain->detectionSource();
|
||||
if (toolChain->detectionSource() == m_sharedId) {
|
||||
emit q->logOutput(tr("Removed \"%1\"").arg(toolChain->displayName()));
|
||||
ToolChainManager::deregisterToolChain(toolChain);
|
||||
}
|
||||
};
|
||||
|
||||
emit q->logOutput(tr("Removal of previously auto-detected kit items finished.") + '\n');
|
||||
if (QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager")) {
|
||||
QString logMessage;
|
||||
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
||||
"removeDetectedCMake",
|
||||
Q_ARG(QString, m_sharedId),
|
||||
Q_ARG(QString *, &logMessage));
|
||||
QTC_CHECK(res);
|
||||
emit q->logOutput('\n' + logMessage);
|
||||
}
|
||||
|
||||
if (QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin")) {
|
||||
QString logMessage;
|
||||
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
||||
"removeDetectedDebuggers",
|
||||
Q_ARG(QString, m_sharedId),
|
||||
Q_ARG(QString *, &logMessage));
|
||||
QTC_CHECK(res);
|
||||
emit q->logOutput('\n' + logMessage);
|
||||
}
|
||||
|
||||
emit q->logOutput('\n' + tr("Removal of previously auto-detected kit items finished.") + "\n\n");
|
||||
}
|
||||
|
||||
QList<BaseQtVersion *> KitDetectorPrivate::autoDetectQtVersions() const
|
||||
@@ -510,7 +538,7 @@ QList<BaseQtVersion *> KitDetectorPrivate::autoDetectQtVersions() const
|
||||
continue;
|
||||
qtVersions.append(qtVersion);
|
||||
QtVersionManager::addVersion(qtVersion);
|
||||
emit q->logOutput(tr("Found Qt: %1").arg(qtVersion->qmakeFilePath().toUserOutput()));
|
||||
emit q->logOutput(tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput()));
|
||||
}
|
||||
if (qtVersions.isEmpty())
|
||||
emit q->logOutput(tr("No Qt installation found."));
|
||||
@@ -521,21 +549,24 @@ QList<ToolChain *> KitDetectorPrivate::autoDetectToolChains()
|
||||
{
|
||||
const QList<ToolChainFactory *> factories = ToolChainFactory::allToolChainFactories();
|
||||
|
||||
QList<ToolChain *> toolChains;
|
||||
QList<ToolChain *> alreadyKnown = ToolChainManager::toolChains();
|
||||
QList<ToolChain *> allNewToolChains;
|
||||
QApplication::processEvents();
|
||||
emit q->logOutput('\n' + tr("Searching tool chains..."));
|
||||
emit q->logOutput('\n' + tr("Searching toolchains..."));
|
||||
for (ToolChainFactory *factory : factories) {
|
||||
const QList<ToolChain *> newToolChains = factory->autoDetect(toolChains, m_device.constCast<IDevice>());
|
||||
emit q->logOutput(tr("Searching tool chains of type %1").arg(factory->displayName()));
|
||||
emit q->logOutput(tr("Searching toolchains of type %1").arg(factory->displayName()));
|
||||
const QList<ToolChain *> newToolChains = factory->autoDetect(alreadyKnown, m_device.constCast<IDevice>());
|
||||
for (ToolChain *toolChain : newToolChains) {
|
||||
emit q->logOutput(tr("Found tool chain: %1").arg(toolChain->compilerCommand().toUserOutput()));
|
||||
emit q->logOutput(tr("Found \"%1\"").arg(toolChain->compilerCommand().toUserOutput()));
|
||||
toolChain->setDetectionSource(m_sharedId);
|
||||
ToolChainManager::registerToolChain(toolChain);
|
||||
toolChains.append(toolChain);
|
||||
alreadyKnown.append(toolChain);
|
||||
}
|
||||
allNewToolChains.append(newToolChains);
|
||||
}
|
||||
emit q->logOutput(tr("%1 new tool chains found.").arg(toolChains.size()));
|
||||
emit q->logOutput(tr("%1 new toolchains found.").arg(allNewToolChains.size()));
|
||||
|
||||
return toolChains;
|
||||
return allNewToolChains;
|
||||
}
|
||||
|
||||
void KitDetectorPrivate::autoDetectCMake()
|
||||
@@ -544,16 +575,15 @@ void KitDetectorPrivate::autoDetectCMake()
|
||||
if (!cmakeManager)
|
||||
return;
|
||||
|
||||
emit q->logOutput('\n' + tr("Searching CMake binary..."));
|
||||
const FilePath deviceRoot = m_device->mapToGlobalPath({});
|
||||
QString error;
|
||||
QString logMessage;
|
||||
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
||||
"autoDetectCMakeForDevice",
|
||||
Q_ARG(Utils::FilePath, deviceRoot),
|
||||
Q_ARG(QString, m_sharedId),
|
||||
Q_ARG(QString *, &error));
|
||||
Q_ARG(QString *, &logMessage));
|
||||
QTC_CHECK(res);
|
||||
emit q->logOutput(error);
|
||||
emit q->logOutput('\n' + logMessage);
|
||||
}
|
||||
|
||||
void KitDetectorPrivate::autoDetectDebugger()
|
||||
@@ -562,13 +592,15 @@ void KitDetectorPrivate::autoDetectDebugger()
|
||||
if (!debuggerPlugin)
|
||||
return;
|
||||
|
||||
emit q->logOutput('\n' + tr("Searching debuggers..."));
|
||||
const FilePath deviceRoot = m_device->mapToGlobalPath({});
|
||||
QString logMessage;
|
||||
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
||||
"autoDetectDebuggersForDevice",
|
||||
Q_ARG(Utils::FilePath, deviceRoot),
|
||||
Q_ARG(QString, m_sharedId));
|
||||
Q_ARG(QString, m_sharedId),
|
||||
Q_ARG(QString *, &logMessage));
|
||||
QTC_CHECK(res);
|
||||
emit q->logOutput('\n' + logMessage);
|
||||
}
|
||||
|
||||
void KitDetectorPrivate::autoDetect()
|
||||
@@ -715,6 +747,15 @@ void DockerDevicePrivate::tryCreateLocalFileAccess()
|
||||
.arg(m_container, m_mergedDir)
|
||||
+ '\n' + tr("Output: '%1'").arg(out)
|
||||
+ '\n' + tr("Error: '%1'").arg(proc.stdErr()));
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
// Disabling merged layer access. This is not supported and anything
|
||||
// related to accessing merged layers on Windows fails due to the need
|
||||
// of using wsl or a named pipe.
|
||||
// TODO investigate how to make it possible nevertheless.
|
||||
m_mergedDir.clear();
|
||||
MessageManager::writeSilently(tr("This is expected on Windows."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_mergedDirWatcher.addPath(m_mergedDir);
|
||||
|
@@ -137,21 +137,28 @@ void LanguageClientManager::clientFinished(Client *client)
|
||||
constexpr int restartTimeoutS = 5;
|
||||
const bool unexpectedFinish = client->state() != Client::Shutdown
|
||||
&& client->state() != Client::ShutdownRequested;
|
||||
if (unexpectedFinish && !managerInstance->m_shuttingDown && client->reset()) {
|
||||
|
||||
if (unexpectedFinish) {
|
||||
if (!managerInstance->m_shuttingDown) {
|
||||
const QList<TextEditor::TextDocument *> &clientDocs
|
||||
= managerInstance->m_clientForDocument.keys(client);
|
||||
if (client->reset()) {
|
||||
client->disconnect(managerInstance);
|
||||
client->log(tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS));
|
||||
client->log(
|
||||
tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS));
|
||||
QTimer::singleShot(restartTimeoutS * 1000, client, [client]() { client->start(); });
|
||||
for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client))
|
||||
for (TextEditor::TextDocument *document : clientDocs)
|
||||
client->deactivateDocument(document);
|
||||
} else {
|
||||
if (unexpectedFinish && !managerInstance->m_shuttingDown)
|
||||
return;
|
||||
}
|
||||
client->log(tr("Unexpectedly finished."));
|
||||
for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client))
|
||||
for (TextEditor::TextDocument *document : clientDocs)
|
||||
managerInstance->m_clientForDocument.remove(document);
|
||||
}
|
||||
}
|
||||
deleteClient(client);
|
||||
if (managerInstance->m_shuttingDown && managerInstance->m_clients.isEmpty())
|
||||
emit managerInstance->shutdownFinished();
|
||||
}
|
||||
}
|
||||
|
||||
Client *LanguageClientManager::startClient(BaseSettings *setting, ProjectExplorer::Project *project)
|
||||
@@ -193,6 +200,10 @@ void LanguageClientManager::shutdownClient(Client *client)
|
||||
{
|
||||
if (!client)
|
||||
return;
|
||||
// reset the documents for that client already when requesting the shutdown so they can get
|
||||
// reassigned to another server right after this request to another server
|
||||
for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client))
|
||||
managerInstance->m_clientForDocument.remove(document);
|
||||
if (client->reachable())
|
||||
client->shutdown();
|
||||
else if (client->state() != Client::Shutdown && client->state() != Client::ShutdownRequested)
|
||||
|
@@ -538,7 +538,7 @@ MessageId LspLogMessage::id() const
|
||||
QString LspLogMessage::displayText() const
|
||||
{
|
||||
if (!m_displayText.has_value()) {
|
||||
m_displayText = time.toString("hh:mm:ss.zzz") + '\n';
|
||||
m_displayText = QString(time.toString("hh:mm:ss.zzz") + '\n');
|
||||
if (message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType())
|
||||
m_displayText->append(json().value(QString{methodKey}).toString(id().toString()));
|
||||
else
|
||||
|
@@ -851,7 +851,7 @@ bool Project::isKnownFile(const Utils::FilePath &filename) const
|
||||
}
|
||||
|
||||
const Node *Project::nodeForFilePath(const Utils::FilePath &filePath,
|
||||
const Project::NodeMatcher &extraMatcher)
|
||||
const Project::NodeMatcher &extraMatcher) const
|
||||
{
|
||||
const FileNode dummy(filePath, FileType::Unknown);
|
||||
const auto range = std::equal_range(d->m_sortedNodeList.cbegin(), d->m_sortedNodeList.cend(),
|
||||
|
@@ -128,7 +128,7 @@ public:
|
||||
Utils::FilePaths files(const NodeMatcher &matcher) const;
|
||||
bool isKnownFile(const Utils::FilePath &filename) const;
|
||||
const Node *nodeForFilePath(const Utils::FilePath &filePath,
|
||||
const NodeMatcher &extraMatcher = {});
|
||||
const NodeMatcher &extraMatcher = {}) const;
|
||||
|
||||
virtual QVariantMap toMap() const;
|
||||
|
||||
|
@@ -458,15 +458,14 @@ Node *ProjectTree::nodeForFile(const FilePath &fileName)
|
||||
{
|
||||
Node *node = nullptr;
|
||||
for (const Project *project : SessionManager::projects()) {
|
||||
if (ProjectNode *projectNode = project->rootProjectNode()) {
|
||||
projectNode->forEachGenericNode([&](Node *n) {
|
||||
if (n->filePath() == fileName) {
|
||||
// prefer file nodes
|
||||
project->nodeForFilePath(fileName, [&](const Node *n) {
|
||||
if (!node || (!node->asFileNode() && n->asFileNode()))
|
||||
node = n;
|
||||
}
|
||||
node = const_cast<Node *>(n);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
// early return:
|
||||
if (node && node->asFileNode())
|
||||
return node;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ namespace QtSupport {
|
||||
namespace Internal {
|
||||
|
||||
const char QTVERSIONAUTODETECTED[] = "isAutodetected";
|
||||
const char QTVERSIONAUTODETECTIONSOURCE[] = "autodetectionSource";
|
||||
const char QTVERSIONDETECTIONSOURCE[] = "autodetectionSource";
|
||||
const char QTVERSION_OVERRIDE_FEATURES[] = "overrideFeatures";
|
||||
const char QTVERSIONQMAKEPATH[] = "QMakePath";
|
||||
const char QTVERSIONSOURCEPATH[] = "SourcePath";
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
bool m_versionInfoUpToDate = false;
|
||||
bool m_qmakeIsExecutable = true;
|
||||
|
||||
QString m_autodetectionSource;
|
||||
QString m_detectionSource;
|
||||
QSet<Utils::Id> m_overrideFeatures;
|
||||
|
||||
FilePath m_mkspec;
|
||||
@@ -368,7 +368,7 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const
|
||||
} while (!dir.isRoot() && dir.cdUp());
|
||||
}
|
||||
|
||||
return autodetectionSource() == "PATH" ?
|
||||
return detectionSource() == "PATH" ?
|
||||
QCoreApplication::translate("QtVersion", "Qt %{Qt:Version} in PATH (%2)").arg(location) :
|
||||
QCoreApplication::translate("QtVersion", "Qt %{Qt:Version} (%2)").arg(location);
|
||||
}
|
||||
@@ -724,7 +724,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map)
|
||||
d->m_id = QtVersionManager::getUniqueId();
|
||||
d->m_data.unexpandedDisplayName.fromMap(map, Constants::QTVERSIONNAME);
|
||||
d->m_isAutodetected = map.value(QTVERSIONAUTODETECTED).toBool();
|
||||
d->m_autodetectionSource = map.value(QTVERSIONAUTODETECTIONSOURCE).toString();
|
||||
d->m_detectionSource = map.value(QTVERSIONDETECTIONSOURCE).toString();
|
||||
d->m_overrideFeatures = Utils::Id::fromStringList(map.value(QTVERSION_OVERRIDE_FEATURES).toStringList());
|
||||
d->m_qmakeCommand = FilePath::fromVariant(map.value(QTVERSIONQMAKEPATH));
|
||||
|
||||
@@ -765,7 +765,7 @@ QVariantMap BaseQtVersion::toMap() const
|
||||
d->m_data.unexpandedDisplayName.toMap(result, Constants::QTVERSIONNAME);
|
||||
|
||||
result.insert(QTVERSIONAUTODETECTED, isAutodetected());
|
||||
result.insert(QTVERSIONAUTODETECTIONSOURCE, autodetectionSource());
|
||||
result.insert(QTVERSIONDETECTIONSOURCE, detectionSource());
|
||||
if (!d->m_overrideFeatures.isEmpty())
|
||||
result.insert(QTVERSION_OVERRIDE_FEATURES, Utils::Id::toStringList(d->m_overrideFeatures));
|
||||
|
||||
@@ -885,9 +885,9 @@ bool BaseQtVersion::isAutodetected() const
|
||||
return d->m_isAutodetected;
|
||||
}
|
||||
|
||||
QString BaseQtVersion::autodetectionSource() const
|
||||
QString BaseQtVersion::detectionSource() const
|
||||
{
|
||||
return d->m_autodetectionSource;
|
||||
return d->m_detectionSource;
|
||||
}
|
||||
|
||||
QString BaseQtVersion::displayName() const
|
||||
@@ -2316,7 +2316,7 @@ void BaseQtVersion::resetCache() const
|
||||
static QList<QtVersionFactory *> g_qtVersionFactories;
|
||||
|
||||
BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath
|
||||
(const FilePath &qmakePath, bool isAutoDetected, const QString &autoDetectionSource, QString *error)
|
||||
(const FilePath &qmakePath, bool isAutoDetected, const QString &detectionSource, QString *error)
|
||||
{
|
||||
QHash<ProKey, ProString> versionInfo;
|
||||
const Environment env = qmakePath.deviceEnvironment();
|
||||
@@ -2353,7 +2353,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath
|
||||
ver->d->m_id = QtVersionManager::getUniqueId();
|
||||
QTC_CHECK(ver->d->m_qmakeCommand.isEmpty()); // Should only be used once.
|
||||
ver->d->m_qmakeCommand = qmakePath;
|
||||
ver->d->m_autodetectionSource = autoDetectionSource;
|
||||
ver->d->m_detectionSource = detectionSource;
|
||||
ver->d->m_isAutodetected = isAutoDetected;
|
||||
ver->updateDefaultDisplayName();
|
||||
ProFileCacheManager::instance()->decRefCount();
|
||||
|
@@ -98,7 +98,7 @@ public:
|
||||
virtual bool equals(BaseQtVersion *other);
|
||||
|
||||
bool isAutodetected() const;
|
||||
QString autodetectionSource() const;
|
||||
QString detectionSource() const;
|
||||
|
||||
QString displayName() const;
|
||||
QString unexpandedDisplayName() const;
|
||||
|
@@ -184,7 +184,7 @@ void QtKitAspect::setup(Kit *k)
|
||||
const QList<BaseQtVersion *> &candidates = !exactMatches.empty() ? exactMatches : matches;
|
||||
|
||||
BaseQtVersion * const qtFromPath = QtVersionManager::version(
|
||||
equal(&BaseQtVersion::autodetectionSource, QString::fromLatin1("PATH")));
|
||||
equal(&BaseQtVersion::detectionSource, QString::fromLatin1("PATH")));
|
||||
if (qtFromPath && candidates.contains(qtFromPath))
|
||||
k->setValue(id(), qtFromPath->uniqueId());
|
||||
else
|
||||
@@ -343,7 +343,7 @@ int QtKitAspect::qtVersionId(const Kit *k)
|
||||
id = -1;
|
||||
} else {
|
||||
QString source = data.toString();
|
||||
BaseQtVersion *v = QtVersionManager::version([source](const BaseQtVersion *v) { return v->autodetectionSource() == source; });
|
||||
BaseQtVersion *v = QtVersionManager::version([source](const BaseQtVersion *v) { return v->detectionSource() == source; });
|
||||
if (v)
|
||||
id = v->uniqueId();
|
||||
}
|
||||
|
@@ -271,7 +271,7 @@ void TestQtProjectImporter::deleteDirectoryData(void *directoryData) const
|
||||
|
||||
static Utils::FilePath setupQmake(const BaseQtVersion *qt, const QString &path)
|
||||
{
|
||||
const QFileInfo fi = QFileInfo(qt->qmakeCommand().toFileInfo().canonicalFilePath());
|
||||
const QFileInfo fi = QFileInfo(qt->qmakeFilePath().toFileInfo().canonicalFilePath());
|
||||
const QString qmakeFile = path + "/" + fi.fileName();
|
||||
if (!QFile::copy(fi.absoluteFilePath(), qmakeFile))
|
||||
return Utils::FilePath();
|
||||
@@ -379,12 +379,12 @@ void QtSupportPlugin::testQtProjectImporter_oneProject()
|
||||
SysRootKitAspect::setSysRoot(kitTemplates[1], Utils::FilePath::fromString("/some/path"));
|
||||
SysRootKitAspect::setSysRoot(kitTemplates[2], Utils::FilePath::fromString("/some/other/path"));
|
||||
|
||||
QVector<Utils::FilePath> qmakePaths = {defaultQt->qmakeCommand(),
|
||||
QVector<Utils::FilePath> qmakePaths = {defaultQt->qmakeFilePath(),
|
||||
setupQmake(defaultQt, tempDir1.path().path()),
|
||||
setupQmake(defaultQt, tempDir2.path().path())};
|
||||
|
||||
for (int i = 1; i < qmakePaths.count(); ++i)
|
||||
QVERIFY(!QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeCommand, qmakePaths.at(i))));
|
||||
QVERIFY(!QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeFilePath, qmakePaths.at(i))));
|
||||
|
||||
QList<DirectoryData *> testData;
|
||||
|
||||
@@ -457,7 +457,7 @@ void QtSupportPlugin::testQtProjectImporter_oneProject()
|
||||
QVERIFY(newQt);
|
||||
|
||||
// VALIDATE: Qt has the expected qmakePath
|
||||
QCOMPARE(dd->qmakePath, newQt->qmakeCommand());
|
||||
QCOMPARE(dd->qmakePath, newQt->qmakeFilePath());
|
||||
|
||||
// VALIDATE: All keys are unchanged:
|
||||
QList<Utils::Id> newKitKeys = newKit->allKeys();
|
||||
@@ -569,7 +569,7 @@ void QtSupportPlugin::testQtProjectImporter_oneProject()
|
||||
QVERIFY(QtVersionManager::version(qtId));
|
||||
|
||||
// VALIDATE: Qt points to the expected qmake path:
|
||||
QCOMPARE(QtVersionManager::version(qtId)->qmakeCommand(), dd->qmakePath);
|
||||
QCOMPARE(QtVersionManager::version(qtId)->qmakeFilePath(), dd->qmakePath);
|
||||
|
||||
// VALIDATE: Kit uses the expected Qt
|
||||
QCOMPARE(QtKitAspect::qtVersionId(newKit), qtId);
|
||||
|
@@ -51,10 +51,10 @@ public:
|
||||
/// the desktop factory claims to handle all paths
|
||||
int priority() const { return m_priority; }
|
||||
|
||||
static BaseQtVersion *createQtVersionFromQMakePath(
|
||||
const Utils::FilePath &qmakePath, bool isAutoDetected = false,
|
||||
const QString &autoDetectionSource = QString(), QString *error = nullptr);
|
||||
|
||||
static BaseQtVersion *createQtVersionFromQMakePath(const Utils::FilePath &qmakePath,
|
||||
bool isAutoDetected = false,
|
||||
const QString &detectionSource = {},
|
||||
QString *error = nullptr);
|
||||
protected:
|
||||
struct SetupData
|
||||
{
|
||||
|
@@ -265,8 +265,8 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
|
||||
if (log().isDebugEnabled()) {
|
||||
qCDebug(log) << "======= Existing Qt versions =======";
|
||||
for (BaseQtVersion *version : qAsConst(m_versions)) {
|
||||
qCDebug(log) << version->qmakeFilePath().toString() << "id:"<<version->uniqueId();
|
||||
qCDebug(log) << " autodetection source:"<< version->autodetectionSource();
|
||||
qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:"<<version->uniqueId();
|
||||
qCDebug(log) << " autodetection source:" << version->detectionSource();
|
||||
qCDebug(log) << "";
|
||||
}
|
||||
qCDebug(log)<< "======= Adding sdk versions =======";
|
||||
@@ -303,7 +303,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
|
||||
bool restored = false;
|
||||
const VersionMap versionsCopy = m_versions; // m_versions is modified in loop
|
||||
for (BaseQtVersion *v : versionsCopy) {
|
||||
if (v->autodetectionSource() == autoDetectionSource) {
|
||||
if (v->detectionSource() == autoDetectionSource) {
|
||||
id = v->uniqueId();
|
||||
qCDebug(log) << " Qt version found with same autodetection source" << autoDetectionSource << " => Migrating id:" << id;
|
||||
m_versions.remove(id);
|
||||
@@ -341,16 +341,16 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
|
||||
if (log().isDebugEnabled()) {
|
||||
qCDebug(log) << "======= Before removing outdated sdk versions =======";
|
||||
for (BaseQtVersion *version : qAsConst(m_versions)) {
|
||||
qCDebug(log) << version->qmakeFilePath().toString() << "id:"<<version->uniqueId();
|
||||
qCDebug(log) << " autodetection source:"<< version->autodetectionSource();
|
||||
qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId();
|
||||
qCDebug(log) << " autodetection source:" << version->detectionSource();
|
||||
qCDebug(log) << "";
|
||||
}
|
||||
}
|
||||
const VersionMap versionsCopy = m_versions; // m_versions is modified in loop
|
||||
for (BaseQtVersion *qtVersion : versionsCopy) {
|
||||
if (qtVersion->autodetectionSource().startsWith("SDK.")) {
|
||||
if (!sdkVersions.contains(qtVersion->autodetectionSource())) {
|
||||
qCDebug(log) << " removing version"<<qtVersion->autodetectionSource();
|
||||
if (qtVersion->detectionSource().startsWith("SDK.")) {
|
||||
if (!sdkVersions.contains(qtVersion->detectionSource())) {
|
||||
qCDebug(log) << " removing version" << qtVersion->detectionSource();
|
||||
m_versions.remove(qtVersion->uniqueId());
|
||||
removed << qtVersion->uniqueId();
|
||||
}
|
||||
@@ -360,8 +360,8 @@ void QtVersionManager::updateFromInstaller(bool emitSignal)
|
||||
if (log().isDebugEnabled()) {
|
||||
qCDebug(log)<< "======= End result =======";
|
||||
for (BaseQtVersion *version : qAsConst(m_versions)) {
|
||||
qCDebug(log) << version->qmakeFilePath().toString() << "id:" << version->uniqueId();
|
||||
qCDebug(log) << " autodetection source:"<< version->autodetectionSource();
|
||||
qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId();
|
||||
qCDebug(log) << " autodetection source:" << version->detectionSource();
|
||||
qCDebug(log) << "";
|
||||
}
|
||||
}
|
||||
|
@@ -168,6 +168,13 @@ QList<ToolChain *> WebAssemblyToolChainFactory::autoDetect(
|
||||
if (!WebAssemblyEmSdk::isValid(sdk))
|
||||
return {};
|
||||
|
||||
if (device) {
|
||||
// Only detect toolchains from the emsdk installation device
|
||||
const FilePath deviceRoot = device->mapToGlobalPath({});
|
||||
if (deviceRoot.host() != sdk.host())
|
||||
return {};
|
||||
}
|
||||
|
||||
Environment env = sdk.deviceEnvironment();
|
||||
WebAssemblyEmSdk::addToEnvironment(sdk, env);
|
||||
|
||||
|
@@ -900,7 +900,7 @@ void tst_TestCore::testRewriterImports()
|
||||
QVERIFY(import.isLibraryImport());
|
||||
QCOMPARE(import.url(), QString("QtQuick"));
|
||||
QVERIFY(import.hasVersion());
|
||||
QCOMPARE(import.version(), QString("1.0"));
|
||||
QCOMPARE(import.version(), QString("2.15"));
|
||||
QVERIFY(!import.hasAlias());
|
||||
|
||||
// import "subitems"
|
||||
|
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
|
||||
class tst_TestCore : public QObject
|
||||
{
|
||||
@@ -237,4 +239,7 @@ private slots:
|
||||
// QMLAnnotations
|
||||
void writeAnnotations();
|
||||
void readAnnotations();
|
||||
|
||||
private:
|
||||
ExtensionSystem::PluginManager pm; // FIXME remove
|
||||
};
|
||||
|
@@ -23,7 +23,7 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import Qt 4.7
|
||||
import QtQuick 2.15
|
||||
import "subitems"
|
||||
import QtWebKit 1.0 as Web
|
||||
|
||||
|
@@ -897,7 +897,7 @@ void tst_QtcProcess::runBlockingStdOut()
|
||||
// with interactive cli tools.
|
||||
QEXPECT_FAIL("Unterminated stdout lost: early timeout", "", Continue);
|
||||
QVERIFY2(sp.result() != QtcProcess::Hang, "Process run did not time out.");
|
||||
|
||||
QEXPECT_FAIL("Unterminated stdout lost: early timeout", "", Continue);
|
||||
QVERIFY2(readLastLine, "Last line was read.");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user