Merge "Merge remote-tracking branch 'origin/12.0'"

This commit is contained in:
The Qt Project
2023-12-07 07:58:30 +00:00
31 changed files with 330 additions and 120 deletions

97
dist/changelog/changes-12.0.1.md vendored Normal file
View File

@@ -0,0 +1,97 @@
Qt Creator 12.0.1
=================
Qt Creator version 12.0.1 contains bug fixes.
The most important changes are listed in this document. For a complete list of
changes, see the Git log for the Qt Creator sources that you can check out from
the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/v12.0.0..v12.0.1
General
-------
* Fixed opening files with drag and drop on Qt Creator
(QTCREATORBUG-29961)
Editing
-------
### C++
* Fixed a crash while parsing
(QTCREATORBUG-29847)
* Fixed a freeze when hovering over a class declaration
(QTCREATORBUG-29975)
* Fixed the renaming of virtual functions
* Fixed `Select Block Up` for string literals
(QTCREATORBUG-29844)
* Fixed the conversion between comment styles for certain indented comments
Projects
--------
* Fixed the restoring of custom Kit data
(QTCREATORBUG-29970)
* Fixed overlapping labels in the target selector
(QTCREATORBUG-29990)
* Fixed the label for `Custom Executable` run configurations
(QTCREATORBUG-29983)
### CMake
* Fixed a crash when opening projects
(QTCREATORBUG-29965)
Analyzer
--------
### Valgrind
* Fixed stopping the Valgrind process
(QTCREATORBUG-29948)
Version Control Systems
-----------------------
### Git
* Fixed that empty blame annotations are shown after saving a file outside of
the version control directory
(QTCREATORBUG-29991)
Platforms
---------
### Linux
* Added an error dialog for errors when loading the Qt platform plugin
(QTCREATORBUG-30004)
### Boot2Qt
* Fixed deployment on Windows
(QTCREATORBUG-29971)
### MCU
* Fixed `Replace existing kits` after changing MCU SDK path
(QTCREATORBUG-29960)
Credits for these changes go to:
--------------------------------
Alessandro Portale
Andre Hartmann
Christian Kandeler
Christian Stenger
Cristian Adam
Eike Ziller
Jaroslaw Kobus
Marcus Tillmanns
Orgad Shaneh
Robert Löhning
Samuli Piippo
Tor Arne Vestbø
Yasser Grimes

View File

@@ -704,13 +704,20 @@ class QtcInternalDumper():
def runit(self): def runit(self):
print('DIR: %s' % dir()) print('DIR: %s' % dir())
print('ARGV: %s' % sys.argv)
if sys.argv[0] == '-c': if sys.argv[0] == '-c':
sys.argv = sys.argv[2:] sys.argv = sys.argv[2:]
else: else:
sys.argv = sys.argv[1:] sys.argv = sys.argv[1:]
print('ARGV: %s' % sys.argv)
mainpyfile = sys.argv[0] # Get script filename mainpyfile = sys.argv[0] # Get script filename
sys.path.append(os.path.dirname(mainpyfile)) sys.path.append(os.path.dirname(mainpyfile))
# Delete arguments superfluous to the inferior
try:
args_pos = sys.argv.index("--")
sys.argv = [sys.argv[0]] + sys.argv[args_pos + 1:]
except ValueError:
pass
print('INFERIOR ARGV: %s' % sys.argv)
print('MAIN: %s' % mainpyfile) print('MAIN: %s' % mainpyfile)
while True: while True:

View File

@@ -478,6 +478,53 @@ bool startCrashpad(const QString &libexecPath, bool crashReportingEnabled)
} }
#endif #endif
class ShowInGuiHandler
{
public:
ShowInGuiHandler()
{
instance = this;
oldHandler = qInstallMessageHandler(log);
}
~ShowInGuiHandler() { qInstallMessageHandler(oldHandler); };
private:
static void log(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
instance->messages += msg;
if (type == QtFatalMsg) {
// Show some kind of GUI with collected messages before exiting.
// For Windows, Qt already uses a dialog.
if (Utils::HostOsInfo::isLinuxHost()) {
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && QT_VERSION < QT_VERSION_CHECK(6, 5, 3)) \
|| (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) && QT_VERSION < QT_VERSION_CHECK(6, 6, 1))
// Information about potentially missing libxcb-cursor0 is printed by Qt since Qt 6.5.3 and Qt 6.6.1
// Add it manually for other versions >= 6.5.0
instance->messages.prepend("From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to "
"load the Qt xcb platform plugin.");
#endif
if (QFile::exists("/usr/bin/xmessage"))
QProcess::startDetached("/usr/bin/xmessage", {instance->messages.join("\n")});
} else if (Utils::HostOsInfo::isMacHost()) {
QProcess::startDetached("/usr/bin/osascript",
{"-e",
"display dialog \""
+ instance->messages.join("\n").replace("\"", "\\\"")
+ "\" buttons \"OK\" with title \""
+ Core::Constants::IDE_DISPLAY_NAME
+ " Failed to Start\""});
}
}
instance->oldHandler(type, context, msg);
};
static ShowInGuiHandler *instance;
QStringList messages;
QtMessageHandler oldHandler = nullptr;
};
ShowInGuiHandler *ShowInGuiHandler::instance = nullptr;
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Restarter restarter(argc, argv); Restarter restarter(argc, argv);
@@ -600,9 +647,13 @@ int main(int argc, char **argv)
int numberOfArguments = static_cast<int>(options.appArguments.size()); int numberOfArguments = static_cast<int>(options.appArguments.size());
// create a custom Qt message handler that shows messages in a bare bones UI
// if creation of the QGuiApplication fails.
auto handler = std::make_unique<ShowInGuiHandler>();
std::unique_ptr<SharedTools::QtSingleApplication> std::unique_ptr<SharedTools::QtSingleApplication>
appPtr(SharedTools::createApplication(QLatin1String(Core::Constants::IDE_DISPLAY_NAME), appPtr(SharedTools::createApplication(QLatin1String(Core::Constants::IDE_DISPLAY_NAME),
numberOfArguments, options.appArguments.data())); numberOfArguments, options.appArguments.data()));
handler.reset();
SharedTools::QtSingleApplication &app = *appPtr; SharedTools::QtSingleApplication &app = *appPtr;
QCoreApplication::setApplicationName(Core::Constants::IDE_CASED_ID); QCoreApplication::setApplicationName(Core::Constants::IDE_CASED_ID);
QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG)); QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG));

View File

@@ -1979,6 +1979,8 @@ QAction *BoolAspect::action()
connect(act, &QAction::triggered, this, [this](bool newValue) { connect(act, &QAction::triggered, this, [this](bool newValue) {
setValue(newValue); setValue(newValue);
}); });
connect(this, &BoolAspect::changed, act, [act, this] { act->setChecked(m_internal); });
return act; return act;
} }

View File

@@ -9,6 +9,7 @@
#include "../qdbutils.h" #include "../qdbutils.h"
#include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -85,6 +86,8 @@ void DeviceDetector::handleDeviceEvent(QdbDeviceTracker::DeviceEventType eventTy
device->settings()->displayName.setValue(name); device->settings()->displayName.setValue(name);
device->setType(Qdb::Constants::QdbLinuxOsType); device->setType(Qdb::Constants::QdbLinuxOsType);
device->setMachineType(IDevice::Hardware); device->setMachineType(IDevice::Hardware);
device->setExtraData(ProjectExplorer::Constants::SUPPORTS_RSYNC, true);
device->setExtraData(ProjectExplorer::Constants::SUPPORTS_SFTP, true);
const QString ipAddress = info["ipAddress"]; const QString ipAddress = info["ipAddress"];
device->setupDefaultNetworkSettings(ipAddress); device->setupDefaultNetworkSettings(ipAddress);

View File

@@ -115,7 +115,11 @@ public:
&& prj->hasMakeInstallEquivalent(); && prj->hasMakeInstallEquivalent();
}); });
addInitialStep(Qdb::Constants::QdbStopApplicationStepId); addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
#ifdef Q_OS_WIN
addInitialStep(RemoteLinux::Constants::DirectUploadStepId);
#else
addInitialStep(RemoteLinux::Constants::GenericDeployStepId); addInitialStep(RemoteLinux::Constants::GenericDeployStepId);
#endif
} }
}; };

View File

@@ -1137,14 +1137,15 @@ void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverR
for (const QString &line : lines) { for (const QString &line : lines) {
const QString possibleFilePath = line.simplified(); const QString possibleFilePath = line.simplified();
const auto looksLikeFilePath = [&] { const auto looksLikeFilePath = [&] {
if (possibleFilePath.length() < 3) if (possibleFilePath.length() < 4)
return false; return false;
if (osType() == OsTypeWindows) { if (osType() == OsTypeWindows) {
if (possibleFilePath.startsWith(R"(\\)")) if (possibleFilePath.startsWith(R"(\\\\)"))
return true; return true;
return possibleFilePath.front().isLetter() return possibleFilePath.front().isLetter()
&& possibleFilePath.at(1) == ':' && possibleFilePath.at(1) == ':'
&& possibleFilePath.at(2) == '\\'; && possibleFilePath.at(2) == '\\'
&& possibleFilePath.at(3) == '\\';
} }
return possibleFilePath.front() == '/' return possibleFilePath.front() == '/'
&& possibleFilePath.at(1).isLetterOrNumber(); && possibleFilePath.at(1).isLetterOrNumber();

View File

@@ -460,7 +460,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
// Also get the AST for the base declaration, so we can find out whether it's // Also get the AST for the base declaration, so we can find out whether it's
// pure virtual and mark it accordingly. // pure virtual and mark it accordingly.
// In addition, we need to follow all override links, because for these, clangd // In addition, we need to follow all override links, because for these, clangd
// gives us the declaration instead of the definition. // gives us the declaration instead of the definition (until clangd 16).
for (const Link &link : std::as_const(allLinks)) { for (const Link &link : std::as_const(allLinks)) {
if (!client->documentForFilePath(link.targetFilePath) && addOpenFile(link.targetFilePath)) if (!client->documentForFilePath(link.targetFilePath) && addOpenFile(link.targetFilePath))
client->openExtraFile(link.targetFilePath); client->openExtraFile(link.targetFilePath);
@@ -488,6 +488,9 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
if (link == defLink) if (link == defLink)
continue; continue;
if (client->versionNumber().majorVersion() >= 17)
continue;
const TextDocumentIdentifier doc(client->hostPathToServerUri(link.targetFilePath)); const TextDocumentIdentifier doc(client->hostPathToServerUri(link.targetFilePath));
const TextDocumentPositionParams params(doc, pos); const TextDocumentPositionParams params(doc, pos);
GotoDefinitionRequest defReq(params); GotoDefinitionRequest defReq(params);

View File

@@ -202,22 +202,25 @@ void CMakeParser::flush()
if (m_lastTask.isNull()) if (m_lastTask.isNull())
return; return;
if (m_lastTask.summary.isEmpty() && !m_lastTask.details.isEmpty()) Task t = m_lastTask;
m_lastTask.summary = m_lastTask.details.takeFirst(); m_lastTask.clear();
m_lines += m_lastTask.details.count();
if (m_callStack) { if (t.summary.isEmpty() && !t.details.isEmpty())
m_lastTask.file = m_callStack.value().last().file; t.summary = t.details.takeFirst();
m_lastTask.line = m_callStack.value().last().line; m_lines += t.details.count();
if (m_callStack.has_value() && !m_callStack.value().isEmpty()) {
t.file = m_callStack.value().last().file;
t.line = m_callStack.value().last().line;
LinkSpecs specs; LinkSpecs specs;
m_lastTask.details << QString(); t.details << QString();
m_lastTask.details << Tr::tr("Call stack:"); t.details << Tr::tr("Call stack:");
m_lines += 2; m_lines += 2;
m_callStack->push_front(m_errorOrWarningLine); m_callStack->push_front(m_errorOrWarningLine);
int offset = m_lastTask.details.join('\n').size(); int offset = t.details.join('\n').size();
Utils::reverseForeach(m_callStack.value(), [&](const auto &line) { Utils::reverseForeach(m_callStack.value(), [&](const auto &line) {
const QString fileAndLine = QString("%1:%2").arg(line.file.path()).arg(line.line); const QString fileAndLine = QString("%1:%2").arg(line.file.path()).arg(line.line);
const QString completeLine = QString(" %1%2").arg(fileAndLine).arg(line.function); const QString completeLine = QString(" %1%2").arg(fileAndLine).arg(line.function);
@@ -228,16 +231,14 @@ void CMakeParser::flush()
int(fileAndLine.length()), int(fileAndLine.length()),
createLinkTarget(line.file, line.line, -1)}); createLinkTarget(line.file, line.line, -1)});
m_lastTask.details << completeLine; t.details << completeLine;
offset += completeLine.length() - 2; offset += completeLine.length() - 2;
++m_lines; ++m_lines;
}); });
setDetailsFormat(m_lastTask, specs); setDetailsFormat(t, specs);
} }
Task t = m_lastTask;
m_lastTask.clear();
scheduleTask(t, m_lines, 1); scheduleTask(t, m_lines, 1);
m_lines = 0; m_lines = 0;

View File

@@ -120,6 +120,10 @@ public:
m_tooltip += "<br>" + Tr::tr("Detection source: \"%1\"").arg(m_detectionSource); m_tooltip += "<br>" + Tr::tr("Detection source: \"%1\"").arg(m_detectionSource);
m_versionDisplay = cmake.versionDisplay(); m_versionDisplay = cmake.versionDisplay();
// Make sure to always have the right version in the name for Qt SDK CMake installations
if (m_name.startsWith("CMake") && m_name.endsWith("(Qt)"))
m_name = QString("CMake %1 (Qt)").arg(m_versionDisplay);
} }
CMakeToolTreeItem() = default; CMakeToolTreeItem() = default;

View File

@@ -10,13 +10,9 @@ QFuture<CompileResult> compile(const Config &config, const CompileParameters &pa
{ {
const QUrl url = config.url({"api/compiler", parameters.compilerId, "compile"}); const QUrl url = config.url({"api/compiler", parameters.compilerId, "compile"});
QNetworkRequest req(url);
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
req.setRawHeader("Accept", "application/json");
return jsonRequest<CompileResult>( return jsonRequest<CompileResult>(
config.networkManager, config.networkManager,
req, url,
[](const QJsonDocument &response) { [](const QJsonDocument &response) {
CompileResult result; CompileResult result;

View File

@@ -32,9 +32,6 @@ QFuture<Compilers> compilers(const Config &config,
if (!fieldParam.isEmpty()) if (!fieldParam.isEmpty())
url.setQuery(QUrlQuery{{"fields", fieldParam}}); url.setQuery(QUrlQuery{{"fields", fieldParam}});
QNetworkRequest req(url);
req.setRawHeader("Accept", "application/json");
auto fromJson = [extraFields](const QJsonDocument &doc) { auto fromJson = [extraFields](const QJsonDocument &doc) {
QJsonArray compilers = doc.array(); QJsonArray compilers = doc.array();
Compilers result; Compilers result;
@@ -59,7 +56,7 @@ QFuture<Compilers> compilers(const Config &config,
return result; return result;
}; };
return jsonRequest<Compilers>(config.networkManager, req, fromJson); return jsonRequest<Compilers>(config.networkManager, url, fromJson);
} }
} // namespace CompilerExplorer::Api } // namespace CompilerExplorer::Api

View File

@@ -13,10 +13,8 @@ QFuture<Languages> languages(const Config &config)
{ {
QUrl url = config.url({"api/languages"}); QUrl url = config.url({"api/languages"});
url.setQuery(QUrlQuery{{"fields", "id,name,extensions,logoUrl"}}); url.setQuery(QUrlQuery{{"fields", "id,name,extensions,logoUrl"}});
QNetworkRequest req(url);
req.setRawHeader("Accept", "application/json");
return jsonRequest<Languages>(config.networkManager, req, [](const QJsonDocument &doc) { return jsonRequest<Languages>(config.networkManager, url, [](const QJsonDocument &doc) {
QJsonArray languages = doc.array(); QJsonArray languages = doc.array();
Languages result; Languages result;
for (const auto &language : languages) { for (const auto &language : languages) {

View File

@@ -17,10 +17,7 @@ QFuture<Libraries> libraries(const Config &config, const QString &languageId)
const QUrl url = config.url({"api/libraries", languageId}); const QUrl url = config.url({"api/libraries", languageId});
QNetworkRequest req(url); return jsonRequest<Libraries>(config.networkManager, url, [](const QJsonDocument &doc) {
req.setRawHeader("Accept", "application/json");
return jsonRequest<Libraries>(config.networkManager, req, [](const QJsonDocument &doc) {
QJsonArray libraries = doc.array(); QJsonArray libraries = doc.array();
Libraries result; Libraries result;

View File

@@ -14,6 +14,8 @@
#include <QPromise> #include <QPromise>
#include <QString> #include <QString>
#include <utils/appinfo.h>
static Q_LOGGING_CATEGORY(apiLog, "qtc.compilerexplorer.api", QtWarningMsg); static Q_LOGGING_CATEGORY(apiLog, "qtc.compilerexplorer.api", QtWarningMsg);
namespace CompilerExplorer::Api { namespace CompilerExplorer::Api {
@@ -45,11 +47,18 @@ static int debugRequestId = 0;
template<typename Result> template<typename Result>
QFuture<Result> request( QFuture<Result> request(
QNetworkAccessManager *networkManager, QNetworkAccessManager *networkManager,
const QNetworkRequest &req, QNetworkRequest &req,
std::function<void(const QByteArray &, QSharedPointer<QPromise<Result>>)> callback, std::function<void(const QByteArray &, QSharedPointer<QPromise<Result>>)> callback,
QNetworkAccessManager::Operation op = QNetworkAccessManager::GetOperation, QNetworkAccessManager::Operation op = QNetworkAccessManager::GetOperation,
const QByteArray &outData = {}) const QByteArray &payload = {})
{ {
static const QByteArray userAgent = QString("%1/%2 (%3)")
.arg(QCoreApplication::applicationName())
.arg(QCoreApplication::applicationVersion())
.arg(Utils::appInfo().author)
.toUtf8();
req.setRawHeader("User-Agent", userAgent);
QSharedPointer<QPromise<Result>> p(new QPromise<Result>); QSharedPointer<QPromise<Result>> p(new QPromise<Result>);
p->start(); p->start();
@@ -58,12 +67,12 @@ QFuture<Result> request(
const auto reqId = [r = debugRequestId] { return QString("[%1]").arg(r); }; const auto reqId = [r = debugRequestId] { return QString("[%1]").arg(r); };
if (outData.isEmpty()) if (payload.isEmpty())
qCDebug(apiLog).noquote() << reqId() << "Requesting" << toString(op) qCDebug(apiLog).noquote() << reqId() << "Requesting" << toString(op)
<< req.url().toString(); << req.url().toString();
else else
qCDebug(apiLog).noquote() << reqId() << "Requesting" << toString(op) << req.url().toString() qCDebug(apiLog).noquote() << reqId() << "Requesting" << toString(op) << req.url().toString()
<< "with payload:" << QString::fromUtf8(outData); << "with payload:" << QString::fromUtf8(payload);
QNetworkReply *reply = nullptr; QNetworkReply *reply = nullptr;
@@ -72,10 +81,10 @@ QFuture<Result> request(
reply = networkManager->get(req); reply = networkManager->get(req);
break; break;
case QNetworkAccessManager::PostOperation: case QNetworkAccessManager::PostOperation:
reply = networkManager->post(req, outData); reply = networkManager->post(req, payload);
break; break;
case QNetworkAccessManager::PutOperation: case QNetworkAccessManager::PutOperation:
reply = networkManager->put(req, outData); reply = networkManager->put(req, payload);
break; break;
case QNetworkAccessManager::DeleteOperation: case QNetworkAccessManager::DeleteOperation:
reply = networkManager->deleteResource(req); reply = networkManager->deleteResource(req);
@@ -115,12 +124,16 @@ QFuture<Result> request(
template<typename Result> template<typename Result>
QFuture<Result> jsonRequest(QNetworkAccessManager *networkManager, QFuture<Result> jsonRequest(QNetworkAccessManager *networkManager,
const QNetworkRequest &req, const QUrl &url,
std::function<Result(QJsonDocument)> callback, std::function<Result(QJsonDocument)> callback,
QNetworkAccessManager::Operation op QNetworkAccessManager::Operation op
= QNetworkAccessManager::GetOperation, = QNetworkAccessManager::GetOperation,
const QByteArray &outData = {}) const QByteArray &payload = {})
{ {
QNetworkRequest req(url);
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
req.setRawHeader("Accept", "application/json");
return request<Result>( return request<Result>(
networkManager, networkManager,
req, req,
@@ -135,7 +148,7 @@ QFuture<Result> jsonRequest(QNetworkAccessManager *networkManager,
promise->addResult(callback(doc)); promise->addResult(callback(doc));
}, },
op, op,
outData); payload);
} }
} // namespace CompilerExplorer::Api } // namespace CompilerExplorer::Api

View File

@@ -52,6 +52,7 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/appinfo.h> #include <utils/appinfo.h>
#include <utils/checkablemessagebox.h> #include <utils/checkablemessagebox.h>
#include <utils/dropsupport.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/fsengine/fileiconprovider.h> #include <utils/fsengine/fileiconprovider.h>
@@ -1318,12 +1319,11 @@ void ICorePrivate::init()
m_modeStack->statusBar()->setProperty("p_styled", true); m_modeStack->statusBar()->setProperty("p_styled", true);
/*auto dropSupport = new DropSupport(this, [](QDropEvent *event, DropSupport *) { auto dropSupport = new DropSupport(m_mainwindow, [](QDropEvent *event, DropSupport *) {
return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager) return event->source() == nullptr; // only accept drops from the "outside" (e.g. file manager)
}); });
connect(dropSupport, &DropSupport::filesDropped, connect(dropSupport, &DropSupport::filesDropped, this, &ICorePrivate::openDroppedFiles);
this, &MainWindow::openDroppedFiles);
*/
if (HostOsInfo::isLinuxHost()) { if (HostOsInfo::isLinuxHost()) {
m_trimTimer.setSingleShot(true); m_trimTimer.setSingleShot(true);
m_trimTimer.setInterval(60000); m_trimTimer.setInterval(60000);

View File

@@ -1134,6 +1134,19 @@ QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const
case CppUseSelectionsUpdater::RunnerInfo::Invalid: case CppUseSelectionsUpdater::RunnerInfo::Invalid:
QTC_CHECK(false && "Unexpected CppUseSelectionsUpdater runner result"); QTC_CHECK(false && "Unexpected CppUseSelectionsUpdater runner result");
} }
QMetaObject::invokeMethod(menu, [menu](){
if (auto mainWin = ICore::mainWindow()) {
menu->adjustSize();
if (QTC_GUARD(menu->parentWidget())) {
QPoint p = menu->pos();
const int w = menu->width();
if (p.x() + w > mainWin->screen()->geometry().width()) {
p.setX(menu->parentWidget()->x() - w);
menu->move(p);
}
}
}
}, Qt::QueuedConnection);
}); });
return menu; return menu;

View File

@@ -536,8 +536,6 @@ void DebuggerRunTool::start()
if (!interpreter.isEmpty() && mainScript.endsWith(".py")) { if (!interpreter.isEmpty() && mainScript.endsWith(".py")) {
m_runParameters.mainScript = mainScript; m_runParameters.mainScript = mainScript;
m_runParameters.interpreter = interpreter; m_runParameters.interpreter = interpreter;
if (auto args = runControl()->aspect<ArgumentsAspect>())
m_runParameters.inferior.command.addArgs(args->arguments, CommandLine::Raw);
} }
} }
} }

View File

@@ -114,6 +114,13 @@ void PdbEngine::setupEngine()
CommandLine cmd{m_interpreter, {bridge, scriptFile.path()}}; CommandLine cmd{m_interpreter, {bridge, scriptFile.path()}};
cmd.addArg(runParameters().inferior.workingDirectory.path()); cmd.addArg(runParameters().inferior.workingDirectory.path());
cmd.addArg("--");
QStringList arguments = runParameters().inferior.command.splitArguments();
if (!arguments.isEmpty() && arguments.constFirst() == "-u")
arguments.removeFirst(); // unbuffered added by run config
if (!arguments.isEmpty())
arguments.removeFirst(); // file added by run config
cmd.addArgs(arguments);
showMessage("STARTING " + cmd.toUserOutput()); showMessage("STARTING " + cmd.toUserOutput());
m_proc.setEnvironment(runParameters().debugger.environment); m_proc.setEnvironment(runParameters().debugger.environment);
m_proc.setCommand(cmd); m_proc.setCommand(cmd);

View File

@@ -1592,10 +1592,14 @@ void GitPluginPrivate::instantBlame()
const auto commandHandler = [this, filePath, line](const CommandResult &result) { const auto commandHandler = [this, filePath, line](const CommandResult &result) {
if (result.result() == ProcessResult::FinishedWithError && if (result.result() == ProcessResult::FinishedWithError &&
result.cleanedStdErr().contains("no such path")) { result.cleanedStdErr().contains("no such path")) {
disconnect(m_blameCursorPosConn); stopInstantBlame();
return; return;
} }
const QString output = result.cleanedStdOut(); const QString output = result.cleanedStdOut();
if (output.isEmpty()) {
stopInstantBlame();
return;
}
const CommitInfo info = parseBlameOutput(output.split('\n'), filePath, m_author); const CommitInfo info = parseBlameOutput(output.split('\n'), filePath, m_author);
m_blameMark.reset(new BlameMark(filePath, line, info)); m_blameMark.reset(new BlameMark(filePath, line, info));
}; };

View File

@@ -30,7 +30,6 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <QCoreApplication>
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QRegularExpression> #include <QRegularExpression>
@@ -433,7 +432,7 @@ QList<Kit *> existingKits(const McuTarget *mcuTarget)
using namespace Constants; using namespace Constants;
// some models have compatible name changes that refere to the same supported board across versions. // some models have compatible name changes that refere to the same supported board across versions.
// name changes are tracked here to recognize the corresponding kits as upgradable. // name changes are tracked here to recognize the corresponding kits as upgradable.
static QMap<QString, QStringList> upgradable_to = { static const QMap<QString, QStringList> upgradable_to = {
{"MIMXRT1170-EVK-FREERTOS", {"MIMXRT1170-EVKB-FREERTOS"}}}; {"MIMXRT1170-EVK-FREERTOS", {"MIMXRT1170-EVKB-FREERTOS"}}};
return Utils::filtered(KitManager::kits(), [mcuTarget](Kit *kit) { return Utils::filtered(KitManager::kits(), [mcuTarget](Kit *kit) {
return kit->value(KIT_MCUTARGET_KITVERSION_KEY) == KIT_VERSION return kit->value(KIT_MCUTARGET_KITVERSION_KEY) == KIT_VERSION

View File

@@ -7,6 +7,7 @@
#include "mcusupport_global.h" #include "mcusupport_global.h"
#include "mcusupportplugin.h" #include "mcusupportplugin.h"
#include "mcusupporttr.h" #include "mcusupporttr.h"
#include "mcusupportconstants.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
@@ -115,12 +116,13 @@ void McuTarget::handlePackageProblems(MessagesList &messages) const
void McuTarget::resetInvalidPathsToDefault() void McuTarget::resetInvalidPathsToDefault()
{ {
for (McuPackagePtr package : std::as_const(m_packages)) { for (McuPackagePtr package : std::as_const(m_packages)) {
if (!package) if (!package)
continue; continue;
if (package->isValidStatus()) if (package->isValidStatus())
continue; continue;
if (package->settingsKey() == Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK)
continue;
package->setPath(package->defaultPath()); package->setPath(package->defaultPath());
package->writeToSettings(); package->writeToSettings();
} }

View File

@@ -152,8 +152,10 @@ Kit::Kit(const Store &data)
Store extra = storeFromVariant(data.value(DATA_KEY)); Store extra = storeFromVariant(data.value(DATA_KEY));
d->m_data.clear(); // remove default values d->m_data.clear(); // remove default values
const Store::ConstIterator cend = extra.constEnd(); const Store::ConstIterator cend = extra.constEnd();
for (Store::ConstIterator it = extra.constBegin(); it != cend; ++it) for (Store::ConstIterator it = extra.constBegin(); it != cend; ++it) {
d->m_data.insert(Id::fromString(stringFromKey(it.key())), it.value()); d->m_data.insert(Id::fromString(stringFromKey(it.key())),
mapEntryFromStoreEntry(it.value()));
}
const QStringList mutableInfoList = data.value(MUTABLE_INFO_KEY).toStringList(); const QStringList mutableInfoList = data.value(MUTABLE_INFO_KEY).toStringList();
for (const QString &mutableInfo : mutableInfoList) for (const QString &mutableInfo : mutableInfoList)

View File

@@ -564,6 +564,9 @@ public:
: QWidget(parent) : QWidget(parent)
{ {
connect(KitManager::instance(), &KitManager::kitUpdated, this, &KitAreaWidget::updateKit); connect(KitManager::instance(), &KitManager::kitUpdated, this, &KitAreaWidget::updateKit);
auto layout = new QVBoxLayout;
layout->setContentsMargins({});
setLayout(layout);
} }
~KitAreaWidget() override { setKit(nullptr); } ~KitAreaWidget() override { setKit(nullptr); }
@@ -572,24 +575,23 @@ public:
{ {
qDeleteAll(m_kitAspects); qDeleteAll(m_kitAspects);
m_kitAspects.clear(); m_kitAspects.clear();
delete m_gridWidget;
m_gridWidget = nullptr;
if (!k) if (!k)
return; return;
delete layout();
Layouting::Grid grid; Layouting::Grid grid;
for (KitAspectFactory *factory : KitManager::kitAspectFactories()) { for (KitAspectFactory *factory : KitManager::kitAspectFactories()) {
if (k && k->isMutable(factory->id())) { if (k && k->isMutable(factory->id())) {
KitAspect *aspect = factory->createKitAspect(k); KitAspect *aspect = factory->createKitAspect(k);
m_kitAspects << aspect; m_kitAspects << aspect;
auto label = new QLabel(aspect->displayName()); grid.addItems({aspect, Layouting::br});
grid.addItems({label, aspect, Layouting::br});
} }
} }
grid.attachTo(this); m_gridWidget = grid.emerge();
layout()->setContentsMargins(3, 3, 3, 3); m_gridWidget->layout()->setContentsMargins(3, 3, 3, 3);
layout()->addWidget(m_gridWidget);
m_kit = k; m_kit = k;
setHidden(m_kitAspects.isEmpty()); setHidden(m_kitAspects.isEmpty());
@@ -625,6 +627,7 @@ private:
} }
Kit *m_kit = nullptr; Kit *m_kit = nullptr;
QWidget *m_gridWidget = nullptr;
QList<KitAspect *> m_kitAspects; QList<KitAspect *> m_kitAspects;
}; };

View File

@@ -690,7 +690,7 @@ bool FixedRunConfigurationFactory::supportsBuildKey(Target *target, const QStrin
{ {
Q_UNUSED(target) Q_UNUSED(target)
Q_UNUSED(key) Q_UNUSED(key)
return false; return true;
} }
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -45,6 +45,7 @@ public:
ignoreMissingFiles.setLabelText(Tr::tr("Ignore missing files:")); ignoreMissingFiles.setLabelText(Tr::tr("Ignore missing files:"));
ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel); ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::InExtraLabel);
method.setSettingsKey("RemoteLinux.RsyncDeployStep.TransferMethod");
method.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); method.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
method.setDisplayName(Tr::tr("Transfer method:")); method.setDisplayName(Tr::tr("Transfer method:"));
method.addOption(Tr::tr("Use rsync if available. Otherwise use default transfer.")); method.addOption(Tr::tr("Use rsync if available. Otherwise use default transfer."));

View File

@@ -87,6 +87,9 @@ void ValgrindToolRunner::stop()
{ {
m_isStopping = true; m_isStopping = true;
m_runner.stop(); m_runner.stop();
appendMessage(Tr::tr("Process terminated."), ErrorMessageFormat);
m_progress.reportFinished();
reportStopped();
} }
QStringList ValgrindToolRunner::genericToolArguments() const QStringList ValgrindToolRunner::genericToolArguments() const

View File

@@ -171,11 +171,13 @@ def invokeMenuItem(menu, item, *subItems):
numberedPrefix = "%d | " numberedPrefix = "%d | "
for subItem in subItems: for subItem in subItems:
# we might have numbered sub items (e.g. "Recent Files") - these have this special prefix # we might have numbered sub items (e.g. "Recent Files") - these have this special prefix
# but on macOS we don't add these prefixes hasNumPrefix = subItem.startswith(numberedPrefix)
if platform.system() == 'Darwin' and subItem.startswith(numberedPrefix): if hasNumPrefix and platform.system() == 'Darwin':
subItem = subItem[5:] # on macOS we don't add these prefixes
subItem = subItem[len(numberedPrefix):]
hasNumPrefix = False
if subItem.startswith(numberedPrefix): if hasNumPrefix:
triggered = False triggered = False
for i in range(1, 10): for i in range(1, 10):
try: try:

View File

@@ -99,8 +99,7 @@ class JIRA:
test.fatal("No resolution info for %s" % bug) test.fatal("No resolution info for %s" % bug)
self._resolution = 'Done' self._resolution = 'Done'
else: else:
if isinstance(data, (bytes)): data = stringify(data)
data = str(data)
data = data.replace("\r", "").replace("\n", "") data = data.replace("\r", "").replace("\n", "")
resPattern = re.compile('<span\s+id="resolution-val".*?>(?P<resolution>.*?)</span>') resPattern = re.compile('<span\s+id="resolution-val".*?>(?P<resolution>.*?)</span>')
resolution = resPattern.search(data) resolution = resPattern.search(data)

View File

@@ -1,7 +1,8 @@
"text" "nestinglevel" "text" "nestinglevel"
"CMakeLists.txt" "0" "CMakeLists.txt" "0"
"Header Files" "1" "Header Files" "1"
"genericdock.h" "2" "gui" "2"
"genericdock.h" "3"
"Source Files" "1" "Source Files" "1"
"core" "2" "core" "2"
"book.cpp" "3" "book.cpp" "3"
@@ -58,55 +59,57 @@
"rational.cpp" "3" "rational.cpp" "3"
"units.cpp" "3" "units.cpp" "3"
"main.cpp" "2" "main.cpp" "2"
"/" "2" "resources" "1"
"color-schemes" "3" "speedcrunch.qrc" "2"
"Solarized Dark.json" "4" "/" "3"
"Solarized Light.json" "4" "color-schemes" "4"
"Standard.json" "4" "Solarized Dark.json" "5"
"Sublime.json" "4" "Solarized Light.json" "5"
"Terminal.json" "4" "Standard.json" "5"
"Tomorrow Night Blue.json" "4" "Sublime.json" "5"
"Tomorrow Night Bright.json" "4" "Terminal.json" "5"
"Tomorrow Night Eighties.json" "4" "Tomorrow Night Blue.json" "5"
"Tomorrow Night.json" "4" "Tomorrow Night Bright.json" "5"
"Tomorrow.json" "4" "Tomorrow Night Eighties.json" "5"
"locale" "3" "Tomorrow Night.json" "5"
"ar.qm" "4" "Tomorrow.json" "5"
"ca_ES.qm" "4" "locale" "4"
"cs_CZ.qm" "4" "ar.qm" "5"
"da.qm" "4" "ca_ES.qm" "5"
"de_DE.qm" "4" "cs_CZ.qm" "5"
"el.qm" "4" "da.qm" "5"
"en_GB.qm" "4" "de_DE.qm" "5"
"en_US.qm" "4" "el.qm" "5"
"es_AR.qm" "4" "en_GB.qm" "5"
"es_ES.qm" "4" "en_US.qm" "5"
"et_EE.qm" "4" "es_AR.qm" "5"
"eu_ES.qm" "4" "es_ES.qm" "5"
"fi_FI.qm" "4" "et_EE.qm" "5"
"fr_FR.qm" "4" "eu_ES.qm" "5"
"he_IL.qm" "4" "fi_FI.qm" "5"
"hu_HU.qm" "4" "fr_FR.qm" "5"
"id_ID.qm" "4" "he_IL.qm" "5"
"it_IT.qm" "4" "hu_HU.qm" "5"
"ja_JP.qm" "4" "id_ID.qm" "5"
"ko_KR.qm" "4" "it_IT.qm" "5"
"lt.qm" "4" "ja_JP.qm" "5"
"lv_LV.qm" "4" "ko_KR.qm" "5"
"nb_NO.qm" "4" "lt.qm" "5"
"nl_NL.qm" "4" "lv_LV.qm" "5"
"pl_PL.qm" "4" "nb_NO.qm" "5"
"pt_BR.qm" "4" "nl_NL.qm" "5"
"pt_PT.qm" "4" "pl_PL.qm" "5"
"ro_RO.qm" "4" "pt_BR.qm" "5"
"ru_RU.qm" "4" "pt_PT.qm" "5"
"sk.qm" "4" "ro_RO.qm" "5"
"sv_SE.qm" "4" "ru_RU.qm" "5"
"tr_TR.qm" "4" "sk.qm" "5"
"uz_Latn_UZ.qm" "4" "sv_SE.qm" "5"
"vi.qm" "4" "tr_TR.qm" "5"
"zh_CN.qm" "4" "uz_Latn_UZ.qm" "5"
"speedcrunch.png" "3" "vi.qm" "5"
"zh_CN.qm" "5"
"speedcrunch.png" "4"
"<Other Locations>" "1" "<Other Locations>" "1"
"manual.qrc" "3" "manual.qrc" "3"
"/manual" "4" "/manual" "4"
1 text nestinglevel
2 CMakeLists.txt 0
3 Header Files 1
4 genericdock.h gui 2
5 genericdock.h 3
6 Source Files 1
7 core 2
8 book.cpp 3
59 rational.cpp 3
60 units.cpp 3
61 main.cpp 2
62 / resources 2 1
63 color-schemes speedcrunch.qrc 3 2
64 Solarized Dark.json / 4 3
65 Solarized Light.json color-schemes 4
66 Standard.json Solarized Dark.json 4 5
67 Sublime.json Solarized Light.json 4 5
68 Terminal.json Standard.json 4 5
69 Tomorrow Night Blue.json Sublime.json 4 5
70 Tomorrow Night Bright.json Terminal.json 4 5
71 Tomorrow Night Eighties.json Tomorrow Night Blue.json 4 5
72 Tomorrow Night.json Tomorrow Night Bright.json 4 5
73 Tomorrow.json Tomorrow Night Eighties.json 4 5
74 locale Tomorrow Night.json 3 5
75 ar.qm Tomorrow.json 4 5
76 ca_ES.qm locale 4
77 cs_CZ.qm ar.qm 4 5
78 da.qm ca_ES.qm 4 5
79 de_DE.qm cs_CZ.qm 4 5
80 el.qm da.qm 4 5
81 en_GB.qm de_DE.qm 4 5
82 en_US.qm el.qm 4 5
83 es_AR.qm en_GB.qm 4 5
84 es_ES.qm en_US.qm 4 5
85 et_EE.qm es_AR.qm 4 5
86 eu_ES.qm es_ES.qm 4 5
87 fi_FI.qm et_EE.qm 4 5
88 fr_FR.qm eu_ES.qm 4 5
89 he_IL.qm fi_FI.qm 4 5
90 hu_HU.qm fr_FR.qm 4 5
91 id_ID.qm he_IL.qm 4 5
92 it_IT.qm hu_HU.qm 4 5
93 ja_JP.qm id_ID.qm 4 5
94 ko_KR.qm it_IT.qm 4 5
95 lt.qm ja_JP.qm 4 5
96 lv_LV.qm ko_KR.qm 4 5
97 nb_NO.qm lt.qm 4 5
98 nl_NL.qm lv_LV.qm 4 5
99 pl_PL.qm nb_NO.qm 4 5
100 pt_BR.qm nl_NL.qm 4 5
101 pt_PT.qm pl_PL.qm 4 5
102 ro_RO.qm pt_BR.qm 4 5
103 ru_RU.qm pt_PT.qm 4 5
104 sk.qm ro_RO.qm 4 5
105 sv_SE.qm ru_RU.qm 4 5
106 tr_TR.qm sk.qm 4 5
107 uz_Latn_UZ.qm sv_SE.qm 4 5
108 vi.qm tr_TR.qm 4 5
109 zh_CN.qm uz_Latn_UZ.qm 4 5
110 speedcrunch.png vi.qm 3 5
111 zh_CN.qm 5
112 speedcrunch.png 4
113 <Other Locations> 1
114 manual.qrc 3
115 /manual 4