Merge remote-tracking branch 'origin/12.0'

Change-Id: I17c37a6fd474c3441343e91a67817c8179d0c7cc
This commit is contained in:
Eike Ziller
2023-10-30 13:20:46 +01:00
20 changed files with 185 additions and 62 deletions

View File

@@ -71,7 +71,15 @@ General
without a unified menu bar without a unified menu bar
([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498)) ([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498))
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-show-and-hide-main-menu.html)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-show-and-hide-main-menu.html))
* Changed the `Enable high DPI scaling` setting to a `DPI rounding policy`
setting, which fits Qt's settings better
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-set-high-dpi-scaling.html))
* Fixed an issue with growing session files * Fixed an issue with growing session files
* Fixed that the shortcuts for the navigation views could be stuck to opening a
view in the right side bar
([QTCREATORBUG-29770](https://bugreports.qt.io/browse/QTCREATORBUG-29770))
* Fixed that the shortcut for Locator switched to the main window
([QTCREATORBUG-29741](https://bugreports.qt.io/browse/QTCREATORBUG-29741))
Help Help
---- ----
@@ -90,6 +98,7 @@ Editing
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-coding-navigating.html#navigating-between-open-files-and-symbols)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-coding-navigating.html#navigating-between-open-files-and-symbols))
* Added an indenter, auto-brace and auto-quote for JSON * Added an indenter, auto-brace and auto-quote for JSON
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-enclose-code-in-characters.html)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-enclose-code-in-characters.html))
* Improved the performance of searching in big documents
* Fixed that the historical order of open documents was not restored * Fixed that the historical order of open documents was not restored
* Fixed that suggestions were rendered with the wrong tab size * Fixed that suggestions were rendered with the wrong tab size
([QTCREATORBUG-29483](https://bugreports.qt.io/browse/QTCREATORBUG-29483)) ([QTCREATORBUG-29483](https://bugreports.qt.io/browse/QTCREATORBUG-29483))
@@ -119,8 +128,17 @@ Editing
* Fixed that automatically created functions could be added between another * Fixed that automatically created functions could be added between another
function and its documentation function and its documentation
([QTCREATORBUG-6934](https://bugreports.qt.io/browse/QTCREATORBUG-6934)) ([QTCREATORBUG-6934](https://bugreports.qt.io/browse/QTCREATORBUG-6934))
* Fixed that scope names were considered when searching for `C++ Symbols` with
advanced find
([QTCREATORBUG-29133](https://bugreports.qt.io/browse/QTCREATORBUG-29133))
* Clangd
* Added the `Completion ranking model` option for choosing the order of
completion results
([QTCREATORBUG-29013](https://bugreports.qt.io/browse/QTCREATORBUG-29013))
* Fixed that the refactoring actions from Clangd were not available in the * Fixed that the refactoring actions from Clangd were not available in the
context menu context menu
* Fixed that renaming symbols could rename them in generated files
([QTCREATORBUG-29778](https://bugreports.qt.io/browse/QTCREATORBUG-29778))
* Clang Format * Clang Format
* Fixed the style settings for Clang Format 16 and later * Fixed the style settings for Clang Format 16 and later
([QTCREATORBUG-29434](https://bugreports.qt.io/browse/QTCREATORBUG-29434)) ([QTCREATORBUG-29434](https://bugreports.qt.io/browse/QTCREATORBUG-29434))
@@ -144,11 +162,18 @@ Editing
of files of files
([QTCREATORBUG-29542](https://bugreports.qt.io/browse/QTCREATORBUG-29542)) ([QTCREATORBUG-29542](https://bugreports.qt.io/browse/QTCREATORBUG-29542))
### Widget Designer
* Fixed that renaming layouts in the property editor switched to edit mode
([QTCREATORBUG-29644](https://bugreports.qt.io/browse/QTCREATORBUG-29644))
### Copilot ### Copilot
* Added support for proxies * Added support for proxies
([QTCREATORBUG-29485](https://bugreports.qt.io/browse/QTCREATORBUG-29485)) ([QTCREATORBUG-29485](https://bugreports.qt.io/browse/QTCREATORBUG-29485))
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-copilot.html)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-copilot.html))
* Fixed the auto-detection of `agent.js`
([QTCREATORBUG-29750](https://bugreports.qt.io/browse/QTCREATORBUG-29750))
### TODO ### TODO
@@ -207,6 +232,15 @@ Projects
* Added help tooltips * Added help tooltips
([QTCREATORBUG-25780](https://bugreports.qt.io/browse/QTCREATORBUG-25780)) ([QTCREATORBUG-25780](https://bugreports.qt.io/browse/QTCREATORBUG-25780))
* Extended context help for variables, properties and modules * Extended context help for variables, properties and modules
* Improved performance when switching sessions
([QTCREATORBUG-27729](https://bugreports.qt.io/browse/QTCREATORBUG-27729))
* Fixed issues with the subdirectory structure of the project tree
([QTCREATORBUG-23942](https://bugreports.qt.io/browse/QTCREATORBUG-23942),
[QTCREATORBUG-29105](https://bugreports.qt.io/browse/QTCREATORBUG-29105))
* Presets
* Fixed that variables were not expanded for `cmakeExecutable`
([QTCREATORBUG-29643](https://bugreports.qt.io/browse/QTCREATORBUG-29643))
* Fixed unnecessary restrictions on the preset name
### Python ### Python
@@ -217,6 +251,11 @@ Projects
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-run-settings.html#specifying-run-settings-for-linux-based-devices)) ([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-run-settings.html#specifying-run-settings-for-linux-based-devices))
* Fixed PySide wheels installation on macOS * Fixed PySide wheels installation on macOS
### qmake
* Fixed the project tree structure in case of some subfolder structures
([QTCREATORBUG-29733](https://bugreports.qt.io/browse/QTCREATORBUG-29733))
### vcpkg ### vcpkg
* Added the generation of code for `CMakeLists.txt` * Added the generation of code for `CMakeLists.txt`
@@ -244,6 +283,8 @@ Analyzer
* Fixed that error messages were not shown * Fixed that error messages were not shown
([QTCREATORBUG-29298](https://bugreports.qt.io/browse/QTCREATORBUG-29298)) ([QTCREATORBUG-29298](https://bugreports.qt.io/browse/QTCREATORBUG-29298))
* Fixed that `-mno-direct-extern-access` could be passed to `clang-tidy` which
does not support it
### CTF Visualizer ### CTF Visualizer
@@ -263,8 +304,10 @@ Version Control Systems
### Git ### Git
* Added option for ignoring whitespace changes and line moves in `Instant Blame` * Added the `Ignore whitespace changes` and `Ignore line moves` options to
`Preferences > Version Control > Git > Instant Blame`
([QTCREATORBUG-29378](https://bugreports.qt.io/browse/QTCREATORBUG-29378)) ([QTCREATORBUG-29378](https://bugreports.qt.io/browse/QTCREATORBUG-29378))
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-vcs-git.html))
### CVS ### CVS
@@ -275,6 +318,23 @@ Test Integration
* Added an option for the number of threads used for scanning * Added an option for the number of threads used for scanning
([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301)) ([QTCREATORBUG-29301](https://bugreports.qt.io/browse/QTCREATORBUG-29301))
* Improved the wizards for `GTest` and `Catch2`
Platforms
---------
### Android
* Fixed issues when `LIBRARY_OUTPUT_DIRECTORY` is set in the CMake build files
([QTCREATORBUG-26479](https://bugreports.qt.io/browse/QTCREATORBUG-26479))
### iOS
* Known Issue: iOS 17 devices are not supported
### Docker
* Fixed the check for commands that are built-ins of the shell
Credits for these changes go to: Credits for these changes go to:
-------------------------------- --------------------------------
@@ -304,6 +364,7 @@ Jonas Karlsson
Jussi Witick Jussi Witick
Knud Dollereder Knud Dollereder
Leena Miettinen Leena Miettinen
Ludovic Le Brun
Mahmoud Badri Mahmoud Badri
Marco Bubke Marco Bubke
Marcus Tillmanns Marcus Tillmanns
@@ -317,6 +378,7 @@ Pranta Dastider
Robert Löhning Robert Löhning
Sami Shalayel Sami Shalayel
Samuel Ghinet Samuel Ghinet
Samuli Piippo
Semih Yavuz Semih Yavuz
Tasuku Suzuki Tasuku Suzuki
Thiago Macieira Thiago Macieira

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -406,6 +406,10 @@
\uicontrol {Active Test Frameworks} list. \uicontrol {Active Test Frameworks} list.
By default, \QC groups tests that are in the same directory. By default, \QC groups tests that are in the same directory.
By default, \QC uses a quarter of the available logical CPUs when
scanning for tests. You can set the amount of worker threads used
in \uicontrol {Scan threads}.
\QC omits internal messages and run configuration warnings for \QC omits internal messages and run configuration warnings for
deduced configurations by default. To view them, deselect the deduced configurations by default. To view them, deselect the
\uicontrol {Omit internal messages} and \uicontrol {Omit internal messages} and

View File

@@ -144,9 +144,13 @@
By default, each line is annotated in the editor when you scroll through By default, each line is annotated in the editor when you scroll through
the file. To disable this feature, select \preferences > the file. To disable this feature, select \preferences >
\uicontrol {Version Control} > \uicontrol Git, and \uicontrol {Version Control} > \uicontrol Git, and
deselect \uicontrol {Add instant blame annotations to editor}. To view deselect \uicontrol {Instant Blame}. To find the commit that introduced
annotations for the current line, select \uicontrol Tools > \uicontrol Git > the last real code change, select \uicontrol {Ignore whitespace changes}.
\uicontrol {Current File} > \uicontrol {Instant Blame}. To find the commit that introduced a line before it was moved, select
\uicontrol {Ignore line moves}.
To view annotations for the current line, select \uicontrol Tools >
\uicontrol Git > \uicontrol {Current File} > \uicontrol {Instant Blame}.
Click the commit identifier to show a detailed description of the change. Click the commit identifier to show a detailed description of the change.

View File

@@ -328,10 +328,16 @@ def qdump__QDateTime(d, value):
isValid = status & 0x08 isValid = status & 0x08
else: else:
dptr = d.extractPointer(value) dptr = d.extractPointer(value)
(msecs, status, offsetFromUtc, ref, timeZone) = d.split('qIIIp', dptr) (_, status, msecs, offsetFromUtc, _, timeZone) = d.split('iIqII{QTimeZone}', dptr)
spec = (status & 0x30) >> 4 spec = (status & 0x30) >> 4
isValid = True isValid = True
tzD = d.extractPointer(timeZone)
if tzD == 0:
timeZone = 'UTC'
else:
idAddr = tzD + 2 * d.ptrSize()
tzBa = d.encodeByteArray(idAddr, limit=100)
timeZone = tzBa
d.putValue( d.putValue(
'%s/%s/%s/%s/%s/%s' % '%s/%s/%s/%s/%s/%s' %
(msecs, (msecs,
@@ -365,7 +371,7 @@ def qdump__QDateTime(d, value):
tz = '' tz = ''
else: else:
idBase = tzp + 2 * d.ptrSize() # [QSharedData] + [vptr] idBase = tzp + 2 * d.ptrSize() # [QSharedData] + [vptr]
elided, tz = d.encodeByteArray(idBase, limit=100) tz = d.encodeByteArray(idBase, limit=100)
d.putValue('%s/%s/%s/%s/%s/%s' % (msecs, spec, offset, tz, status, 0), d.putValue('%s/%s/%s/%s/%s/%s' % (msecs, spec, offset, tz, status, 0),
'datetimeinternal') 'datetimeinternal')
else: else:

View File

@@ -76,7 +76,7 @@ QVariant QtTestTreeItem::data(int column, int role) const
return m_multiTest; return m_multiTest;
} }
case LinkRole: case LinkRole:
if (type() == GroupNode) if (type() == GroupNode || type() == Root)
return QVariant(); return QVariant();
if (type() == TestDataFunction || type() == TestDataTag) if (type() == TestDataFunction || type() == TestDataTag)
return TestTreeItem::data(column, role); return TestTreeItem::data(column, role);

View File

@@ -775,19 +775,20 @@ void CMakeBuildStep::updateDeploymentData()
DeploymentData deploymentData; DeploymentData deploymentData;
deploymentData.setLocalInstallRoot(rootDir); deploymentData.setLocalInstallRoot(rootDir);
IDeviceConstPtr device = BuildDeviceKitAspect::device(buildSystem()->kit()); IDeviceConstPtr runDevice = DeviceKitAspect::device(buildSystem()->kit());
const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(), const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(),
[](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); }); [](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); });
auto handleFile = [&appFileNames, rootDir, &deploymentData, device](const FilePath &filePath) { auto handleFile =
[&appFileNames, rootDir, &deploymentData, runDevice](const FilePath &filePath) {
const DeployableFile::Type type = appFileNames.contains(filePath.fileName()) const DeployableFile::Type type = appFileNames.contains(filePath.fileName())
? DeployableFile::TypeExecutable ? DeployableFile::TypeExecutable
: DeployableFile::TypeNormal; : DeployableFile::TypeNormal;
FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir); FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir);
const FilePath targetDir = device->rootPath().pathAppended(targetDirPath.path()); const FilePath targetDir = runDevice->rootPath().pathAppended(targetDirPath.path());
deploymentData.addFile(filePath, targetDir.nativePath(), type); deploymentData.addFile(filePath, targetDir.nativePath(), type);
return IterationPolicy::Continue; return IterationPolicy::Continue;
}; };

View File

@@ -272,6 +272,8 @@ static QString newFilesForFunction(const std::string &cmakeFunction,
bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FilePaths *notAdded) bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FilePaths *notAdded)
{ {
if (notAdded)
*notAdded = filePaths;
if (auto n = dynamic_cast<CMakeTargetNode *>(context)) { if (auto n = dynamic_cast<CMakeTargetNode *>(context)) {
const QString targetName = n->buildKey(); const QString targetName = n->buildKey();
auto target = Utils::findOrDefault(buildTargets(), auto target = Utils::findOrDefault(buildTargets(),
@@ -279,10 +281,9 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP
return target.title == targetName; return target.title == targetName;
}); });
if (target.backtrace.isEmpty()) { if (target.backtrace.isEmpty())
*notAdded = filePaths;
return false; return false;
}
const FilePath targetCMakeFile = target.backtrace.last().path; const FilePath targetCMakeFile = target.backtrace.last().path;
const int targetDefinitionLine = target.backtrace.last().line; const int targetDefinitionLine = target.backtrace.last().line;
@@ -297,7 +298,6 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP
if (!cmakeListFile.ParseString(fileContent->toStdString(), if (!cmakeListFile.ParseString(fileContent->toStdString(),
targetCMakeFile.fileName().toStdString(), targetCMakeFile.fileName().toStdString(),
errorString)) { errorString)) {
*notAdded = filePaths;
return false; return false;
} }
} }
@@ -308,10 +308,8 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP
return func.Line() == targetDefinitionLine; return func.Line() == targetDefinitionLine;
}); });
if (function == cmakeListFile.Functions.end()) { if (function == cmakeListFile.Functions.end())
*notAdded = filePaths;
return false; return false;
}
// Special case: when qt_add_executable and qt_add_qml_module use the same target name // Special case: when qt_add_executable and qt_add_qml_module use the same target name
// then qt_add_qml_module function should be used // then qt_add_qml_module function should be used
@@ -385,16 +383,16 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP
Core::EditorManager::openEditorAt({targetCMakeFile, line, column + extraChars}, Core::EditorManager::openEditorAt({targetCMakeFile, line, column + extraChars},
Constants::CMAKE_EDITOR_ID, Constants::CMAKE_EDITOR_ID,
Core::EditorManager::DoNotMakeVisible)); Core::EditorManager::DoNotMakeVisible));
if (!editor) { if (!editor)
*notAdded = filePaths;
return false; return false;
}
editor->insert(snippet); editor->insert(snippet);
editor->editorWidget()->autoIndent(); editor->editorWidget()->autoIndent();
if (!Core::DocumentManager::saveDocument(editor->document())) if (!Core::DocumentManager::saveDocument(editor->document()))
return false; return false;
if (notAdded)
notAdded->clear();
return true; return true;
} }

View File

@@ -95,6 +95,12 @@ private:
void onFilter(QLoggingCategory *category) void onFilter(QLoggingCategory *category)
{ {
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(
this, [category, this] { onFilter(category); }, Qt::QueuedConnection);
return;
}
if (!m_categories.contains(category)) { if (!m_categories.contains(category)) {
m_categories.append(category); m_categories.append(category);
emit newLogCategory(category); emit newLogCategory(category);
@@ -108,7 +114,7 @@ private:
bool m_started{false}; bool m_started{false};
}; };
QLoggingCategory::CategoryFilter LogCategoryRegistry::s_oldFilter; QLoggingCategory::CategoryFilter LogCategoryRegistry::s_oldFilter = nullptr;
struct SavedEntry struct SavedEntry
{ {
@@ -1100,6 +1106,8 @@ void setCategoryColor(const QString &category, const QColor &color)
s_categoryColor.remove(category); s_categoryColor.remove(category);
} }
static bool wasLogViewerShown = false;
void LoggingViewer::showLoggingView() void LoggingViewer::showLoggingView()
{ {
LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance();
@@ -1108,10 +1116,15 @@ void LoggingViewer::showLoggingView()
staticLogWidget->show(); staticLogWidget->show();
staticLogWidget->raise(); staticLogWidget->raise();
staticLogWidget->activateWindow(); staticLogWidget->activateWindow();
wasLogViewerShown = true;
} }
void LoggingViewer::hideLoggingView() void LoggingViewer::hideLoggingView()
{ {
if (!wasLogViewerShown)
return;
LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance();
QTC_ASSERT(staticLogWidget, return); QTC_ASSERT(staticLogWidget, return);
staticLogWidget->close(); staticLogWidget->close();

View File

@@ -737,9 +737,11 @@ QString decodeData(const QString &ba, const QString &encoding)
if (spec == Qt::OffsetFromUTC) { if (spec == Qt::OffsetFromUTC) {
dateTime = QDateTime(date, time, spec, offset); dateTime = QDateTime(date, time, spec, offset);
} else if (spec == Qt::TimeZone) { } else if (spec == Qt::TimeZone) {
if (!QTimeZone::isTimeZoneIdAvailable(timeZoneId)) QTimeZone tz(timeZoneId);
if (!tz.isValid())
return QLatin1String("<unavailable>"); return QLatin1String("<unavailable>");
dateTime = QDateTime(date, time, QTimeZone(timeZoneId));
dateTime = QDateTime(date, time, tz);
} else { } else {
dateTime = QDateTime(date, time, spec); dateTime = QDateTime(date, time, spec);
} }

View File

@@ -746,6 +746,8 @@ void IosSimulatorToolHandlerPrivate::requestTransferApp(const FilePath &appBundl
installAppOnSimulator(); installAppOnSimulator();
} else { } else {
errorMsg(Tr::tr("Application install on simulator failed. Simulator not running.")); errorMsg(Tr::tr("Application install on simulator failed. Simulator not running."));
if (!response.commandOutput.isEmpty())
errorMsg(response.commandOutput);
didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure); didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure);
emit q->finished(q); emit q->finished(q);
} }

View File

@@ -3,6 +3,7 @@
#include "simulatorcontrol.h" #include "simulatorcontrol.h"
#include "iosconfigurations.h" #include "iosconfigurations.h"
#include "iostr.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/async.h> #include <utils/async.h>
@@ -384,10 +385,10 @@ void startSimulator(QPromise<SimulatorControl::ResponseData> &promise, const QSt
SimulatorInfo simInfo = deviceInfo(simUdid); SimulatorInfo simInfo = deviceInfo(simUdid);
if (!simInfo.available) { if (!simInfo.available) {
qCDebug(simulatorLog) << "Simulator device is not available." << simUdid; promise.addResult(
response.withError(Tr::tr("Simulator device is not available. (%1)").arg(simUdid)));
return; return;
} }
// Shutting down state checks are for the case when simulator start is called within a short // Shutting down state checks are for the case when simulator start is called within a short
// interval of closing the previous interval of the simulator. We wait untill the shutdown // interval of closing the previous interval of the simulator. We wait untill the shutdown
// process is complete. // process is complete.
@@ -399,8 +400,14 @@ void startSimulator(QPromise<SimulatorControl::ResponseData> &promise, const QSt
} }
if (simInfo.isShuttingDown()) { if (simInfo.isShuttingDown()) {
qCDebug(simulatorLog) << "Cannot start Simulator device. " promise.addResult(response.withError(
<< "Previous instance taking too long to shutdown." << simInfo; Tr::tr("Cannot start Simulator device. Previous instance taking "
"too long to shut down. (name=%1, udid=%2, available=%3, state=%4, runtime=%5)")
.arg(simInfo.name)
.arg(simInfo.identifier)
.arg(simInfo.available)
.arg(simInfo.state)
.arg(simInfo.runtimeName)));
return; return;
} }
@@ -421,11 +428,19 @@ void startSimulator(QPromise<SimulatorControl::ResponseData> &promise, const QSt
if (info.isBooted()) if (info.isBooted())
response.success = true; response.success = true;
} else { } else {
qCDebug(simulatorLog) << "Error starting simulator."; promise.addResult(response.withError(Tr::tr("Error starting simulator.")));
return;
} }
} else { } else {
qCDebug(simulatorLog) << "Cannot start Simulator device. Simulator not in shutdown state." promise.addResult(response.withError(
<< simInfo; Tr::tr("Cannot start Simulator device. Simulator not in shutdown state.(name=%1, "
"udid=%2, available=%3, state=%4, runtime=%5)")
.arg(simInfo.name)
.arg(simInfo.identifier)
.arg(simInfo.available)
.arg(simInfo.state)
.arg(simInfo.runtimeName)));
return;
} }
if (!promise.isCanceled()) if (!promise.isCanceled())

View File

@@ -61,6 +61,14 @@ public:
bool success = false; bool success = false;
qint64 pID = -1; qint64 pID = -1;
QString commandOutput; QString commandOutput;
ResponseData withError(const QString errorMsg)
{
ResponseData result = *this;
result.commandOutput = errorMsg;
result.success = false;
return result;
}
}; };
public: public:

View File

@@ -301,10 +301,13 @@ void PyLSConfigureAssistant::installPythonLanguageServer(const FilePath &python,
auto install = new PipInstallTask(python); auto install = new PipInstallTask(python);
connect(install, &PipInstallTask::finished, this, [=](const bool success) { connect(install, &PipInstallTask::finished, this, [=](const bool success) {
const QList<TextEditor::TextDocument *> additionalDocuments = m_infoBarEntries.take(python);
if (success) { if (success) {
if (document) { if (PyLSClient *client = clientForPython(python)) {
if (PyLSClient *client = clientForPython(python)) if (document)
LanguageClientManager::openDocumentWithClient(document, client); LanguageClientManager::openDocumentWithClient(document, client);
for (TextEditor::TextDocument *additionalDocument : additionalDocuments)
LanguageClientManager::openDocumentWithClient(additionalDocument, client);
} }
} }
install->deleteLater(); install->deleteLater();
@@ -375,15 +378,6 @@ void PyLSConfigureAssistant::handlePyLSState(const FilePath &python,
} }
} }
void PyLSConfigureAssistant::updateEditorInfoBars(const FilePath &python, Client *client)
{
for (TextEditor::TextDocument *document : instance()->m_infoBarEntries.take(python)) {
instance()->resetEditorInfoBar(document);
if (client)
LanguageClientManager::openDocumentWithClient(document, client);
}
}
void PyLSConfigureAssistant::resetEditorInfoBar(TextEditor::TextDocument *document) void PyLSConfigureAssistant::resetEditorInfoBar(TextEditor::TextDocument *document)
{ {
for (QList<TextEditor::TextDocument *> &documents : m_infoBarEntries) for (QList<TextEditor::TextDocument *> &documents : m_infoBarEntries)

View File

@@ -53,8 +53,6 @@ class PyLSConfigureAssistant : public QObject
public: public:
static PyLSConfigureAssistant *instance(); static PyLSConfigureAssistant *instance();
static void updateEditorInfoBars(const Utils::FilePath &python,
LanguageClient::Client *client);
static void openDocumentWithPython(const Utils::FilePath &python, static void openDocumentWithPython(const Utils::FilePath &python,
TextEditor::TextDocument *document); TextEditor::TextDocument *document);

View File

@@ -120,6 +120,7 @@ RecordOptionsDialog::RecordOptionsDialog(QWidget *parent)
st, st,
buttonBox, buttonBox,
}.attachTo(this); }.attachTo(this);
layout()->setSizeConstraint(QLayout::SetFixedSize);
connect(buttonBox, &QDialogButtonBox::accepted, this, [this] { connect(buttonBox, &QDialogButtonBox::accepted, this, [this] {
const QRect cropRect = m_cropScene->fullySelected() ? QRect() : screenCropRect(); const QRect cropRect = m_cropScene->fullySelected() ? QRect() : screenCropRect();

View File

@@ -550,12 +550,18 @@ bool ShortcutMap::dispatchEvent(QKeyEvent *e)
<< "\", " << next->id << ", " << static_cast<bool>(enabledShortcuts > 1) << "\", " << next->id << ", " << static_cast<bool>(enabledShortcuts > 1)
<< ") to object(" << next->owner << ')'; << ") to object(" << next->owner << ')';
} }
if (auto action = qobject_cast<QAction *>(next->owner)) {
// We call the action here ourselves instead of relying on sending a ShortCut event,
// as the action will try to match the shortcut id to the global shortcutmap.
// This triggers an annoying Q_ASSERT when linking against a debug Qt. Calling trigger
// directly circumvents this.
action->trigger();
return action->isEnabled();
} else {
QShortcutEvent se(next->keyseq, next->id, enabledShortcuts > 1); QShortcutEvent se(next->keyseq, next->id, enabledShortcuts > 1);
QCoreApplication::sendEvent(const_cast<QObject *>(next->owner), &se); QCoreApplication::sendEvent(const_cast<QObject *>(next->owner), &se);
}
QAction *action = qobject_cast<QAction *>(next->owner);
if (action)
return action->isEnabled();
return true; return true;
} }

View File

@@ -2260,7 +2260,10 @@ void tst_Dumpers::dumper_data()
QTest::newRow("QDateTime") QTest::newRow("QDateTime")
<< Data("#include <QDateTime>", << Data("#include <QDateTime>\n"
"#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)\n"
"#include <QTimeZone>\n"
"#endif",
"QDate d0;\n" "QDate d0;\n"
"QDate d1;\n" "QDate d1;\n"
@@ -2270,9 +2273,12 @@ void tst_Dumpers::dumper_data()
"QTime t1(13, 15, 32);\n" "QTime t1(13, 15, 32);\n"
"QDateTime dt0;\n" "QDateTime dt0;\n"
"QDateTime dt1(QDate(1980, 1, 1), QTime(13, 15, 32), Qt::UTC);", "QDateTime dt1(QDate(1980, 1, 1), QTime(13, 15, 32), Qt::UTC);\n"
"#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)\n"
"QDateTime dt2(QDate(1980, 1, 1), QTime(13, 15, 32), QTimeZone(60 * 60));\n"
"#endif\n",
"&d0, &d1, &t0, &t1, &dt0, &dt1") "&d0, &d1, &t0, &t1, &dt0, &dt1, &dt2")
+ CoreProfile() + CoreProfile()
@@ -2297,6 +2303,7 @@ void tst_Dumpers::dumper_data()
+ Check("dt0", "(invalid)", "@QDateTime") + Check("dt0", "(invalid)", "@QDateTime")
+ Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") + Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime")
+ Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") + Check("dt1", Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime")
+ Check("dt1", Value6("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime")
+ Check("dt1.(ISO)", + Check("dt1.(ISO)",
"\"1980-01-01T13:15:32Z\"", "@QString") % NeedsInferiorCall "\"1980-01-01T13:15:32Z\"", "@QString") % NeedsInferiorCall
+ Check("dt1.(Locale)", AnyValue, "@QString") % NeedsInferiorCall + Check("dt1.(Locale)", AnyValue, "@QString") % NeedsInferiorCall
@@ -2306,11 +2313,13 @@ void tst_Dumpers::dumper_data()
+ Check("dt1.toString", + Check("dt1.toString",
Value4("\"Tue Jan 1 13:15:32 1980\""), "@QString") % NeedsInferiorCall Value4("\"Tue Jan 1 13:15:32 1980\""), "@QString") % NeedsInferiorCall
+ Check("dt1.toString", + Check("dt1.toString",
Value5("\"Tue Jan 1 13:15:32 1980 GMT\""), "@QString") % NeedsInferiorCall; Value5("\"Tue Jan 1 13:15:32 1980 GMT\""), "@QString") % NeedsInferiorCall
//+ Check("dt1.toUTC", //+ Check("dt1.toUTC",
// Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") % Optional() // Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime") % Optional()
//+ Check("dt1.toUTC", //+ Check("dt1.toUTC",
// Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") % Optional(); // Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") % Optional();
+ Check("dt2", Value5("Tue Jan 1 13:15:32 1980 UTC+01:00"), "@QDateTime")
+ Check("dt2", Value6("Tue Jan 1 13:15:32 1980 UTC+01:00"), "@QDateTime");
QTest::newRow("QFileInfo") QTest::newRow("QFileInfo")