Merge remote-tracking branch 'origin/7.0'

Conflicts:
	src/libs/ssh/sshremoteprocessrunner.h

Change-Id: I4ce088c68704845ec8ec6feaad10bf747e415bec
This commit is contained in:
Eike Ziller
2022-01-28 14:59:08 +01:00
48 changed files with 330 additions and 287 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -47,11 +47,14 @@
format file recursively from the directory that contains the source file
up to the file system root.
To specify settings for automatic formatting and indentation:
To specify global settings for automatic formatting and indentation, you
must copy the built-in settings and edit the copy:
\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++}.
\image qtcreator-clang-format-options.png "C++ Clang Format options"
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++} >
\uicontrol Edit > \uicontrol {Copy Built-in Code Style} >
\uicontrol {ClangFormat}.
\image qtcreator-code-style-clang-format.png "C++ Clang Format options"
\li Select the \uicontrol {Format instead of indenting} check box to
use the \key {Ctrl+I} keyboard shortcut to format code instead of
indenting it.
@@ -72,11 +75,10 @@
To override the \c {.clang-format} file for a project, select
\uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol {Code Style} >
\uicontrol {Code Style} > \uicontrol Edit >
\uicontrol {Copy Built-in Code Style} > \uicontrol {ClangFormat} >
\uicontrol {Override Clang Format configuration file}.
\image qtcreator-code-style-clang-format.png
You can create \c {.clang-format} files that contain the configuration
options of a certain predefined style from the command line. For example,
to create a format file for the LLVM style, enter the following command:

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -104,9 +104,6 @@
\list 1
\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
modify and click \uicontrol Copy.
\image qtcreator-options-code-style-cpp.png "C++ Code Style options"

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -176,7 +176,7 @@
\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol C++ >
\uicontrol Clang > \uicontrol {Use clangd (EXPERIMENTAL)}.
\uicontrol Clangd > \uicontrol {Use clangd (EXPERIMENTAL)}.
\image qtcreator-options-clangd.png "clangd options"
\li In \uicontrol {Path to executable}, enter the path to clangd
version 13, or later.

View File

@@ -13,6 +13,10 @@ versionAtLeast(QT_VERSION, 5.15.0) {
QT *= quick3dparticles-private
DEFINES *= QUICK3D_PARTICLES_MODULE
}
qtHaveModule(quick3dassetutils) {
QT *= quick3dassetutils-private
DEFINES *= QUICK3D_ASSET_UTILS_MODULE
}
}
HEADERS += $$PWD/qt5nodeinstanceserver.h \

View File

@@ -104,6 +104,9 @@
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include "../editor3d/qt5compat/qquick3darealight_p.h"
#endif
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
#include <private/qquick3druntimeloader_p.h>
#endif
#endif
#ifdef QUICK3D_PARTICLES_MODULE
@@ -2317,13 +2320,23 @@ void Qt5InformationNodeInstanceServer::handleInstanceHidden(const ServerNodeInst
} else {
auto checkRepeater = qobject_cast<QQuick3DRepeater *>(checkNode);
auto checkLoader = qobject_cast<QQuick3DLoader *>(checkNode);
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
auto checkRunLoader = qobject_cast<QQuick3DRuntimeLoader *>(checkNode);
if (checkRepeater || checkLoader || checkRunLoader) {
#else
if (checkRepeater || checkLoader) {
#endif
// Repeaters/loaders may not yet have created their children, so we set
// _pickTarget on them and connect the notifier.
if (checkNode->property("_pickTarget").isNull()) {
if (checkRepeater) {
QObject::connect(checkRepeater, &QQuick3DRepeater::objectAdded,
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
} else if (checkRunLoader) {
QObject::connect(checkRunLoader, &QQuick3DRuntimeLoader::statusChanged,
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
#endif
} else {
QObject::connect(checkLoader, &QQuick3DLoader::loaded,
this, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);

View File

@@ -42,6 +42,9 @@
#include <private/qquick3dnode_p_p.h>
#include <private/qquick3drepeater_p.h>
#include <private/qquick3dloader_p.h>
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
#include <private/qquick3druntimeloader_p.h>
#endif
#endif
namespace QmlDesigner {
@@ -63,11 +66,21 @@ void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNo
QObject *obj = object();
auto repObj = qobject_cast<QQuick3DRepeater *>(obj);
auto loadObj = qobject_cast<QQuick3DLoader *>(obj);
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
auto runLoadObj = qobject_cast<QQuick3DRuntimeLoader *>(obj);
if (repObj || loadObj || runLoadObj) {
#else
if (repObj || loadObj) {
#endif
if (auto infoServer = qobject_cast<Qt5InformationNodeInstanceServer *>(nodeInstanceServer())) {
if (repObj) {
QObject::connect(repObj, &QQuick3DRepeater::objectAdded,
infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
#if defined(QUICK3D_ASSET_UTILS_MODULE) && QT_VERSION > QT_VERSION_CHECK(6, 2, 0)
} else if (runLoadObj) {
QObject::connect(runLoadObj, &QQuick3DRuntimeLoader::statusChanged,
infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);
#endif
} else {
QObject::connect(loadObj, &QQuick3DLoader::loaded,
infoServer, &Qt5InformationNodeInstanceServer::handleDynamicAddObject);

View File

@@ -34,7 +34,7 @@ Rectangle {
}
PerspectiveCamera {
id: camera
id: sceneCamera
z: 350
}

View File

@@ -151,6 +151,7 @@ private:
disconnect(connection, nullptr, this, nullptr);
connection->deleteLater();
m_connections.erase(it);
}
void removeInactiveConnections()

View File

@@ -185,7 +185,6 @@ void SshRemoteProcessRunner::setState(int newState)
}
}
QString SshRemoteProcessRunner::command() const { return d->m_command; }
QString SshRemoteProcessRunner::lastConnectionErrorString() const {
return d->m_lastConnectionErrorString;
}

View File

@@ -40,7 +40,7 @@ public:
~SshRemoteProcessRunner();
void run(const QString &command, const SshConnectionParameters &sshParams);
QString command() const;
void runInTerminal(const QString &command, const SshConnectionParameters &sshParams);
QString lastConnectionErrorString() const;

View File

@@ -227,8 +227,8 @@ public:
virtual void setWorkingDirectory(const QString &dir) = 0;
virtual void start(const QString &program, const QStringList &arguments,
const QByteArray &writeData) = 0;
virtual void customStart(const CommandLine &command, const FilePath &workingDirectory,
const Environment &environment) { QTC_CHECK(false); }
virtual void customStart(const CommandLine &, const FilePath &workingDirectory,
const Environment &) { Q_UNUSED(workingDirectory); QTC_CHECK(false); }
virtual bool isCustomStart() const { return false; }
virtual void terminate() = 0;
virtual void kill() = 0;
@@ -312,9 +312,9 @@ public:
QByteArray readAllStandardOutput() override { QTC_CHECK(false); return {}; }
QByteArray readAllStandardError() override { QTC_CHECK(false); return {}; }
void setProcessEnvironment(const QProcessEnvironment &environment) override { QTC_CHECK(false); }
void setWorkingDirectory(const QString &dir) override { QTC_CHECK(false); }
void start(const QString &program, const QStringList &arguments, const QByteArray &writeData) override
void setProcessEnvironment(const QProcessEnvironment &) override { QTC_CHECK(false); }
void setWorkingDirectory(const QString &) override { QTC_CHECK(false); }
void start(const QString &, const QStringList &, const QByteArray &) override
{ QTC_CHECK(false); }
void customStart(const CommandLine &command, const FilePath &workingDirectory,
const Environment &environment) override
@@ -330,7 +330,7 @@ public:
void terminate() override { m_terminal.stopProcess(); }
void kill() override { m_terminal.stopProcess(); }
void close() override { m_terminal.stopProcess(); }
qint64 write(const QByteArray &data) override { QTC_CHECK(false); return -1; }
qint64 write(const QByteArray &) override { QTC_CHECK(false); return -1; }
void setStandardInputFile(const QString &fileName) override { Q_UNUSED(fileName) QTC_CHECK(false); }
// intentionally no-op without an assert
@@ -343,13 +343,13 @@ public:
int exitCode() const override { return m_terminal.exitCode(); }
QProcess::ExitStatus exitStatus() const override { return m_terminal.exitStatus(); }
QString errorString() const override { return m_terminal.errorString(); }
void setErrorString(const QString &str) override { QTC_CHECK(false); }
void setErrorString(const QString &) override { QTC_CHECK(false); }
// intentionally no-op without an assert
bool waitForStarted(int msecs) override { return false; }
bool waitForReadyRead(int msecs) override { QTC_CHECK(false); return false; }
bool waitForStarted(int) override { return false; }
bool waitForReadyRead(int) override { QTC_CHECK(false); return false; }
// intentionally no-op without an assert
bool waitForFinished(int msecs) override { return false; }
bool waitForFinished(int) override { return false; }
void kickoffProcess() override { m_terminal.kickoffProcess(); }
void interruptProcess() override { m_terminal.interruptProcess(); }
@@ -748,9 +748,11 @@ static QtcProcess::ProcessImpl defaultProcessImpl()
return QtcProcess::ProcessLauncherImpl;
}
QtcProcess::QtcProcess(ProcessImpl processImpl, ProcessMode processMode, TerminalMode terminalMode,
QObject *parent)
: QObject(parent), d(new QtcProcessPrivate(this, processImpl, processMode, terminalMode))
QtcProcess::QtcProcess(const Setup &setup, QObject *parent)
: QObject(parent),
d(new QtcProcessPrivate(this,
setup.processImpl == DefaultImpl ? defaultProcessImpl() : setup.processImpl,
setup.processMode, setup.terminalMode))
{
static int qProcessExitStatusMeta = qRegisterMetaType<QProcess::ExitStatus>();
static int qProcessProcessErrorMeta = qRegisterMetaType<QProcess::ProcessError>();
@@ -758,17 +760,9 @@ QtcProcess::QtcProcess(ProcessImpl processImpl, ProcessMode processMode, Termina
Q_UNUSED(qProcessProcessErrorMeta)
}
QtcProcess::QtcProcess(ProcessImpl processImpl, QObject *parent)
: QtcProcess(processImpl, ProcessMode::Reader, TerminalMode::TerminalOff, parent) {}
QtcProcess::QtcProcess(ProcessMode processMode, QObject *parent)
: QtcProcess(defaultProcessImpl(), processMode, TerminalMode::TerminalOff, parent) {}
QtcProcess::QtcProcess(TerminalMode terminalMode, QObject *parent)
: QtcProcess(defaultProcessImpl(), ProcessMode::Reader, terminalMode, parent) {}
QtcProcess::QtcProcess(QObject *parent)
: QtcProcess(defaultProcessImpl(), ProcessMode::Reader, TerminalMode::TerminalOff, parent) {}
: QtcProcess({}, parent)
{}
QtcProcess::~QtcProcess()
{

View File

@@ -62,7 +62,8 @@ class QTCREATOR_UTILS_EXPORT QtcProcess : public QObject
public:
enum ProcessImpl {
QProcessImpl,
ProcessLauncherImpl
ProcessLauncherImpl,
DefaultImpl,
};
enum TerminalMode {
@@ -73,12 +74,19 @@ public:
TerminalOn = TerminalRun // default mode for ON
};
QtcProcess(ProcessImpl processImpl, ProcessMode processMode, TerminalMode terminalMode,
QObject *parent = nullptr);
QtcProcess(ProcessImpl processImpl, QObject *parent = nullptr);
QtcProcess(ProcessMode processMode, QObject *parent = nullptr);
QtcProcess(TerminalMode terminalMode, QObject *parent = nullptr);
QtcProcess(QObject *parent = nullptr);
struct Setup {
Setup() {}
Setup(ProcessImpl processImpl) : processImpl(processImpl) {}
Setup(ProcessMode processMode) : processMode(processMode) {}
Setup(TerminalMode terminalMode) : terminalMode(terminalMode) {}
ProcessImpl processImpl = DefaultImpl;
ProcessMode processMode = ProcessMode::Reader;
TerminalMode terminalMode = TerminalOff;
};
QtcProcess(const Setup &setup = {}, QObject *parent = nullptr);
QtcProcess(QObject *parent);
~QtcProcess();
ProcessMode processMode() const;

View File

@@ -186,63 +186,6 @@ const CommandLine &TerminalProcess::commandLine() const
return d->m_commandLine;
}
static QString quoteWinCommand(const QString &program)
{
const QChar doubleQuote = QLatin1Char('"');
// add the program as the first arg ... it works better
QString programName = program;
programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
if (!programName.startsWith(doubleQuote) && !programName.endsWith(doubleQuote)
&& programName.contains(QLatin1Char(' '))) {
programName.prepend(doubleQuote);
programName.append(doubleQuote);
}
return programName;
}
static QString quoteWinArgument(const QString &arg)
{
if (arg.isEmpty())
return QString::fromLatin1("\"\"");
QString ret(arg);
// Quotes are escaped and their preceding backslashes are doubled.
ret.replace(QRegularExpression("(\\\\*)\""), "\\1\\1\\\"");
if (ret.contains(QRegularExpression("\\s"))) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
int i = ret.length();
while (i > 0 && ret.at(i - 1) == QLatin1Char('\\'))
--i;
ret.insert(i, QLatin1Char('"'));
ret.prepend(QLatin1Char('"'));
}
return ret;
}
// Quote a Windows command line correctly for the "CreateProcess" API
static QString createWinCommandline(const QString &program, const QStringList &args)
{
QString programName = quoteWinCommand(program);
for (const QString &arg : args) {
programName += QLatin1Char(' ');
programName += quoteWinArgument(arg);
}
return programName;
}
static QString createWinCommandline(const QString &program, const QString &args)
{
QString programName = quoteWinCommand(program);
if (!args.isEmpty()) {
programName += QLatin1Char(' ');
programName += args;
}
return programName;
}
void TerminalProcess::setAbortOnMetaChars(bool abort)
{
d->m_abortOnMetaChars = abort;
@@ -334,15 +277,66 @@ void TerminalProcess::start()
if (!workDir.isEmpty() && !workDir.endsWith(QLatin1Char('\\')))
workDir.append(QLatin1Char('\\'));
// Quote a Windows command line correctly for the "CreateProcess" API
static const auto quoteWinCommand = [](const QString &program) {
const QChar doubleQuote = QLatin1Char('"');
// add the program as the first arg ... it works better
QString programName = program;
programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
if (!programName.startsWith(doubleQuote) && !programName.endsWith(doubleQuote)
&& programName.contains(QLatin1Char(' '))) {
programName.prepend(doubleQuote);
programName.append(doubleQuote);
}
return programName;
};
static const auto quoteWinArgument = [](const QString &arg) {
if (arg.isEmpty())
return QString::fromLatin1("\"\"");
QString ret(arg);
// Quotes are escaped and their preceding backslashes are doubled.
ret.replace(QRegularExpression("(\\\\*)\""), "\\1\\1\\\"");
if (ret.contains(QRegularExpression("\\s"))) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
int i = ret.length();
while (i > 0 && ret.at(i - 1) == QLatin1Char('\\'))
--i;
ret.insert(i, QLatin1Char('"'));
ret.prepend(QLatin1Char('"'));
}
return ret;
};
static const auto createWinCommandlineMultiArgs = [](const QString &program, const QStringList &args) {
QString programName = quoteWinCommand(program);
for (const QString &arg : args) {
programName += QLatin1Char(' ');
programName += quoteWinArgument(arg);
}
return programName;
};
static const auto createWinCommandlineSingleArg = [](const QString &program, const QString &args)
{
QString programName = quoteWinCommand(program);
if (!args.isEmpty()) {
programName += QLatin1Char(' ');
programName += args;
}
return programName;
};
QStringList stubArgs;
stubArgs << modeOption(d->m_terminalMode)
<< d->m_stubServer.fullServerName()
<< workDir
<< (d->m_tempFile ? d->m_tempFile->fileName() : QString())
<< createWinCommandline(pcmd, pargs)
<< createWinCommandlineSingleArg(pcmd, pargs)
<< msgPromptToClose();
const QString cmdLine = createWinCommandline(
const QString cmdLine = createWinCommandlineMultiArgs(
QCoreApplication::applicationDirPath() + QLatin1String("/qtcreator_process_stub.exe"), stubArgs);
bool success = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),

View File

@@ -24,13 +24,13 @@
****************************************************************************/
#include "androidsdkdownloader.h"
#include "utils/filepath.h"
#include "utils/qtcprocess.h"
#include <utils/archive.h>
#include <utils/filepath.h>
#include <coreplugin/icore.h>
#include <QCryptographicHash>
#include <QDir>
#include <QDirIterator>
#include <QLoggingCategory>
#include <QStandardPaths>
@@ -61,22 +61,7 @@ void AndroidSdkDownloader::sslErrors(const QList<QSslError> &sslErrors)
}
#endif
static void setSdkFilesExecPermission( const FilePath &sdkExtractPath)
{
const FilePath filePath = sdkExtractPath / "tools";
filePath.iterateDirectory(
[](const FilePath &filePath) {
if (!filePath.fileName().contains('.')) {
QFlags<QFileDevice::Permission> currentPermissions = filePath.permissions();
filePath.setPermissions(currentPermissions | QFileDevice::ExeOwner);
}
return true;
},
{{"*"}, QDir::Files, QDirIterator::Subdirectories});
}
void AndroidSdkDownloader::downloadAndExtractSdk(const FilePath &jdkPath, const FilePath &sdkExtractPath)
void AndroidSdkDownloader::downloadAndExtractSdk(const FilePath &sdkExtractPath)
{
if (m_androidConfig.sdkToolsUrl().isEmpty()) {
logError(tr("The SDK Tools download URL is empty."));
@@ -103,34 +88,16 @@ void AndroidSdkDownloader::downloadAndExtractSdk(const FilePath &jdkPath, const
connect(m_progressDialog, &QProgressDialog::canceled, this, &AndroidSdkDownloader::cancel);
connect(this, &AndroidSdkDownloader::sdkPackageWriteFinished, this, [this, jdkPath, sdkExtractPath]() {
if (extractSdk(jdkPath, sdkExtractPath)) {
setSdkFilesExecPermission(sdkExtractPath);
emit sdkExtracted();
connect(this, &AndroidSdkDownloader::sdkPackageWriteFinished, this, [this, sdkExtractPath]() {
if (Archive *archive = Archive::unarchive(m_sdkFilename, sdkExtractPath)) {
connect(archive, &Archive::finished, [this, sdkExtractPath](bool success){
if (success)
emit sdkExtracted();
});
}
});
}
bool AndroidSdkDownloader::extractSdk(const FilePath &jdkPath, const FilePath &sdkExtractPath)
{
QDir sdkDir = sdkExtractPath.toDir();
if (!sdkDir.exists()) {
if (!sdkDir.mkpath(".")) {
logError(QString(tr("Could not create the SDK folder %1."))
.arg(sdkExtractPath.toUserOutput()));
return false;
}
}
QtcProcess jarExtractProc;
jarExtractProc.setWorkingDirectory(sdkExtractPath);
FilePath jarCmdPath(jdkPath / "/bin/jar");
jarExtractProc.setCommand({jarCmdPath, {"xf", m_sdkFilename.path()}});
jarExtractProc.runBlocking();
return jarExtractProc.exitCode() ? false : true;
}
bool AndroidSdkDownloader::verifyFileIntegrity()
{
QFile f(m_sdkFilename.toString());
@@ -170,7 +137,7 @@ void AndroidSdkDownloader::logError(const QString &error)
emit sdkDownloaderError(error);
}
QString AndroidSdkDownloader::getSaveFilename(const QUrl &url)
FilePath AndroidSdkDownloader::getSaveFilename(const QUrl &url)
{
QString path = url.path();
QString basename = QFileInfo(path).fileName();
@@ -186,9 +153,8 @@ QString AndroidSdkDownloader::getSaveFilename(const QUrl &url)
basename += QString::number(i);
}
QString fullPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)
+ QDir::separator() + basename;
return fullPath;
return FilePath::fromString(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))
/ basename;
}
bool AndroidSdkDownloader::saveToDisk(const FilePath &filename, QIODevice *data)
@@ -223,7 +189,7 @@ void AndroidSdkDownloader::downloadFinished(QNetworkReply *reply)
if (isHttpRedirect(reply)) {
cancelWithError(QString(tr("Download from %1 was redirected.")).arg(url.toString()));
} else {
m_sdkFilename = FilePath::fromString(getSaveFilename(url));
m_sdkFilename = getSaveFilename(url);
if (saveToDisk(m_sdkFilename, reply) && verifyFileIntegrity())
emit sdkPackageWriteFinished();
else

View File

@@ -43,7 +43,7 @@ class AndroidSdkDownloader : public QObject
public:
AndroidSdkDownloader();
void downloadAndExtractSdk(const Utils::FilePath &jdkPath, const Utils::FilePath &sdkExtractPath);
void downloadAndExtractSdk(const Utils::FilePath &sdkExtractPath);
static QString dialogTitle();
void cancel();
@@ -54,11 +54,10 @@ signals:
void sdkDownloaderError(const QString &error);
private:
static QString getSaveFilename(const QUrl &url);
static Utils::FilePath getSaveFilename(const QUrl &url);
bool saveToDisk(const Utils::FilePath &filename, QIODevice *data);
static bool isHttpRedirect(QNetworkReply *m_reply);
bool extractSdk(const Utils::FilePath &jdkPath, const Utils::FilePath &sdkExtractPath);
bool verifyFileIntegrity();
void cancelWithError(const QString &error);
void logError(const QString &error);

View File

@@ -712,14 +712,8 @@ void AndroidSettingsWidget::downloadSdk()
.arg(m_ui.SDKLocationPathChooser->filePath().cleanPath().toUserOutput());
auto userInput = QMessageBox::information(this, AndroidSdkDownloader::dialogTitle(),
message, QMessageBox::Yes | QMessageBox::No);
if (userInput == QMessageBox::Yes) {
if (m_androidSummary->rowsOk({JavaPathExistsAndWritableRow})) {
auto javaPath = m_ui.OpenJDKLocationPathChooser->filePath();
m_sdkDownloader.downloadAndExtractSdk(
javaPath,
m_ui.SDKLocationPathChooser->filePath().cleanPath());
}
}
if (userInput == QMessageBox::Yes)
m_sdkDownloader.downloadAndExtractSdk(m_ui.SDKLocationPathChooser->filePath().cleanPath());
}
// AndroidSettingsPage

View File

@@ -2458,6 +2458,13 @@ QTextCursor ClangdClient::Private::adjustedCursor(const QTextCursor &cursor,
}
return cursor;
}
// ~My|Class
if (const DestructorNameAST * const destrAst = (*it)->asDestructorName()) {
QTextCursor c = cursor;
c.setPosition(posForToken(destrAst->tilde_token));
return c;
}
}
return cursor;
}

View File

@@ -1,5 +1,5 @@
add_qtc_plugin(ClangFormat
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND (QTC_CLANG_BUILDMODE_MATCH OR CLANGTOOLING_LINK_CLANG_DYLIB)
DEPENDS Utils Qt5::Widgets ${CLANG_FORMAT_LIB}
INCLUDES "${CLANG_INCLUDE_DIRS}"
PLUGIN_DEPENDS Core TextEditor CppEditor ProjectExplorer
@@ -15,6 +15,10 @@ add_qtc_plugin(ClangFormat
clangformatutils.cpp clangformatutils.h
)
if(MSVC AND TARGET ClangFormat)
target_compile_options(ClangFormat PUBLIC /wd4267 /wd4624)
endif()
extend_qtc_plugin(ClangFormat
CONDITION UNIX AND NOT APPLE
PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL"

View File

@@ -353,6 +353,8 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_showProgressTimer.start();
});
m_configModel->setMacroExpander(m_buildConfiguration->macroExpander());
if (bc->buildSystem()->isParsing())
m_showProgressTimer.start();
else {
@@ -368,6 +370,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_configModel->setInitialParametersConfiguration(
m_buildConfiguration->initialCMakeConfiguration());
m_buildConfiguration->filterConfigArgumentsFromAdditionalCMakeArguments();
updateFromKit();
m_configView->expandAll();
m_configView->setEnabled(true);
stretcher->stretch();

View File

@@ -26,6 +26,7 @@
#include "configmodel.h"
#include <utils/algorithm.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
#include <utils/theme/theme.h>
@@ -315,34 +316,37 @@ void ConfigModel::setConfiguration(const QList<ConfigModel::InternalDataItem> &c
generateTree();
}
Utils::MacroExpander *ConfigModel::macroExpander() const
{
return m_macroExpander;
}
void ConfigModel::setMacroExpander(Utils::MacroExpander *newExpander)
{
m_macroExpander = newExpander;
}
void ConfigModel::generateTree()
{
QHash<QString, InternalDataItem> initialHash;
for (const InternalDataItem &di : m_configuration)
if (di.isInitial)
initialHash.insert(di.key, di);
auto root = new Utils::TreeItem;
for (InternalDataItem &di : m_configuration)
for (InternalDataItem &di : m_configuration) {
auto it = initialHash.find(di.key);
if (it != initialHash.end())
di.initialValue = macroExpander()->expand(it->value);
root->appendChild(new Internal::ConfigModelTreeItem(&di));
}
setRootItem(root);
}
ConfigModel::InternalDataItem::InternalDataItem(const ConfigModel::DataItem &item) : DataItem(item)
{ }
QString ConfigModel::InternalDataItem::toolTip() const
{
QString desc = description;
if (isAdvanced)
desc += QCoreApplication::translate("CMakeProjectManager::ConfigModel", " (ADVANCED)");
QStringList tooltip(desc);
if (inCMakeCache) {
if (value != newValue)
tooltip << QCoreApplication::translate("CMakeProjectManager", "Current CMake: %1").arg(value);
} else {
tooltip << QCoreApplication::translate("CMakeProjectManager", "Not in CMakeCache.txt").arg(value);
}
if (!kitValue.isEmpty())
tooltip << QCoreApplication::translate("CMakeProjectManager::ConfigModel", "Current kit: %1").arg(kitValue);
return tooltip.join("<br>");
}
QString ConfigModel::InternalDataItem::currentValue() const
{
if (isUnset)
@@ -414,9 +418,15 @@ QVariant ConfigModelTreeItem::data(int column, int role) const
font.setStrikeOut((!dataItem->inCMakeCache && !dataItem->isUserNew) || dataItem->isUnset);
return font;
}
case Qt::ForegroundRole:
return Utils::creatorTheme()->color((!dataItem->kitValue.isNull() && dataItem->kitValue != value)
? Utils::Theme::TextColorHighlight : Utils::Theme::TextColorNormal);
case Qt::ForegroundRole: {
bool mismatch = false;
if (dataItem->isInitial)
mismatch = !dataItem->kitValue.isEmpty() && dataItem->kitValue != value;
else
mismatch = !dataItem->initialValue.isEmpty() && dataItem->initialValue != value;
return Utils::creatorTheme()->color(mismatch ? Utils::Theme::TextColorHighlight
: Utils::Theme::TextColorNormal);
}
case Qt::ToolTipRole: {
return toolTip();
}
@@ -492,16 +502,36 @@ Qt::ItemFlags ConfigModelTreeItem::flags(int column) const
QString ConfigModelTreeItem::toolTip() const
{
QTC_ASSERT(dataItem, return QString());
QStringList tooltip(dataItem->description);
if (!dataItem->kitValue.isEmpty())
tooltip << QCoreApplication::translate("CMakeProjectManager", "Value requested by kit: %1").arg(dataItem->kitValue);
if (dataItem->inCMakeCache) {
QStringList tooltip;
if (!dataItem->description.isEmpty())
tooltip << dataItem->description;
if (dataItem->isInitial) {
if (!dataItem->kitValue.isEmpty())
tooltip << QCoreApplication::translate("CMakeProjectManager", "<p>Kit: <b>%1</b></p>")
.arg(dataItem->kitValue);
if (dataItem->value != dataItem->newValue)
tooltip << QCoreApplication::translate("CMakeProjectManager", "Current CMake: %1").arg(dataItem->value);
} else {
tooltip << QCoreApplication::translate("CMakeProjectManager", "Not in CMakeCache.txt");
tooltip << QCoreApplication::translate("CMakeProjectManager",
"<p>Initial Configuration: <b>%1</b></p>")
.arg(dataItem->value);
} else {
if (!dataItem->initialValue.isEmpty())
tooltip << QCoreApplication::translate("CMakeProjectManager",
"<p>Initial Configuration: <b>%1</b></p>")
.arg(dataItem->initialValue);
if (dataItem->inCMakeCache) {
if (dataItem->value != dataItem->newValue)
tooltip << QCoreApplication::translate("CMakeProjectManager",
"<p>Current Configuration: <b>%1</b></p>")
.arg(dataItem->value);
} else {
tooltip << QCoreApplication::translate("CMakeProjectManager",
"<p>Not in CMakeCache.txt</p>");
}
}
return tooltip.join("<br>");
return tooltip.join("");
}
QString ConfigModelTreeItem::currentValue() const

View File

@@ -162,6 +162,8 @@ public:
QList<DataItem> configurationForCMake() const;
Utils::MacroExpander *macroExpander() const;
void setMacroExpander(Utils::MacroExpander *newExpander);
private:
class InternalDataItem : public DataItem
@@ -170,13 +172,13 @@ private:
InternalDataItem(const DataItem &item);
InternalDataItem(const InternalDataItem &item) = default;
QString toolTip() const;
QString currentValue() const;
bool isUserChanged = false;
bool isUserNew = false;
QString newValue;
QString kitValue;
QString initialValue;
};
void generateTree();
@@ -184,6 +186,7 @@ private:
void setConfiguration(const QList<InternalDataItem> &config);
QList<InternalDataItem> m_configuration;
KitConfiguration m_kitConfiguration;
Utils::MacroExpander *m_macroExpander = nullptr;
friend class Internal::ConfigModelTreeItem;
};

View File

@@ -137,21 +137,6 @@ void FileUtils::showInFileSystemView(const FilePath &path)
navWidget->syncWithFilePath(path);
}
static QString quoteWinCommand(const QString &program)
{
const QChar doubleQuote = QLatin1Char('"');
// add the program as the first arg ... it works better
QString programName = program;
programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
if (!programName.startsWith(doubleQuote) && !programName.endsWith(doubleQuote)
&& programName.contains(QLatin1Char(' '))) {
programName.prepend(doubleQuote);
programName.append(doubleQuote);
}
return programName;
}
static void startTerminalEmulator(const QString &workingDir, const Environment &env)
{
#ifdef Q_OS_WIN
@@ -162,6 +147,19 @@ static void startTerminalEmulator(const QString &workingDir, const Environment &
PROCESS_INFORMATION pinfo;
ZeroMemory(&pinfo, sizeof(pinfo));
static const auto quoteWinCommand = [](const QString &program) {
const QChar doubleQuote = QLatin1Char('"');
// add the program as the first arg ... it works better
QString programName = program;
programName.replace(QLatin1Char('/'), QLatin1Char('\\'));
if (!programName.startsWith(doubleQuote) && !programName.endsWith(doubleQuote)
&& programName.contains(QLatin1Char(' '))) {
programName.prepend(doubleQuote);
programName.append(doubleQuote);
}
return programName;
};
const QString cmdLine = quoteWinCommand(QString::fromLocal8Bit(qgetenv("COMSPEC")));
// cmdLine is assumed to be detached -
// https://blogs.msdn.microsoft.com/oldnewthing/20090601-00/?p=18083

View File

@@ -72,7 +72,7 @@ static QString indexerFileSizeLimitKey()
{ return QLatin1String(Constants::CPPEDITOR_INDEXER_FILE_SIZE_LIMIT); }
static QString clangdSettingsKey() { return QLatin1String("ClangdSettings"); }
static QString useClangdKey() { return QLatin1String("UseClangd"); }
static QString useClangdKey() { return QLatin1String("UseClangdV7"); }
static QString clangdPathKey() { return QLatin1String("ClangdPath"); }
static QString clangdIndexingKey() { return QLatin1String("ClangdIndexing"); }
static QString clangdHeaderInsertionKey() { return QLatin1String("ClangdHeaderInsertion"); }
@@ -485,7 +485,7 @@ QVariantMap ClangdSettings::Data::toMap() const
void ClangdSettings::Data::fromMap(const QVariantMap &map)
{
useClangd = map.value(useClangdKey(), false).toBool();
useClangd = map.value(useClangdKey(), true).toBool();
executableFilePath = FilePath::fromString(map.value(clangdPathKey()).toString());
enableIndexing = map.value(clangdIndexingKey(), true).toBool();
autoIncludeHeaders = map.value(clangdHeaderInsertionKey(), false).toBool();

View File

@@ -122,7 +122,7 @@ public:
Utils::FilePath executableFilePath;
QStringList sessionsWithOneClangd;
int workerThreadLimit = 0;
bool useClangd = false;
bool useClangd = true;
bool enableIndexing = true;
bool autoIncludeHeaders = false;
int documentUpdateThreshold = 500;

View File

@@ -263,10 +263,6 @@ F2TestCase::F2TestCase(CppEditorAction action,
QSKIP("fuzzy matching is not supposed to work with clangd"); // TODO: Implement fallback as we do with libclang
if (tag == "baseClassFunctionIntroducedByUsingDeclaration")
QSKIP("clangd points to the using declaration");
if (tag == "classDestructor" || tag == "fromDestructorDefinitionSymbol"
|| tag == "fromDestructorBody") {
QSKIP("clangd wants the cursor before the ~ character");
}
if (curTestName == "testFollowClassOperatorInOp")
QSKIP("clangd goes to operator name first");
}
@@ -438,6 +434,10 @@ F2TestCase::F2TestCase(CppEditorAction action,
} else {
currentTextEditor->convertPosition(targetTestFile->m_targetCursorPosition,
&expectedLine, &expectedColumn);
if (useClangd && (tag == "classDestructor" || tag == "fromDestructorDefinitionSymbol"
|| tag == "fromDestructorBody")) {
--expectedColumn; // clangd goes before the ~, built-in code model after
}
}
// qDebug() << "Expected line:" << expectedLine;
// qDebug() << "Expected column:" << expectedColumn;

View File

@@ -1053,19 +1053,23 @@ void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource
QString *logMessage)
{
QStringList logMessages{tr("Removing debugger entries...")};
d->m_model->forItemsAtLevel<2>([detectionSource, &logMessages](DebuggerTreeItem *titem) {
QList<DebuggerTreeItem *> toBeRemoved;
d->m_model->forItemsAtLevel<2>([detectionSource, &toBeRemoved](DebuggerTreeItem *titem) {
if (titem->m_item.detectionSource() == detectionSource) {
logMessages.append(tr("Removed \"%1\"").arg(titem->m_item.displayName()));
d->m_model->destroyItem(titem);
toBeRemoved.append(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 (filePath.scheme() + ':' + filePath.host() == detectionSource)
toBeRemoved.append(titem);
});
for (DebuggerTreeItem *current : toBeRemoved) {
logMessages.append(tr("Removed \"%1\"").arg(current->m_item.displayName()));
d->m_model->destroyItem(current);
}
if (logMessage)
*logMessage = logMessages.join('\n');
}

View File

@@ -154,7 +154,7 @@ void DockerDeviceProcess::start(const Runnable &runnable)
m_process.setCommand(command);
m_process.setEnvironment(runnable.environment);
m_process.setWorkingDirectory(runnable.workingDirectory);
connect(&m_process, &QtcProcess::errorOccurred, this, &DeviceProcess::error);
connect(&m_process, &QtcProcess::errorOccurred, this, &DeviceProcess::errorOccurred);
connect(&m_process, &QtcProcess::finished, this, &DeviceProcess::finished);
connect(&m_process, &QtcProcess::readyReadStandardOutput,
this, &DeviceProcess::readyReadStandardOutput);
@@ -569,7 +569,7 @@ DockerDevice::DockerDevice(const DockerDeviceData &data)
}
proc->deleteLater();
});
QObject::connect(proc, &DeviceProcess::error, [proc] {
QObject::connect(proc, &DeviceProcess::errorOccurred, [proc] {
MessageManager::writeDisrupting(tr("Error starting remote shell."));
proc->deleteLater();
});
@@ -628,9 +628,9 @@ void KitDetectorPrivate::undoAutoDetect() const
};
emit q->logOutput('\n' + tr("Removing toolchain entries..."));
for (ToolChain *toolChain : ToolChainManager::toolchains()) {
QString detectionSource = toolChain->detectionSource();
if (toolChain->detectionSource() == m_sharedId) {
const Toolchains toolchains = ToolChainManager::toolchains();
for (ToolChain *toolChain : toolchains) {
if (toolChain && toolChain->detectionSource() == m_sharedId) {
emit q->logOutput(tr("Removed \"%1\"").arg(toolChain->displayName()));
ToolChainManager::deregisterToolChain(toolChain);
}
@@ -709,20 +709,26 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const
QtVersions qtVersions;
QString error;
const auto handleQmake = [this, &qtVersions, &error](const FilePath &qmake) {
if (QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQMakePath(qmake, false, m_sharedId, &error)) {
qtVersions.append(qtVersion);
QtVersionManager::addVersion(qtVersion);
emit q->logOutput(tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput()));
}
return true;
};
emit q->logOutput(tr("Searching for qmake executables..."));
const QStringList candidates = {"qmake-qt6", "qmake-qt5", "qmake"};
emit q->logOutput('\n' + tr("Searching Qt installations..."));
for (const QString &candidate : candidates) {
emit q->logOutput(tr("Searching for %1 executable...").arg(candidate));
const FilePath qmake = m_device->searchExecutable(candidate, m_searchPaths);
if (qmake.isEmpty())
continue;
QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQMakePath(qmake, false, m_sharedId, &error);
if (!qtVersion)
continue;
qtVersions.append(qtVersion);
QtVersionManager::addVersion(qtVersion);
emit q->logOutput(tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput()));
for (const FilePath &searchPath : m_searchPaths) {
searchPath.iterateDirectory(handleQmake, {candidates, QDir::Files | QDir::Executable,
QDirIterator::Subdirectories});
}
if (!error.isEmpty())
emit q->logOutput(tr("Error: %1.").arg(error));
if (qtVersions.isEmpty())
emit q->logOutput(tr("No Qt installation found."));
return qtVersions;
@@ -793,19 +799,20 @@ void KitDetectorPrivate::autoDetect()
emit q->logOutput(tr("Starting auto-detection. This will take a while..."));
QList<ToolChain *> toolChains = autoDetectToolChains();
QtVersions qtVersions = autoDetectQtVersions();
const Toolchains toolchains = autoDetectToolChains();
const QtVersions qtVersions = autoDetectQtVersions();
autoDetectCMake();
autoDetectDebugger();
const auto initializeKit = [this, toolChains, qtVersions](Kit *k) {
const auto initializeKit = [this, toolchains, qtVersions](Kit *k) {
k->setAutoDetected(false);
k->setAutoDetectionSource(m_sharedId);
k->setUnexpandedDisplayName("%{Device:Name}");
DeviceTypeKitAspect::setDeviceTypeId(k, Constants::DOCKER_DEVICE_TYPE);
DeviceKitAspect::setDevice(k, m_device);
QtVersion *qt = nullptr;
if (!qtVersions.isEmpty()) {
qt = qtVersions.at(0);
@@ -1495,17 +1502,19 @@ void DockerDevice::iterateWithFind(const FilePath &filePath,
const QString nameOption = (filters & QDir::CaseSensitive) ? QString{"-name"}
: QString{"-iname"};
QStringList criticalWildcards;
if (!filter.nameFilters.isEmpty()) {
const QRegularExpression oneChar("\\[.*?\\]");
for (int i = 0, len = filter.nameFilters.size(); i < len; ++i) {
if (i > 0)
bool addedFirst = false;
for (const QString &current : filter.nameFilters) {
if (current.indexOf(oneChar) != -1) {
LOG("Skipped" << current << "due to presence of [] wildcard");
continue;
}
if (addedFirst)
filterOptions << "-o";
QString current = filter.nameFilters.at(i);
if (current.indexOf(oneChar) != -1)
criticalWildcards.append(current);
current.replace(oneChar, "?"); // BAD! but still better than nothing
filterOptions << nameOption << current;
addedFirst = true;
}
}
arguments << filterOptions;
@@ -1522,17 +1531,6 @@ void DockerDevice::iterateWithFind(const FilePath &filePath,
continue;
const FilePath fp = FilePath::fromString(entry);
if (!criticalWildcards.isEmpty() &&
!Utils::anyOf(criticalWildcards,
[name = fp.fileName()](const QString &pattern) {
const QRegularExpression regex(QRegularExpression::wildcardToRegularExpression(pattern));
if (regex.match(name).hasMatch())
return true;
return false;
})) {
continue;
}
if (!callBack(fp.onDevice(filePath)))
break;
}

View File

@@ -149,7 +149,7 @@ void PerfConfigWidget::setTarget(ProjectExplorer::Target *target)
connect(m_process.get(), &ProjectExplorer::DeviceProcess::finished,
this, &PerfConfigWidget::handleProcessFinished);
connect(m_process.get(), &ProjectExplorer::DeviceProcess::error,
connect(m_process.get(), &ProjectExplorer::DeviceProcess::errorOccurred,
this, &PerfConfigWidget::handleProcessError);
useTracePointsButton->setEnabled(true);

View File

@@ -133,7 +133,7 @@ public:
connect(m_process, &DeviceProcess::started, this, &RunWorker::reportStarted);
connect(m_process, &DeviceProcess::finished, this, &RunWorker::reportStopped);
connect(m_process, &DeviceProcess::error, [this](QProcess::ProcessError e) {
connect(m_process, &DeviceProcess::errorOccurred, [this](QProcess::ProcessError e) {
// The terminate() below will frequently lead to QProcess::Crashed. We're not interested
// in that. FailedToStart is the only actual failure.
if (e == QProcess::FailedToStart) {

View File

@@ -113,7 +113,7 @@ void PerfTracePointDialog::runScript()
connect(m_process.get(), &DeviceProcess::finished,
this, &PerfTracePointDialog::handleProcessFinished);
connect(m_process.get(), &DeviceProcess::error,
connect(m_process.get(), &DeviceProcess::errorOccurred,
this, &PerfTracePointDialog::handleProcessError);
m_process->start(runnable);

View File

@@ -424,7 +424,7 @@ void ApplicationLauncherPrivate::start(const Runnable &runnable, const IDevice::
this, &ApplicationLauncherPrivate::handleRemoteStdout);
connect(m_deviceProcess, &DeviceProcess::readyReadStandardError,
this, &ApplicationLauncherPrivate::handleRemoteStderr);
connect(m_deviceProcess, &DeviceProcess::error,
connect(m_deviceProcess, &DeviceProcess::errorOccurred,
this, &ApplicationLauncherPrivate::handleApplicationError);
connect(m_deviceProcess, &DeviceProcess::finished,
this, &ApplicationLauncherPrivate::handleApplicationFinished);

View File

@@ -42,7 +42,7 @@ DesktopDeviceProcess::DesktopDeviceProcess(const QSharedPointer<const IDevice> &
: DeviceProcess(device, parent)
, m_process(ProcessMode::Writer)
{
connect(&m_process, &QtcProcess::errorOccurred, this, &DeviceProcess::error);
connect(&m_process, &QtcProcess::errorOccurred, this, &DeviceProcess::errorOccurred);
connect(&m_process, &QtcProcess::finished, this, &DeviceProcess::finished);
connect(&m_process, &QtcProcess::readyReadStandardOutput,
this, &DeviceProcess::readyReadStandardOutput);

View File

@@ -112,7 +112,7 @@ void DeviceManager::replaceInstance()
const QList<Id> newIds =
Utils::transform(DeviceManagerPrivate::clonedInstance->d->devices, &IDevice::id);
for (const IDevice::ConstPtr &dev : qAsConst(m_instance->d->devices)) {
for (const IDevice::Ptr &dev : qAsConst(m_instance->d->devices)) {
if (!newIds.contains(dev->id()))
dev->aboutToBeRemoved();
}
@@ -144,7 +144,7 @@ DeviceManager *DeviceManager::cloneInstance()
void DeviceManager::copy(const DeviceManager *source, DeviceManager *target, bool deep)
{
if (deep) {
for (const IDevice::ConstPtr &device : qAsConst(source->d->devices))
for (const IDevice::Ptr &device : qAsConst(source->d->devices))
target->d->devices << device->clone();
} else {
target->d->devices = source->d->devices;
@@ -265,7 +265,7 @@ QVariantMap DeviceManager::toMap() const
}
map.insert(QLatin1String(DefaultDevicesKey), defaultDeviceMap);
QVariantList deviceList;
for (const IDevice::ConstPtr &device : qAsConst(d->devices))
for (const IDevice::Ptr &device : qAsConst(d->devices))
deviceList << device->toMap();
map.insert(QLatin1String(DeviceListKey), deviceList);
return map;
@@ -276,7 +276,7 @@ void DeviceManager::addDevice(const IDevice::ConstPtr &_device)
const IDevice::Ptr device = _device->clone();
QStringList names;
for (const IDevice::ConstPtr &tmp : qAsConst(d->devices)) {
for (const IDevice::Ptr &tmp : qAsConst(d->devices)) {
if (tmp->id() != device->id())
names << tmp->displayName();
}
@@ -366,7 +366,7 @@ bool DeviceManager::isLoaded() const
IDevice::ConstPtr DeviceManager::deviceForPath(const FilePath &path)
{
const QList<IDevice::Ptr> devices = instance()->d->deviceList();
for (const IDevice::ConstPtr &dev : devices) {
for (const IDevice::Ptr &dev : devices) {
// TODO: ensure handlesFile is thread safe
if (dev->handlesFile(path))
return dev;

View File

@@ -62,7 +62,7 @@ public:
signals:
void started();
void finished();
void error(QProcess::ProcessError error);
void errorOccurred(QProcess::ProcessError error);
void readyReadStandardOutput();
void readyReadStandardError();

View File

@@ -79,7 +79,7 @@ void DeviceUsedPortsGatherer::start(const IDevice::ConstPtr &device)
connect(d->process.data(), &DeviceProcess::finished,
this, &DeviceUsedPortsGatherer::handleProcessFinished);
connect(d->process.data(), &DeviceProcess::error,
connect(d->process.data(), &DeviceProcess::errorOccurred,
this, &DeviceUsedPortsGatherer::handleProcessError);
connect(d->process.data(), &DeviceProcess::readyReadStandardOutput,
this, &DeviceUsedPortsGatherer::handleRemoteStdOut);

View File

@@ -193,7 +193,7 @@ void SshDeviceProcess::handleConnected()
d->process->requestX11Forwarding(display);
if (runInTerminal()) {
connect(&d->consoleProcess, &QtcProcess::errorOccurred,
this, &DeviceProcess::error);
this, &DeviceProcess::errorOccurred);
connect(&d->consoleProcess, &QtcProcess::started,
this, &SshDeviceProcess::handleProcessStarted);
connect(&d->consoleProcess, &QtcProcess::finished,
@@ -230,7 +230,7 @@ void SshDeviceProcess::handleDisconnected()
switch (oldState) {
case SshDeviceProcessPrivate::Connecting:
case SshDeviceProcessPrivate::Connected:
emit error(QProcess::FailedToStart);
emit errorOccurred(QProcess::FailedToStart);
break;
case SshDeviceProcessPrivate::ProcessRunning:
d->exitStatus = QProcess::CrashExit;
@@ -316,7 +316,7 @@ void SshDeviceProcess::SshDeviceProcessPrivate::doSignal(Signal signal)
case SshDeviceProcessPrivate::Connecting:
errorMessage = tr("Terminated by request.");
setState(SshDeviceProcessPrivate::Inactive);
emit q->error(QProcess::FailedToStart);
emit q->errorOccurred(QProcess::FailedToStart);
break;
case SshDeviceProcessPrivate::Connected:
case SshDeviceProcessPrivate::ProcessRunning:

View File

@@ -791,7 +791,8 @@ QStringList SessionManager::sessions()
{
if (d->m_sessions.isEmpty()) {
// We are not initialized yet, so do that now
const FilePaths sessionFiles = ICore::userResourcePath().dirEntries({{"*qws"}}, QDir::Time);
const FilePaths sessionFiles =
ICore::userResourcePath().dirEntries({{"*qws"}}, QDir::Time | QDir::Reversed);
for (const FilePath &file : sessionFiles) {
const QString &name = file.completeBaseName();
d->m_sessionDateTimes.insert(name, file.lastModified());

View File

@@ -92,6 +92,8 @@ Edit3DWidget *Edit3DView::edit3DWidget() const
void Edit3DView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList, const QList<ModelNode> &lastSelectedNodeList)
{
Q_UNUSED(selectedNodeList)
Q_UNUSED(lastSelectedNodeList)
SelectionContext selectionContext(this);
selectionContext.setUpdateMode(SelectionContext::UpdateMode::Fast);
if (m_alignCamerasAction)

View File

@@ -1348,7 +1348,7 @@ void TextToModelMerger::syncNode(ModelNode &modelNode,
syncExpressionProperty(modelProperty, astValue, astType, differenceHandler);
}
modelPropertyNames.remove(astName.toUtf8());
} else if (auto source = AST::cast<AST::UiSourceElement *>(member)) {
} else if (AST::cast<AST::UiSourceElement *>(member)) {
// function et al
} else {
qWarning() << "Found an unknown QML value.";

View File

@@ -104,7 +104,7 @@ void QnxDevice::updateVersionNumber() const
QEventLoop eventLoop;
SshDeviceProcess versionNumberProcess(sharedFromThis());
QObject::connect(&versionNumberProcess, &SshDeviceProcess::finished, &eventLoop, &QEventLoop::quit);
QObject::connect(&versionNumberProcess, &DeviceProcess::error, &eventLoop, &QEventLoop::quit);
QObject::connect(&versionNumberProcess, &DeviceProcess::errorOccurred, &eventLoop, &QEventLoop::quit);
Runnable r;
r.command = {"uname", {"-r"}};

View File

@@ -60,7 +60,7 @@ Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl)
m_logProcess = new QnxDeviceProcess(device(), this);
connect(m_logProcess, &DeviceProcess::readyReadStandardOutput, this, &Slog2InfoRunner::readLogStandardOutput);
connect(m_logProcess, &DeviceProcess::readyReadStandardError, this, &Slog2InfoRunner::readLogStandardError);
connect(m_logProcess, &DeviceProcess::error, this, &Slog2InfoRunner::handleLogError);
connect(m_logProcess, &DeviceProcess::errorOccurred, this, &Slog2InfoRunner::handleLogError);
}
void Slog2InfoRunner::printMissingWarning()

View File

@@ -201,7 +201,7 @@ public:
{
delete m_shell;
m_shell = nullptr;
DEBUG("Failed to connect to " << parameters.host());
qCDebug(linuxDeviceLog) << "Failed to connect to" << parameters.host();
return false;
}
@@ -324,7 +324,7 @@ LinuxDevice::LinuxDevice()
}
proc->deleteLater();
});
QObject::connect(proc, &DeviceProcess::error, [proc] {
QObject::connect(proc, &DeviceProcess::errorOccurred, [proc] {
Core::MessageManager::writeDisrupting(tr("Error starting remote shell."));
proc->deleteLater();
});
@@ -440,7 +440,7 @@ bool LinuxDevice::handlesFile(const FilePath &filePath) const
return filePath.scheme() == "ssh" && filePath.host() == userAtHost();
}
void LinuxDevice::runProcess(QtcProcess &process) const
void LinuxDevice::runProcess(QtcProcess &) const
{
QTC_CHECK(false); // FIXME: Implement
}

View File

@@ -82,7 +82,7 @@ public:
QByteArray fileContents(const Utils::FilePath &filePath, qint64 limit, qint64 offset) const override;
bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const override;
QDateTime lastModified(const Utils::FilePath &filePath) const override;
void runProcess(Utils::QtcProcess &process) const override;
void runProcess(Utils::QtcProcess &) const override;
qint64 fileSize(const Utils::FilePath &filePath) const override;
qint64 bytesAvailable(const Utils::FilePath &filePath) const override;
QFileDevice::Permissions permissions(const Utils::FilePath &filePath) const override;

View File

@@ -54,7 +54,7 @@ void RemoteLinuxEnvironmentReader::start()
}
m_stop = false;
m_deviceProcess = m_device->createProcess(this);
connect(m_deviceProcess, &DeviceProcess::error,
connect(m_deviceProcess, &DeviceProcess::errorOccurred,
this, &RemoteLinuxEnvironmentReader::handleError);
connect(m_deviceProcess, &DeviceProcess::finished,
this, &RemoteLinuxEnvironmentReader::remoteProcessFinished);

View File

@@ -178,6 +178,15 @@ extend_qtc_executable(qml2puppet
DEFINES QUICK3D_PARTICLES_MODULE
)
# Quick3DAssetUtils optionally depends on QuickTimeline, so find also it to make the CI build work
find_package(Qt5 5.15.0 COMPONENTS Quick3DAssetUtils QuickTimeline QUIET)
extend_qtc_executable(qml2puppet
CONDITION TARGET Qt5::Quick3DAssetUtils
FEATURE_INFO "Qt Quick 3D asset utils"
DEPENDS Qt5::Quick3DAssetUtilsPrivate
DEFINES QUICK3D_ASSET_UTILS_MODULE
)
extend_qtc_executable(qml2puppet
CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.0.0