forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/11.0' into qds/dev
Change-Id: I23063e42621b272bd4b04a06746955e6b5768b49
This commit is contained in:
2
.github/workflows/build_cmake.yml
vendored
2
.github/workflows/build_cmake.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
- 'doc/**'
|
- 'doc/**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
QT_VERSION: 6.5.1
|
QT_VERSION: 6.5.2
|
||||||
MACOS_DEPLOYMENT_TARGET: 10.15
|
MACOS_DEPLOYMENT_TARGET: 10.15
|
||||||
CLANG_VERSION: 16.0.2
|
CLANG_VERSION: 16.0.2
|
||||||
ELFUTILS_VERSION: 0.175
|
ELFUTILS_VERSION: 0.175
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
set(IDE_VERSION "11.0.0") # The IDE version.
|
set(IDE_VERSION "11.0.2") # The IDE version.
|
||||||
set(IDE_VERSION_COMPAT "11.0.0") # The IDE Compatibility version.
|
set(IDE_VERSION_COMPAT "11.0.0") # The IDE Compatibility version.
|
||||||
set(IDE_VERSION_DISPLAY "11.0.0") # The IDE display version.
|
set(IDE_VERSION_DISPLAY "11.0.2") # The IDE display version.
|
||||||
set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year.
|
set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year.
|
||||||
|
|
||||||
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
|
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ instructions:
|
|||||||
variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_16.0.2-based
|
variableValue: https://ci-files02-hki.ci.qt.io/packages/jenkins/qtcreator_libclang/libclang-release_16.0.2-based
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: QTC_QT_BASE_URL
|
variableName: QTC_QT_BASE_URL
|
||||||
variableValue: "https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.1-released/Qt"
|
variableValue: "https://ci-files02-hki.ci.qt.io/packages/jenkins/archive/qt/6.5/6.5.2-released/Qt"
|
||||||
- type: EnvironmentVariable
|
- type: EnvironmentVariable
|
||||||
variableName: QTC_QT_MODULES
|
variableName: QTC_QT_MODULES
|
||||||
variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine"
|
variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine"
|
||||||
|
|||||||
77
dist/changelog/changes-11.0.1.md
vendored
Normal file
77
dist/changelog/changes-11.0.1.md
vendored
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
Qt Creator 11.0.1
|
||||||
|
=================
|
||||||
|
|
||||||
|
Qt Creator version 11.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/v11.0.0..v11.0.1
|
||||||
|
|
||||||
|
General
|
||||||
|
-------
|
||||||
|
|
||||||
|
* Fixed writing configuration files with `sdktool`
|
||||||
|
* Fixed exporting keyboard shortcut schemes
|
||||||
|
([QTCREATORBUG-29431](https://bugreports.qt.io/browse/QTCREATORBUG-29431))
|
||||||
|
|
||||||
|
Editing
|
||||||
|
-------
|
||||||
|
|
||||||
|
### SCXML
|
||||||
|
|
||||||
|
* Fixed a crash when `onEntry`/`onExit` events and transitions where displayed
|
||||||
|
together
|
||||||
|
([QTCREATORBUG-29429](https://bugreports.qt.io/browse/QTCREATORBUG-29429))
|
||||||
|
|
||||||
|
### Beautifier
|
||||||
|
|
||||||
|
* Fixed setting a customized Clang Format style
|
||||||
|
([QTCREATORBUG-28525](https://bugreports.qt.io/browse/QTCREATORBUG-28525))
|
||||||
|
|
||||||
|
Projects
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Fixed a crash when editing kits
|
||||||
|
([QTCREATORBUG-29382](https://bugreports.qt.io/browse/QTCREATORBUG-29382),
|
||||||
|
[QTCREATORBUG-29425](https://bugreports.qt.io/browse/QTCREATORBUG-29425))
|
||||||
|
* Fixed a crash when manually re-detecting toolchains
|
||||||
|
([QTCREATORBUG-29430](https://bugreports.qt.io/browse/QTCREATORBUG-29430))
|
||||||
|
* Fixed the pasting of large texts in integrated terminal
|
||||||
|
* Incredibuild
|
||||||
|
* Fixed missing UI in the build steps
|
||||||
|
|
||||||
|
### CMake
|
||||||
|
|
||||||
|
* Fixed an issue with framework paths with CMake >= 3.27
|
||||||
|
([QTCREATORBUG-29450](https://bugreports.qt.io/browse/QTCREATORBUG-29450))
|
||||||
|
|
||||||
|
Debugging
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Fixed the button state in the dialog for loading core files
|
||||||
|
* Fixed debugging with debuggers that still use Python 2.7
|
||||||
|
([QTCREATORBUG-29440](https://bugreports.qt.io/browse/QTCREATORBUG-29440))
|
||||||
|
* GDB
|
||||||
|
* Fixed `Use common locations for debug information`
|
||||||
|
|
||||||
|
Version Control Systems
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
### Git
|
||||||
|
|
||||||
|
* Fixed a crash when tools are not found in `PATH`
|
||||||
|
|
||||||
|
Credits for these changes go to:
|
||||||
|
--------------------------------
|
||||||
|
Aleksei German
|
||||||
|
André Pönitz
|
||||||
|
Christian Kandeler
|
||||||
|
Christian Stenger
|
||||||
|
Cristian Adam
|
||||||
|
Eike Ziller
|
||||||
|
Leena Miettinen
|
||||||
|
Marcus Tillmanns
|
||||||
|
Robert Löhning
|
||||||
73
dist/changelog/changes-11.0.2.md
vendored
Normal file
73
dist/changelog/changes-11.0.2.md
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
Qt Creator 11.0.2
|
||||||
|
=================
|
||||||
|
|
||||||
|
Qt Creator version 11.0.2 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/v11.0.1..v11.0.2
|
||||||
|
|
||||||
|
General
|
||||||
|
-------
|
||||||
|
|
||||||
|
* Allow fractional high DPI scaling without modifying the environment
|
||||||
|
([QTCREATORBUG-29461](https://bugreports.qt.io/browse/QTCREATORBUG-29461))
|
||||||
|
|
||||||
|
Editing
|
||||||
|
-------
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
* Fixed a potential crash when reloading a document
|
||||||
|
([QTCREATORBUG-29432](https://bugreports.qt.io/browse/QTCREATORBUG-29432))
|
||||||
|
|
||||||
|
### Copilot
|
||||||
|
|
||||||
|
* Fixed a crash when configuring an unusable copilot agent in the settings
|
||||||
|
|
||||||
|
Debug
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Fixed a problem where debugging with "Run In Terminal" would fail on Linux
|
||||||
|
([QTCREATORBUG-29463](https://bugreports.qt.io/browse/QTCREATORBUG-29463))
|
||||||
|
|
||||||
|
Projects
|
||||||
|
--------
|
||||||
|
|
||||||
|
### CMake
|
||||||
|
|
||||||
|
* Fixed code completion for ui file components for CMake based projects
|
||||||
|
([QTCREATORBUG-28787](https://bugreports.qt.io/browse/QTCREATORBUG-28787))
|
||||||
|
* Fix reading ninjaPath from QtCreator.ini
|
||||||
|
([QTBUG-115754](https://bugreports.qt.io/browse/QTBUG-115754))
|
||||||
|
* Fixed incorrect device checks when using Boot2Qt
|
||||||
|
([QTCREATORBUG-29474](https://bugreports.qt.io/browse/QTCREATORBUG-29474))
|
||||||
|
|
||||||
|
### QMake
|
||||||
|
|
||||||
|
* Avoid cleaning the build directory after switching kits
|
||||||
|
([QTCREATORBUG-29451](https://bugreports.qt.io/browse/QTCREATORBUG-29451))
|
||||||
|
([QTCREATORBUG-29481](https://bugreports.qt.io/browse/QTCREATORBUG-29481))
|
||||||
|
|
||||||
|
Version Control Systems
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
### Fossil
|
||||||
|
|
||||||
|
* Show the correct dialog when reverting the current file
|
||||||
|
|
||||||
|
Credits for these changes go to:
|
||||||
|
--------------------------------
|
||||||
|
Aaron Barany
|
||||||
|
André Pönitz
|
||||||
|
Björn Schäpers
|
||||||
|
Christian Kandeler
|
||||||
|
Cristian Adam
|
||||||
|
David Schulz
|
||||||
|
Jaroslaw Kobus
|
||||||
|
Leena Miettinen
|
||||||
|
Marcus Tillmanns
|
||||||
|
Orgad Shaneh
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
\row
|
\row
|
||||||
\li View examples of what you can do with Qt
|
\li View examples of what you can do with Qt
|
||||||
\li \l{List of Qt Examples}
|
\li \l{Qt Examples and Tutorials}
|
||||||
|
|
||||||
\row
|
\row
|
||||||
\li Develop Qt applications for desktop and \l{glossary-device}{devices}
|
\li Develop Qt applications for desktop and \l{glossary-device}{devices}
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import qbs.Utilities
|
|||||||
Module {
|
Module {
|
||||||
Depends { name: "cpp"; required: false }
|
Depends { name: "cpp"; required: false }
|
||||||
|
|
||||||
property string qtcreator_display_version: '11.0.0'
|
property string qtcreator_display_version: '11.0.2'
|
||||||
property string ide_version_major: '11'
|
property string ide_version_major: '11'
|
||||||
property string ide_version_minor: '0'
|
property string ide_version_minor: '0'
|
||||||
property string ide_version_release: '0'
|
property string ide_version_release: '2'
|
||||||
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
|
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
|
||||||
+ ide_version_release
|
+ ide_version_release
|
||||||
|
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ def qdump__std____1__stack(d, value):
|
|||||||
d.putBetterType(value.type)
|
d.putBetterType(value.type)
|
||||||
|
|
||||||
|
|
||||||
def GetChildMemberWithName(value: DumperBase.Value, name: str) -> DumperBase.Value:
|
def GetChildMemberWithName(value, name):
|
||||||
members: list[DumperBase.Value] = value.members(True)
|
members = value.members(True)
|
||||||
|
|
||||||
for member in members:
|
for member in members:
|
||||||
if member.name == name:
|
if member.name == name:
|
||||||
@@ -172,8 +172,8 @@ def GetChildMemberWithName(value: DumperBase.Value, name: str) -> DumperBase.Val
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def GetIndexOfChildWithName(value: DumperBase.Value, name: str) -> int:
|
def GetIndexOfChildWithName(value, name):
|
||||||
members: list[DumperBase.Value] = value.members(True)
|
members = value.members(True)
|
||||||
|
|
||||||
for i, member in enumerate(members):
|
for i, member in enumerate(members):
|
||||||
if member.name == name:
|
if member.name == name:
|
||||||
@@ -229,8 +229,8 @@ def std_1_string_dumper_v2(d, value):
|
|||||||
if not Short_Sp:
|
if not Short_Sp:
|
||||||
raise Exception("Could not find __s")
|
raise Exception("Could not find __s")
|
||||||
|
|
||||||
Is_Long: DumperBase.Value = GetChildMemberWithName(Short_Sp, "__is_long_")
|
Is_Long = GetChildMemberWithName(Short_Sp, "__is_long_")
|
||||||
Size_Sp: DumperBase.Value = GetChildMemberWithName(Short_Sp, "__size_")
|
Size_Sp = GetChildMemberWithName(Short_Sp, "__size_")
|
||||||
if not Size_Sp:
|
if not Size_Sp:
|
||||||
raise Exception("Could not find __size_")
|
raise Exception("Could not find __size_")
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -278,26 +278,16 @@ static Utils::QtcSettings *createUserSettings()
|
|||||||
|
|
||||||
static void setHighDpiEnvironmentVariable()
|
static void setHighDpiEnvironmentVariable()
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isMacHost())
|
if (Utils::HostOsInfo::isMacHost() || qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::unique_ptr<QSettings> settings(createUserSettings());
|
std::unique_ptr<QSettings> settings(createUserSettings());
|
||||||
|
|
||||||
const bool defaultValue = Utils::HostOsInfo::isWindowsHost();
|
const bool defaultValue = Utils::HostOsInfo::isWindowsHost();
|
||||||
const bool enableHighDpiScaling = settings->value("Core/EnableHighDpiScaling", defaultValue).toBool();
|
const bool enableHighDpiScaling = settings->value("Core/EnableHighDpiScaling", defaultValue).toBool();
|
||||||
|
const auto policy = enableHighDpiScaling ? Qt::HighDpiScaleFactorRoundingPolicy::PassThrough
|
||||||
static const char ENV_VAR_QT_DEVICE_PIXEL_RATIO[] = "QT_DEVICE_PIXEL_RATIO";
|
: Qt::HighDpiScaleFactorRoundingPolicy::Floor;
|
||||||
if (enableHighDpiScaling
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(policy);
|
||||||
&& !qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO) // legacy in 5.6, but still functional
|
|
||||||
&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
|
|
||||||
&& !qEnvironmentVariableIsSet("QT_SCALE_FACTOR")
|
|
||||||
&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY"))
|
|
||||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
|
|
||||||
Qt::HighDpiScaleFactorRoundingPolicy::Floor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPixmapCacheLimit()
|
void setPixmapCacheLimit()
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ bool UnixPtyProcess::startProcess(const QString &shellPath,
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
m_shellProcess.m_handleMaster = ::posix_openpt(O_RDWR | O_NOCTTY);
|
m_shellProcess.m_handleMaster = ::posix_openpt(O_RDWR | O_NOCTTY);
|
||||||
|
|
||||||
|
int flags = fcntl(m_shellProcess.m_handleMaster, F_GETFL, 0);
|
||||||
|
fcntl(m_shellProcess.m_handleMaster, F_SETFL, flags | O_NONBLOCK);
|
||||||
|
|
||||||
if (m_shellProcess.m_handleMaster <= 0) {
|
if (m_shellProcess.m_handleMaster <= 0) {
|
||||||
m_lastError = QString("UnixPty Error: unable to open master -> %1").arg(QLatin1String(strerror(errno)));
|
m_lastError = QString("UnixPty Error: unable to open master -> %1").arg(QLatin1String(strerror(errno)));
|
||||||
kill();
|
kill();
|
||||||
@@ -308,10 +312,7 @@ QByteArray UnixPtyProcess::readAll()
|
|||||||
|
|
||||||
qint64 UnixPtyProcess::write(const QByteArray &byteArray)
|
qint64 UnixPtyProcess::write(const QByteArray &byteArray)
|
||||||
{
|
{
|
||||||
int result = ::write(m_shellProcess.m_handleMaster, byteArray.constData(), byteArray.size());
|
return ::write(m_shellProcess.m_handleMaster, byteArray.constData(), byteArray.size());
|
||||||
Q_UNUSED(result)
|
|
||||||
|
|
||||||
return byteArray.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UnixPtyProcess::isAvailable()
|
bool UnixPtyProcess::isAvailable()
|
||||||
|
|||||||
@@ -204,7 +204,27 @@ FilePath FilePath::currentWorkingPath()
|
|||||||
|
|
||||||
bool FilePath::isRootPath() const
|
bool FilePath::isRootPath() const
|
||||||
{
|
{
|
||||||
// FIXME: Make host-independent
|
if (needsDevice()) {
|
||||||
|
QStringView path = pathView();
|
||||||
|
if (osType() != OsTypeWindows)
|
||||||
|
return path == QLatin1String("/");
|
||||||
|
|
||||||
|
// Remote windows paths look like this: "/c:/", so we remove the leading '/'
|
||||||
|
if (path.startsWith('/'))
|
||||||
|
path = path.mid(1);
|
||||||
|
|
||||||
|
if (path.length() > 3)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!startsWithDriveLetter())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (path.length() == 3 && path[2] != QLatin1Char('/'))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return *this == FilePath::fromString(QDir::rootPath());
|
return *this == FilePath::fromString(QDir::rootPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1269,7 +1289,16 @@ FilePath FilePath::fromSettings(const QVariant &variant)
|
|||||||
const QUrl url = variant.toUrl();
|
const QUrl url = variant.toUrl();
|
||||||
return FilePath::fromParts(url.scheme(), url.host(), url.path());
|
return FilePath::fromParts(url.scheme(), url.host(), url.path());
|
||||||
}
|
}
|
||||||
return FilePath::fromUserInput(variant.toString());
|
|
||||||
|
// The installer sometimes fails and adds "docker:/..." instead of "docker://...
|
||||||
|
// So we fix these paths here in those cases.
|
||||||
|
QString data = variant.toString();
|
||||||
|
if (data.length() > 8 && data.startsWith("docker:/") && data[8] != '/') {
|
||||||
|
qWarning() << "Broken path in settings:" << data << ", applying workaround.";
|
||||||
|
data.insert(8, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
return FilePath::fromUserInput(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant FilePath::toSettings() const
|
QVariant FilePath::toSettings() const
|
||||||
@@ -1337,15 +1366,15 @@ bool FilePath::contains(const QString &s) const
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Checks whether the FilePath starts with a drive letter.
|
\brief Checks whether the FilePath starts with a drive letter.
|
||||||
|
|
||||||
Defaults to \c false if it is a non-Windows host or represents a path on device
|
|
||||||
|
|
||||||
Returns whether FilePath starts with a drive letter
|
Returns whether FilePath starts with a drive letter
|
||||||
*/
|
*/
|
||||||
bool FilePath::startsWithDriveLetter() const
|
bool FilePath::startsWithDriveLetter() const
|
||||||
{
|
{
|
||||||
const QStringView p = pathView();
|
QStringView p = pathView();
|
||||||
return !needsDevice() && p.size() >= 2 && isWindowsDriveLetter(p[0]) && p.at(1) == ':';
|
if (needsDevice() && !p.isEmpty())
|
||||||
|
p = p.mid(1);
|
||||||
|
|
||||||
|
return p.size() >= 2 && isWindowsDriveLetter(p[0]) && p.at(1) == ':';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -722,8 +722,7 @@ bool FileUtils::copyRecursively(
|
|||||||
bool FileUtils::copyIfDifferent(const FilePath &srcFilePath, const FilePath &tgtFilePath)
|
bool FileUtils::copyIfDifferent(const FilePath &srcFilePath, const FilePath &tgtFilePath)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(srcFilePath.exists(), return false);
|
QTC_ASSERT(srcFilePath.exists(), return false);
|
||||||
QTC_ASSERT(srcFilePath.scheme() == tgtFilePath.scheme(), return false);
|
QTC_ASSERT(srcFilePath.isSameDevice(tgtFilePath), return false);
|
||||||
QTC_ASSERT(srcFilePath.host() == tgtFilePath.host(), return false);
|
|
||||||
|
|
||||||
if (tgtFilePath.exists()) {
|
if (tgtFilePath.exists()) {
|
||||||
const QDateTime srcModified = srcFilePath.lastModified();
|
const QDateTime srcModified = srcFilePath.lastModified();
|
||||||
|
|||||||
@@ -1204,7 +1204,7 @@ FilePath Process::workingDirectory() const
|
|||||||
void Process::setWorkingDirectory(const FilePath &dir)
|
void Process::setWorkingDirectory(const FilePath &dir)
|
||||||
{
|
{
|
||||||
if (dir.needsDevice() && d->m_setup.m_commandLine.executable().needsDevice()) {
|
if (dir.needsDevice() && d->m_setup.m_commandLine.executable().needsDevice()) {
|
||||||
QTC_CHECK(dir.host() == d->m_setup.m_commandLine.executable().host());
|
QTC_CHECK(dir.isSameDevice(d->m_setup.m_commandLine.executable()));
|
||||||
}
|
}
|
||||||
d->m_setup.m_workingDirectory = dir;
|
d->m_setup.m_workingDirectory = dir;
|
||||||
}
|
}
|
||||||
@@ -1564,9 +1564,11 @@ qint64 Process::writeRaw(const QByteArray &input)
|
|||||||
QTC_ASSERT(state() == QProcess::Running, return -1);
|
QTC_ASSERT(state() == QProcess::Running, return -1);
|
||||||
QTC_ASSERT(QThread::currentThread() == thread(), return -1);
|
QTC_ASSERT(QThread::currentThread() == thread(), return -1);
|
||||||
qint64 result = -1;
|
qint64 result = -1;
|
||||||
QMetaObject::invokeMethod(d->m_process.get(), [this, input] {
|
QMetaObject::invokeMethod(
|
||||||
d->m_process->write(input);
|
d->m_process.get(),
|
||||||
}, d->connectionType(), &result);
|
[this, input] { return d->m_process->write(input); },
|
||||||
|
d->connectionType(),
|
||||||
|
&result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,6 @@ ClangFormatSettings::ClangFormatSettings()
|
|||||||
fallbackStyle.addOption("WebKit");
|
fallbackStyle.addOption("WebKit");
|
||||||
fallbackStyle.setDefaultValue("Default");
|
fallbackStyle.setDefaultValue("Default");
|
||||||
|
|
||||||
predefinedStyle.setSettingsKey("predefinedStyle");
|
|
||||||
predefinedStyle.setDefaultValue("LLVM");
|
|
||||||
|
|
||||||
customStyle.setSettingsKey("customStyle");
|
customStyle.setSettingsKey("customStyle");
|
||||||
|
|
||||||
documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME)
|
documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME)
|
||||||
@@ -254,7 +251,8 @@ public:
|
|||||||
connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled);
|
connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled);
|
||||||
connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled);
|
connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled);
|
||||||
|
|
||||||
setOnApply([settings, configurations] {
|
setOnApply([settings, configurations, customizedStyleButton] {
|
||||||
|
settings->usePredefinedStyle.setValue(!customizedStyleButton->isChecked());
|
||||||
settings->customStyle.setValue(configurations->currentConfiguration());
|
settings->customStyle.setValue(configurations->currentConfiguration());
|
||||||
settings->save();
|
settings->save();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -161,7 +161,9 @@ clang::format::FormatStyle qtcStyle()
|
|||||||
style.SpaceAfterTemplateKeyword = false;
|
style.SpaceAfterTemplateKeyword = false;
|
||||||
style.SpaceBeforeAssignmentOperators = true;
|
style.SpaceBeforeAssignmentOperators = true;
|
||||||
style.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements;
|
style.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements;
|
||||||
|
#if LLVM_VERSION_MAJOR < 17
|
||||||
style.SpaceInEmptyParentheses = false;
|
style.SpaceInEmptyParentheses = false;
|
||||||
|
#endif
|
||||||
style.SpacesBeforeTrailingComments = 1;
|
style.SpacesBeforeTrailingComments = 1;
|
||||||
#if LLVM_VERSION_MAJOR >= 13
|
#if LLVM_VERSION_MAJOR >= 13
|
||||||
style.SpacesInAngles = FormatStyle::SIAS_Never;
|
style.SpacesInAngles = FormatStyle::SIAS_Never;
|
||||||
@@ -169,8 +171,12 @@ clang::format::FormatStyle qtcStyle()
|
|||||||
style.SpacesInAngles = false;
|
style.SpacesInAngles = false;
|
||||||
#endif
|
#endif
|
||||||
style.SpacesInContainerLiterals = false;
|
style.SpacesInContainerLiterals = false;
|
||||||
|
#if LLVM_VERSION_MAJOR >= 17
|
||||||
|
style.SpacesInParens = FormatStyle::SIPO_Never;
|
||||||
|
#else
|
||||||
style.SpacesInCStyleCastParentheses = false;
|
style.SpacesInCStyleCastParentheses = false;
|
||||||
style.SpacesInParentheses = false;
|
style.SpacesInParentheses = false;
|
||||||
|
#endif
|
||||||
style.SpacesInSquareBrackets = false;
|
style.SpacesInSquareBrackets = false;
|
||||||
addQtcStatementMacros(style);
|
addQtcStatementMacros(style);
|
||||||
style.Standard = FormatStyle::LS_Cpp11;
|
style.Standard = FormatStyle::LS_Cpp11;
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#include <android/androidconstants.h>
|
#include <android/androidconstants.h>
|
||||||
|
|
||||||
|
#include <baremetal/baremetalconstants.h>
|
||||||
|
|
||||||
#include <ios/iosconstants.h>
|
#include <ios/iosconstants.h>
|
||||||
|
|
||||||
#include <webassembly/webassemblyconstants.h>
|
#include <webassembly/webassemblyconstants.h>
|
||||||
@@ -188,6 +190,8 @@ static bool supportsStageForInstallation(const Kit *kit)
|
|||||||
return runDevice->id() != buildDevice->id()
|
return runDevice->id() != buildDevice->id()
|
||||||
&& runDevice->type() != Android::Constants::ANDROID_DEVICE_TYPE
|
&& runDevice->type() != Android::Constants::ANDROID_DEVICE_TYPE
|
||||||
&& runDevice->type() != Ios::Constants::IOS_DEVICE_TYPE
|
&& runDevice->type() != Ios::Constants::IOS_DEVICE_TYPE
|
||||||
|
&& runDevice->type() != Ios::Constants::IOS_SIMULATOR_TYPE
|
||||||
|
&& runDevice->type() != BareMetal::Constants::BareMetalOsType
|
||||||
&& runDevice->type() != WebAssembly::Constants::WEBASSEMBLY_DEVICE_TYPE;
|
&& runDevice->type() != WebAssembly::Constants::WEBASSEMBLY_DEVICE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -654,9 +654,31 @@ FilePaths CMakeBuildSystem::filesGeneratedFrom(const FilePath &sourceFile) const
|
|||||||
FilePath generatedFilePath = buildConfiguration()->buildDirectory().resolvePath(relativePath);
|
FilePath generatedFilePath = buildConfiguration()->buildDirectory().resolvePath(relativePath);
|
||||||
|
|
||||||
if (sourceFile.suffix() == "ui") {
|
if (sourceFile.suffix() == "ui") {
|
||||||
generatedFilePath = generatedFilePath
|
const QString generatedFileName = "ui_" + sourceFile.completeBaseName() + ".h";
|
||||||
.pathAppended("ui_" + sourceFile.completeBaseName() + ".h");
|
|
||||||
return {generatedFilePath};
|
auto targetNode = this->project()->nodeForFilePath(sourceFile);
|
||||||
|
while (!dynamic_cast<const CMakeTargetNode *>(targetNode))
|
||||||
|
targetNode = targetNode->parentFolderNode();
|
||||||
|
|
||||||
|
FilePaths generatedFilePaths;
|
||||||
|
if (targetNode) {
|
||||||
|
const QString autogenSignature = targetNode->buildKey() + "_autogen/include";
|
||||||
|
|
||||||
|
// If AUTOUIC reports the generated header file name, use that path
|
||||||
|
generatedFilePaths = this->project()->files(
|
||||||
|
[autogenSignature, generatedFileName](const Node *n) {
|
||||||
|
const FilePath filePath = n->filePath();
|
||||||
|
if (!filePath.contains(autogenSignature))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return Project::GeneratedFiles(n) && filePath.endsWith(generatedFileName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (generatedFilePaths.empty())
|
||||||
|
generatedFilePaths = {generatedFilePath.pathAppended(generatedFileName)};
|
||||||
|
|
||||||
|
return generatedFilePaths;
|
||||||
}
|
}
|
||||||
if (sourceFile.suffix() == "scxml") {
|
if (sourceFile.suffix() == "scxml") {
|
||||||
generatedFilePath = generatedFilePath.pathAppended(sourceFile.completeBaseName());
|
generatedFilePath = generatedFilePath.pathAppended(sourceFile.completeBaseName());
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (buildDirectory.needsDevice()) {
|
if (buildDirectory.needsDevice()) {
|
||||||
if (cmake->cmakeExecutable().host() != buildDirectory.host()) {
|
if (!cmake->cmakeExecutable().isSameDevice(buildDirectory)) {
|
||||||
const QString msg = ::CMakeProjectManager::Tr::tr(
|
const QString msg = ::CMakeProjectManager::Tr::tr(
|
||||||
"CMake executable \"%1\" and build directory \"%2\" must be on the same device.")
|
"CMake executable \"%1\" and build directory \"%2\" must be on the same device.")
|
||||||
.arg(cmake->cmakeExecutable().toUserOutput(), buildDirectory.toUserOutput());
|
.arg(cmake->cmakeExecutable().toUserOutput(), buildDirectory.toUserOutput());
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ CMakeSpecificSettings::CMakeSpecificSettings()
|
|||||||
// never save this to the settings:
|
// never save this to the settings:
|
||||||
ninjaPath.setToSettingsTransformation(
|
ninjaPath.setToSettingsTransformation(
|
||||||
[](const QVariant &) { return QVariant::fromValue(QString()); });
|
[](const QVariant &) { return QVariant::fromValue(QString()); });
|
||||||
|
ninjaPath.setFromSettingsTransformation([](const QVariant &from) {
|
||||||
|
// Sometimes the installer appends the same ninja path to the qtcreator.ini file
|
||||||
|
const QString path = from.canConvert<QStringList>() ? from.toStringList().last()
|
||||||
|
: from.toString();
|
||||||
|
return FilePath::fromUserInput(path).toVariant();
|
||||||
|
});
|
||||||
|
|
||||||
packageManagerAutoSetup.setSettingsKey("PackageManagerAutoSetup");
|
packageManagerAutoSetup.setSettingsKey("PackageManagerAutoSetup");
|
||||||
packageManagerAutoSetup.setDefaultValue(true);
|
packageManagerAutoSetup.setDefaultValue(true);
|
||||||
|
|||||||
@@ -486,6 +486,26 @@ static std::vector<FileApiDetails::FragmentInfo> extractFragments(const QJsonObj
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void addIncludeInfo(std::vector<IncludeInfo> *includes,
|
||||||
|
const QJsonObject &compileGroups,
|
||||||
|
const QString §ion)
|
||||||
|
{
|
||||||
|
const std::vector<IncludeInfo> add
|
||||||
|
= transform<std::vector>(compileGroups.value(section).toArray(), [](const QJsonValue &v) {
|
||||||
|
const QJsonObject i = v.toObject();
|
||||||
|
const QString path = i.value("path").toString();
|
||||||
|
const bool isSystem = i.value("isSystem").toBool();
|
||||||
|
const ProjectExplorer::HeaderPath hp(path,
|
||||||
|
isSystem
|
||||||
|
? ProjectExplorer::HeaderPathType::System
|
||||||
|
: ProjectExplorer::HeaderPathType::User);
|
||||||
|
|
||||||
|
return IncludeInfo{ProjectExplorer::RawProjectPart::frameworkDetectionHeuristic(hp),
|
||||||
|
i.value("backtrace").toInt(-1)};
|
||||||
|
});
|
||||||
|
std::copy(add.cbegin(), add.cend(), std::back_inserter(*includes));
|
||||||
|
}
|
||||||
|
|
||||||
static TargetDetails extractTargetDetails(const QJsonObject &root, QString &errorMessage)
|
static TargetDetails extractTargetDetails(const QJsonObject &root, QString &errorMessage)
|
||||||
{
|
{
|
||||||
TargetDetails t;
|
TargetDetails t;
|
||||||
@@ -581,6 +601,10 @@ static TargetDetails extractTargetDetails(const QJsonObject &root, QString &erro
|
|||||||
const QJsonArray compileGroups = root.value("compileGroups").toArray();
|
const QJsonArray compileGroups = root.value("compileGroups").toArray();
|
||||||
t.compileGroups = transform<std::vector>(compileGroups, [](const QJsonValue &v) {
|
t.compileGroups = transform<std::vector>(compileGroups, [](const QJsonValue &v) {
|
||||||
const QJsonObject o = v.toObject();
|
const QJsonObject o = v.toObject();
|
||||||
|
std::vector<IncludeInfo> includes;
|
||||||
|
addIncludeInfo(&includes, o, "includes");
|
||||||
|
// new in CMake 3.27+:
|
||||||
|
addIncludeInfo(&includes, o, "frameworks");
|
||||||
return CompileInfo{
|
return CompileInfo{
|
||||||
transform<std::vector>(o.value("sourceIndexes").toArray(),
|
transform<std::vector>(o.value("sourceIndexes").toArray(),
|
||||||
[](const QJsonValue &v) { return v.toInt(-1); }),
|
[](const QJsonValue &v) { return v.toInt(-1); }),
|
||||||
@@ -590,21 +614,7 @@ static TargetDetails extractTargetDetails(const QJsonObject &root, QString &erro
|
|||||||
const QJsonObject o = v.toObject();
|
const QJsonObject o = v.toObject();
|
||||||
return o.value("fragment").toString();
|
return o.value("fragment").toString();
|
||||||
}),
|
}),
|
||||||
transform<std::vector>(
|
includes,
|
||||||
o.value("includes").toArray(),
|
|
||||||
[](const QJsonValue &v) {
|
|
||||||
const QJsonObject i = v.toObject();
|
|
||||||
const QString path = i.value("path").toString();
|
|
||||||
const bool isSystem = i.value("isSystem").toBool();
|
|
||||||
const ProjectExplorer::HeaderPath
|
|
||||||
hp(path,
|
|
||||||
isSystem ? ProjectExplorer::HeaderPathType::System
|
|
||||||
: ProjectExplorer::HeaderPathType::User);
|
|
||||||
|
|
||||||
return IncludeInfo{
|
|
||||||
ProjectExplorer::RawProjectPart::frameworkDetectionHeuristic(hp),
|
|
||||||
i.value("backtrace").toInt(-1)};
|
|
||||||
}),
|
|
||||||
transform<std::vector>(o.value("defines").toArray(),
|
transform<std::vector>(o.value("defines").toArray(),
|
||||||
[](const QJsonValue &v) {
|
[](const QJsonValue &v) {
|
||||||
const QJsonObject d = v.toObject();
|
const QJsonObject d = v.toObject();
|
||||||
|
|||||||
@@ -95,14 +95,19 @@ void AuthWidget::updateClient(const Utils::FilePath &nodeJs, const Utils::FilePa
|
|||||||
m_client = nullptr;
|
m_client = nullptr;
|
||||||
setState(Tr::tr("Sign In"), false);
|
setState(Tr::tr("Sign In"), false);
|
||||||
m_button->setEnabled(false);
|
m_button->setEnabled(false);
|
||||||
if (!nodeJs.isExecutableFile() || !agent.exists()) {
|
if (!nodeJs.isExecutableFile() || !agent.exists())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
setState(Tr::tr("Sign In"), true);
|
setState(Tr::tr("Sign In"), true);
|
||||||
|
|
||||||
m_client = new CopilotClient(nodeJs, agent);
|
m_client = new CopilotClient(nodeJs, agent);
|
||||||
connect(m_client, &Client::initialized, this, &AuthWidget::checkStatus);
|
connect(m_client, &Client::initialized, this, &AuthWidget::checkStatus);
|
||||||
|
connect(m_client, &QObject::destroyed, this, [destroyedClient = m_client, this]() {
|
||||||
|
if (destroyedClient != m_client)
|
||||||
|
return;
|
||||||
|
m_client = nullptr;
|
||||||
|
m_progressIndicator->hide();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuthWidget::signIn()
|
void AuthWidget::signIn()
|
||||||
|
|||||||
@@ -49,6 +49,36 @@ CommandsFile::CommandsFile(const FilePath &filename)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XML attributes cannot contain these characters, and
|
||||||
|
// QXmlStreamWriter just bails out with an error.
|
||||||
|
// QKeySequence::toString() should probably not result in these
|
||||||
|
// characters, but it currently does, see QTCREATORBUG-29431
|
||||||
|
static bool containsInvalidCharacters(const QString &s)
|
||||||
|
{
|
||||||
|
const auto end = s.constEnd();
|
||||||
|
for (auto it = s.constBegin(); it != end; ++it) {
|
||||||
|
// from QXmlStreamWriterPrivate::writeEscaped
|
||||||
|
if (*it == u'\v' || *it == u'\f' || *it <= u'\x1F' || *it >= u'\uFFFE') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static QString toAttribute(const QString &s)
|
||||||
|
{
|
||||||
|
if (containsInvalidCharacters(s))
|
||||||
|
return "0x" + QString::fromUtf8(s.toUtf8().toHex());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
static QString fromAttribute(const QStringView &s)
|
||||||
|
{
|
||||||
|
if (s.startsWith(QLatin1String("0x")))
|
||||||
|
return QString::fromUtf8(QByteArray::fromHex(s.sliced(2).toUtf8()));
|
||||||
|
return s.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
@@ -77,7 +107,7 @@ QMap<QString, QList<QKeySequence>> CommandsFile::importCommands() const
|
|||||||
QTC_ASSERT(!currentId.isEmpty(), continue);
|
QTC_ASSERT(!currentId.isEmpty(), continue);
|
||||||
const QXmlStreamAttributes attributes = r.attributes();
|
const QXmlStreamAttributes attributes = r.attributes();
|
||||||
if (attributes.hasAttribute(ctx.valueAttribute)) {
|
if (attributes.hasAttribute(ctx.valueAttribute)) {
|
||||||
const QString keyString = attributes.value(ctx.valueAttribute).toString();
|
const QString keyString = fromAttribute(attributes.value(ctx.valueAttribute));
|
||||||
QList<QKeySequence> keys = result.value(currentId);
|
QList<QKeySequence> keys = result.value(currentId);
|
||||||
result.insert(currentId, keys << QKeySequence(keyString));
|
result.insert(currentId, keys << QKeySequence(keyString));
|
||||||
}
|
}
|
||||||
@@ -94,7 +124,6 @@ QMap<QString, QList<QKeySequence>> CommandsFile::importCommands() const
|
|||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
||||||
{
|
{
|
||||||
FileSaver saver(m_filePath, QIODevice::Text);
|
FileSaver saver(m_filePath, QIODevice::Text);
|
||||||
@@ -119,7 +148,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
|||||||
w.writeAttribute(ctx.idAttribute, id.toString());
|
w.writeAttribute(ctx.idAttribute, id.toString());
|
||||||
for (const QKeySequence &k : item->m_keys) {
|
for (const QKeySequence &k : item->m_keys) {
|
||||||
w.writeEmptyElement(ctx.keyElement);
|
w.writeEmptyElement(ctx.keyElement);
|
||||||
w.writeAttribute(ctx.valueAttribute, k.toString());
|
w.writeAttribute(ctx.valueAttribute, toAttribute(k.toString()));
|
||||||
}
|
}
|
||||||
w.writeEndElement(); // Shortcut
|
w.writeEndElement(); // Shortcut
|
||||||
}
|
}
|
||||||
@@ -127,7 +156,8 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
|||||||
w.writeEndElement();
|
w.writeEndElement();
|
||||||
w.writeEndDocument();
|
w.writeEndDocument();
|
||||||
|
|
||||||
saver.setResult(&w);
|
if (!saver.setResult(&w))
|
||||||
|
qWarning() << saver.errorString();
|
||||||
}
|
}
|
||||||
return saver.finalize();
|
return saver.finalize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,10 +343,10 @@ IDocument::OpenResult IDocument::open(QString *errorString, const Utils::FilePat
|
|||||||
*/
|
*/
|
||||||
bool IDocument::save(QString *errorString, const Utils::FilePath &filePath, bool autoSave)
|
bool IDocument::save(QString *errorString, const Utils::FilePath &filePath, bool autoSave)
|
||||||
{
|
{
|
||||||
emit aboutToSave(filePath, autoSave);
|
emit aboutToSave(filePath.isEmpty() ? this->filePath() : filePath, autoSave);
|
||||||
const bool success = saveImpl(errorString, filePath, autoSave);
|
const bool success = saveImpl(errorString, filePath, autoSave);
|
||||||
if (success)
|
if (success)
|
||||||
emit saved(filePath, autoSave);
|
emit saved(filePath.isEmpty() ? this->filePath() : filePath, autoSave);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,13 @@ static QString defineDirectiveToDefineOption(const Macro ¯o)
|
|||||||
return QString::fromUtf8(option);
|
return QString::fromUtf8(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QStringList cpuBlacklist()
|
||||||
|
{
|
||||||
|
QStringList blacklist = qtcEnvironmentVariable("QTC_CLANGD_CPU_BLACKLIST")
|
||||||
|
.split(':', Qt::SkipEmptyParts);
|
||||||
|
return blacklist << "cortex-a72.cortex-a53"; // See QTCREATORBUG-29304
|
||||||
|
}
|
||||||
|
|
||||||
QStringList XclangArgs(const QStringList &args)
|
QStringList XclangArgs(const QStringList &args)
|
||||||
{
|
{
|
||||||
QStringList options;
|
QStringList options;
|
||||||
@@ -270,6 +277,7 @@ void CompilerOptionsBuilder::addPicIfCompilerFlagsContainsIt()
|
|||||||
void CompilerOptionsBuilder::addCompilerFlags()
|
void CompilerOptionsBuilder::addCompilerFlags()
|
||||||
{
|
{
|
||||||
add(m_compilerFlags.flags);
|
add(m_compilerFlags.flags);
|
||||||
|
removeUnsupportedCpuFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerOptionsBuilder::addMsvcExceptions()
|
void CompilerOptionsBuilder::addMsvcExceptions()
|
||||||
@@ -375,6 +383,17 @@ void CompilerOptionsBuilder::addIncludeFile(const QString &file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CompilerOptionsBuilder::removeUnsupportedCpuFlags()
|
||||||
|
{
|
||||||
|
const QStringList blacklist = cpuBlacklist();
|
||||||
|
for (auto it = m_options.begin(); it != m_options.end();) {
|
||||||
|
if (it->startsWith("-mcpu=") && blacklist.contains(it->mid(6)))
|
||||||
|
it = m_options.erase(it);
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CompilerOptionsBuilder::addIncludedFiles(const QStringList &files)
|
void CompilerOptionsBuilder::addIncludedFiles(const QStringList &files)
|
||||||
{
|
{
|
||||||
for (const QString &file : files) {
|
for (const QString &file : files) {
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ private:
|
|||||||
QStringList wrappedMingwHeadersIncludePath() const;
|
QStringList wrappedMingwHeadersIncludePath() const;
|
||||||
QByteArray msvcVersion() const;
|
QByteArray msvcVersion() const;
|
||||||
void addIncludeFile(const QString &file);
|
void addIncludeFile(const QString &file);
|
||||||
|
void removeUnsupportedCpuFlags();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const ProjectPart &m_projectPart;
|
const ProjectPart &m_projectPart;
|
||||||
|
|||||||
@@ -124,6 +124,9 @@ bool CppRefactoringFile::isCursorOn(unsigned tokenIndex) const
|
|||||||
|
|
||||||
bool CppRefactoringFile::isCursorOn(const AST *ast) const
|
bool CppRefactoringFile::isCursorOn(const AST *ast) const
|
||||||
{
|
{
|
||||||
|
if (!ast)
|
||||||
|
return false;
|
||||||
|
|
||||||
QTextCursor tc = cursor();
|
QTextCursor tc = cursor();
|
||||||
int cursorBegin = tc.selectionStart();
|
int cursorBegin = tc.selectionStart();
|
||||||
|
|
||||||
|
|||||||
@@ -749,7 +749,7 @@ bool DebuggerRunTool::fixupParameters()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!debuggerSettings()->autoEnrichParameters.value()) {
|
if (debuggerSettings()->autoEnrichParameters.value()) {
|
||||||
const FilePath sysroot = rp.sysRoot;
|
const FilePath sysroot = rp.sysRoot;
|
||||||
if (rp.debugInfoLocation.isEmpty())
|
if (rp.debugInfoLocation.isEmpty())
|
||||||
rp.debugInfoLocation = sysroot / "/usr/lib/debug";
|
rp.debugInfoLocation = sysroot / "/usr/lib/debug";
|
||||||
|
|||||||
@@ -161,7 +161,10 @@ AttachCoreDialog::~AttachCoreDialog()
|
|||||||
|
|
||||||
int AttachCoreDialog::exec()
|
int AttachCoreDialog::exec()
|
||||||
{
|
{
|
||||||
connect(d->symbolFileName, &PathChooser::textChanged, this, &AttachCoreDialog::changed);
|
connect(d->symbolFileName, &PathChooser::validChanged, this, &AttachCoreDialog::changed);
|
||||||
|
connect(d->coreFileName, &PathChooser::validChanged, this, [this] {
|
||||||
|
coreFileChanged(d->coreFileName->rawFilePath());
|
||||||
|
});
|
||||||
connect(d->coreFileName, &PathChooser::textChanged, this, [this] {
|
connect(d->coreFileName, &PathChooser::textChanged, this, [this] {
|
||||||
coreFileChanged(d->coreFileName->rawFilePath());
|
coreFileChanged(d->coreFileName->rawFilePath());
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -247,8 +247,10 @@ class RevertDialog : public QDialog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RevertDialog(const QString &title, QWidget *parent = nullptr);
|
RevertDialog(const QString &title, QWidget *parent = nullptr);
|
||||||
|
QString revision() const { return m_revisionLineEdit->text(); }
|
||||||
|
|
||||||
QLineEdit *m_revisionLineEdit;
|
private:
|
||||||
|
QLineEdit *m_revisionLineEdit = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
FossilPlugin::~FossilPlugin()
|
FossilPlugin::~FossilPlugin()
|
||||||
@@ -429,15 +431,11 @@ void FossilPluginPrivate::revertCurrentFile()
|
|||||||
const VcsBase::VcsBasePluginState state = currentState();
|
const VcsBase::VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return);
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
|
|
||||||
QDialog dialog(Core::ICore::dialogParent());
|
RevertDialog dialog(Tr::tr("Revert"), Core::ICore::dialogParent());
|
||||||
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
auto revisionLineEdit = new QLineEdit;
|
m_client.revertFile(state.currentFileTopLevel(), state.relativeCurrentFile(),
|
||||||
|
dialog.revision());
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
}
|
||||||
return;
|
|
||||||
m_client.revertFile(state.currentFileTopLevel(),
|
|
||||||
state.relativeCurrentFile(),
|
|
||||||
revisionLineEdit->text());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FossilPluginPrivate::statusCurrentFile()
|
void FossilPluginPrivate::statusCurrentFile()
|
||||||
@@ -512,7 +510,7 @@ void FossilPluginPrivate::revertAll()
|
|||||||
|
|
||||||
RevertDialog dialog(Tr::tr("Revert"), Core::ICore::dialogParent());
|
RevertDialog dialog(Tr::tr("Revert"), Core::ICore::dialogParent());
|
||||||
if (dialog.exec() == QDialog::Accepted)
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
m_client.revertAll(state.topLevel(), dialog.m_revisionLineEdit->text());
|
m_client.revertAll(state.topLevel(), dialog.revision());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FossilPluginPrivate::statusMulti()
|
void FossilPluginPrivate::statusMulti()
|
||||||
@@ -628,7 +626,7 @@ void FossilPluginPrivate::update()
|
|||||||
|
|
||||||
RevertDialog dialog(Tr::tr("Update"), Core::ICore::dialogParent());
|
RevertDialog dialog(Tr::tr("Update"), Core::ICore::dialogParent());
|
||||||
if (dialog.exec() == QDialog::Accepted)
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
m_client.update(state.topLevel(), dialog.m_revisionLineEdit->text());
|
m_client.update(state.topLevel(), dialog.revision());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FossilPluginPrivate::configureRepository()
|
void FossilPluginPrivate::configureRepository()
|
||||||
|
|||||||
@@ -421,9 +421,10 @@ public:
|
|||||||
QVector<ParameterAction *> m_projectActions;
|
QVector<ParameterAction *> m_projectActions;
|
||||||
QVector<QAction *> m_repositoryActions;
|
QVector<QAction *> m_repositoryActions;
|
||||||
ParameterAction *m_applyCurrentFilePatchAction = nullptr;
|
ParameterAction *m_applyCurrentFilePatchAction = nullptr;
|
||||||
Gerrit::Internal::GerritPlugin m_gerritPlugin;
|
|
||||||
|
|
||||||
GitClient m_gitClient;
|
GitClient m_gitClient;
|
||||||
|
Gerrit::Internal::GerritPlugin m_gerritPlugin;
|
||||||
|
|
||||||
QPointer<StashDialog> m_stashDialog;
|
QPointer<StashDialog> m_stashDialog;
|
||||||
BranchViewFactory m_branchViewFactory;
|
BranchViewFactory m_branchViewFactory;
|
||||||
QPointer<RemoteDialog> m_remoteDialog;
|
QPointer<RemoteDialog> m_remoteDialog;
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
CommandBuilderAspect::CommandBuilderAspect(BuildStep *step)
|
CommandBuilderAspect::CommandBuilderAspect(BuildStep *step)
|
||||||
: d(new CommandBuilderAspectPrivate(step))
|
: BaseAspect(step)
|
||||||
|
, d(new CommandBuilderAspectPrivate(step))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -287,8 +287,13 @@ public:
|
|||||||
|
|
||||||
void setProposal(IAssistProposal *proposal, const QString &prefix)
|
void setProposal(IAssistProposal *proposal, const QString &prefix)
|
||||||
{
|
{
|
||||||
if (!proposal)
|
if (!proposal) {
|
||||||
|
// Close the proposal if we have no running processor otherwise ignore the empty
|
||||||
|
// proposal and wait for the processor to finish
|
||||||
|
if (!m_processor || !m_processor->running())
|
||||||
|
closeProposal();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (proposal->id() != TextEditor::Constants::GENERIC_PROPOSAL_ID) {
|
if (proposal->id() != TextEditor::Constants::GENERIC_PROPOSAL_ID) {
|
||||||
// We received something else than a generic proposal so we cannot update the model
|
// We received something else than a generic proposal so we cannot update the model
|
||||||
closeProposal();
|
closeProposal();
|
||||||
@@ -305,13 +310,14 @@ public:
|
|||||||
GenericProposalWidget::updateProposal(std::move(interface));
|
GenericProposalWidget::updateProposal(std::move(interface));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto processor = m_provider->createProcessor(interface.get());
|
m_processor = m_provider->createProcessor(interface.get());
|
||||||
QTC_ASSERT(processor, return);
|
QTC_ASSERT(m_processor, return);
|
||||||
|
|
||||||
const QString prefix = interface->textAt(m_basePosition,
|
const QString prefix = interface->textAt(m_basePosition,
|
||||||
interface->position() - m_basePosition);
|
interface->position() - m_basePosition);
|
||||||
|
|
||||||
processor->setAsyncCompletionAvailableHandler([this, processor, prefix](IAssistProposal *proposal) {
|
m_processor->setAsyncCompletionAvailableHandler([this, processor = m_processor, prefix](
|
||||||
|
IAssistProposal *proposal) {
|
||||||
QTC_ASSERT(processor == m_processor, return);
|
QTC_ASSERT(processor == m_processor, return);
|
||||||
if (!processor->running()) {
|
if (!processor->running()) {
|
||||||
// do not delete this processor directly since this function is called from within the processor
|
// do not delete this processor directly since this function is called from within the processor
|
||||||
@@ -324,11 +330,11 @@ public:
|
|||||||
setProposal(proposal, prefix);
|
setProposal(proposal, prefix);
|
||||||
});
|
});
|
||||||
|
|
||||||
setProposal(processor->start(std::move(interface)), prefix);
|
setProposal(m_processor->start(std::move(interface)), prefix);
|
||||||
if (processor->running())
|
if (!m_processor->running()) {
|
||||||
m_processor = processor;
|
delete m_processor;
|
||||||
else
|
m_processor = nullptr;
|
||||||
delete processor;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <debugger/debuggeritem.h>
|
#include <debugger/debuggeritem.h>
|
||||||
#include <debugger/debuggeritemmanager.h>
|
#include <debugger/debuggeritemmanager.h>
|
||||||
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
@@ -447,7 +448,8 @@ static ToolChain *iarToolChain(const FilePath &path, Id language)
|
|||||||
== BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID;
|
== BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID;
|
||||||
});
|
});
|
||||||
if (iarFactory) {
|
if (iarFactory) {
|
||||||
Toolchains detected = iarFactory->autoDetect(ToolchainDetector({}, {}, {}));
|
Toolchains detected = iarFactory->autoDetect(
|
||||||
|
{{}, DeviceManager::defaultDesktopDevice(), {}});
|
||||||
if (detected.isEmpty())
|
if (detected.isEmpty())
|
||||||
detected = iarFactory->detectForImport({path, language});
|
detected = iarFactory->detectForImport({path, language});
|
||||||
for (auto tc : detected) {
|
for (auto tc : detected) {
|
||||||
|
|||||||
@@ -107,10 +107,10 @@ static FilePath filePathValue(const FilePath &value, const QStringList &candidat
|
|||||||
{
|
{
|
||||||
if (!value.isEmpty())
|
if (!value.isEmpty())
|
||||||
return value;
|
return value;
|
||||||
const FilePaths additionalSearchPaths = sshSettings->searchPathRetriever();
|
Environment env = Environment::systemEnvironment();
|
||||||
|
env.prependToPath(sshSettings->searchPathRetriever());
|
||||||
for (const QString &candidate : candidateFileNames) {
|
for (const QString &candidate : candidateFileNames) {
|
||||||
const FilePath filePath = Environment::systemEnvironment()
|
const FilePath filePath = env.searchInPath(candidate);
|
||||||
.searchInPath(candidate, additionalSearchPaths);
|
|
||||||
if (!filePath.isEmpty())
|
if (!filePath.isEmpty())
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1377,6 +1377,17 @@ void BuildDeviceKitAspect::devicesChanged()
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// EnvironmentKitAspect:
|
// EnvironmentKitAspect:
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
static EnvironmentItem forceMSVCEnglishItem()
|
||||||
|
{
|
||||||
|
static EnvironmentItem item("VSLANG", "1033");
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool enforcesMSVCEnglish(const EnvironmentItems &changes)
|
||||||
|
{
|
||||||
|
return changes.contains(forceMSVCEnglishItem());
|
||||||
|
}
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class EnvironmentKitAspectWidget final : public KitAspectWidget
|
class EnvironmentKitAspectWidget final : public KitAspectWidget
|
||||||
{
|
{
|
||||||
@@ -1411,7 +1422,7 @@ private:
|
|||||||
|
|
||||||
void refresh() override
|
void refresh() override
|
||||||
{
|
{
|
||||||
const EnvironmentItems changes = currentEnvironment();
|
const EnvironmentItems changes = envWithoutMSVCEnglishEnforcement();
|
||||||
const QString shortSummary = EnvironmentItem::toStringList(changes).join("; ");
|
const QString shortSummary = EnvironmentItem::toStringList(changes).join("; ");
|
||||||
m_summaryLabel->setText(shortSummary.isEmpty() ? Tr::tr("No changes to apply.") : shortSummary);
|
m_summaryLabel->setText(shortSummary.isEmpty() ? Tr::tr("No changes to apply.") : shortSummary);
|
||||||
}
|
}
|
||||||
@@ -1423,32 +1434,29 @@ private:
|
|||||||
VariableChooser::addSupportForChildWidgets(w, expander);
|
VariableChooser::addSupportForChildWidgets(w, expander);
|
||||||
};
|
};
|
||||||
auto changes = EnvironmentDialog::getEnvironmentItems(m_summaryLabel,
|
auto changes = EnvironmentDialog::getEnvironmentItems(m_summaryLabel,
|
||||||
currentEnvironment(),
|
envWithoutMSVCEnglishEnforcement(),
|
||||||
QString(),
|
QString(),
|
||||||
polisher);
|
polisher);
|
||||||
if (!changes)
|
if (!changes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (HostOsInfo::isWindowsHost()) {
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
const EnvironmentItem forceMSVCEnglishItem("VSLANG", "1033");
|
// re-add what envWithoutMSVCEnglishEnforcement removed
|
||||||
if (m_vslangCheckbox->isChecked() && changes->indexOf(forceMSVCEnglishItem) < 0)
|
// or update vslang checkbox if user added it manually
|
||||||
changes->append(forceMSVCEnglishItem);
|
if (m_vslangCheckbox->isChecked() && !enforcesMSVCEnglish(*changes))
|
||||||
|
changes->append(forceMSVCEnglishItem());
|
||||||
|
else if (enforcesMSVCEnglish(*changes))
|
||||||
|
m_vslangCheckbox->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentKitAspect::setEnvironmentChanges(m_kit, *changes);
|
EnvironmentKitAspect::setEnvironmentChanges(m_kit, *changes);
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentItems currentEnvironment() const
|
EnvironmentItems envWithoutMSVCEnglishEnforcement() const
|
||||||
{
|
{
|
||||||
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
|
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
|
||||||
|
|
||||||
if (HostOsInfo::isWindowsHost()) {
|
if (HostOsInfo::isWindowsHost())
|
||||||
const EnvironmentItem forceMSVCEnglishItem("VSLANG", "1033");
|
changes.removeAll(forceMSVCEnglishItem());
|
||||||
if (changes.indexOf(forceMSVCEnglishItem) >= 0) {
|
|
||||||
m_vslangCheckbox->setCheckState(Qt::Checked);
|
|
||||||
changes.removeAll(forceMSVCEnglishItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sorted(std::move(changes), [](const EnvironmentItem &lhs, const EnvironmentItem &rhs)
|
return sorted(std::move(changes), [](const EnvironmentItem &lhs, const EnvironmentItem &rhs)
|
||||||
{ return QString::localeAwareCompare(lhs.name, rhs.name) < 0; });
|
{ return QString::localeAwareCompare(lhs.name, rhs.name) < 0; });
|
||||||
@@ -1461,13 +1469,14 @@ private:
|
|||||||
m_vslangCheckbox->setToolTip(Tr::tr("Either switches MSVC to English or keeps the language and "
|
m_vslangCheckbox->setToolTip(Tr::tr("Either switches MSVC to English or keeps the language and "
|
||||||
"just forces UTF-8 output (may vary depending on the used MSVC "
|
"just forces UTF-8 output (may vary depending on the used MSVC "
|
||||||
"compiler)."));
|
"compiler)."));
|
||||||
connect(m_vslangCheckbox, &QCheckBox::toggled, this, [this](bool checked) {
|
if (enforcesMSVCEnglish(EnvironmentKitAspect::environmentChanges(m_kit)))
|
||||||
|
m_vslangCheckbox->setChecked(true);
|
||||||
|
connect(m_vslangCheckbox, &QCheckBox::clicked, this, [this](bool checked) {
|
||||||
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
|
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
|
||||||
const EnvironmentItem forceMSVCEnglishItem("VSLANG", "1033");
|
if (!checked && changes.indexOf(forceMSVCEnglishItem()) >= 0)
|
||||||
if (!checked && changes.indexOf(forceMSVCEnglishItem) >= 0)
|
changes.removeAll(forceMSVCEnglishItem());
|
||||||
changes.removeAll(forceMSVCEnglishItem);
|
if (checked && changes.indexOf(forceMSVCEnglishItem()) < 0)
|
||||||
if (checked && changes.indexOf(forceMSVCEnglishItem) < 0)
|
changes.append(forceMSVCEnglishItem());
|
||||||
changes.append(forceMSVCEnglishItem);
|
|
||||||
EnvironmentKitAspect::setEnvironmentChanges(m_kit, changes);
|
EnvironmentKitAspect::setEnvironmentChanges(m_kit, changes);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,8 +117,12 @@ public:
|
|||||||
bool filterIncludesErrors() const { return m_includeErrors; }
|
bool filterIncludesErrors() const { return m_includeErrors; }
|
||||||
void setFilterIncludesErrors(bool b) { m_includeErrors = b; invalidateFilter(); }
|
void setFilterIncludesErrors(bool b) { m_includeErrors = b; invalidateFilter(); }
|
||||||
|
|
||||||
QList<Utils::Id> filteredCategories() const { return m_categoryIds; }
|
QSet<Utils::Id> filteredCategories() const { return m_categoryIds; }
|
||||||
void setFilteredCategories(const QList<Utils::Id> &categoryIds) { m_categoryIds = categoryIds; invalidateFilter(); }
|
void setFilteredCategories(const QSet<Utils::Id> &categoryIds)
|
||||||
|
{
|
||||||
|
m_categoryIds = categoryIds;
|
||||||
|
invalidateFilter();
|
||||||
|
}
|
||||||
|
|
||||||
Task task(const QModelIndex &index) const { return taskModel()->task(mapToSource(index)); }
|
Task task(const QModelIndex &index) const { return taskModel()->task(mapToSource(index)); }
|
||||||
Tasks tasks(const QModelIndexList &indexes) const;
|
Tasks tasks(const QModelIndexList &indexes) const;
|
||||||
@@ -144,7 +148,7 @@ private:
|
|||||||
bool m_filterStringIsRegexp = false;
|
bool m_filterStringIsRegexp = false;
|
||||||
bool m_filterIsInverted = false;
|
bool m_filterIsInverted = false;
|
||||||
Qt::CaseSensitivity m_filterCaseSensitivity = Qt::CaseInsensitive;
|
Qt::CaseSensitivity m_filterCaseSensitivity = Qt::CaseInsensitive;
|
||||||
QList<Utils::Id> m_categoryIds;
|
QSet<Utils::Id> m_categoryIds;
|
||||||
QString m_filterText;
|
QString m_filterText;
|
||||||
QRegularExpression m_filterRegexp;
|
QRegularExpression m_filterRegexp;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -327,19 +327,20 @@ void TaskWindow::setCategoryVisibility(Id categoryId, bool visible)
|
|||||||
if (!categoryId.isValid())
|
if (!categoryId.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QList<Id> categories = d->m_filter->filteredCategories();
|
QSet<Id> categories = d->m_filter->filteredCategories();
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
categories.removeOne(categoryId);
|
categories.remove(categoryId);
|
||||||
else
|
else
|
||||||
categories.append(categoryId);
|
categories.insert(categoryId);
|
||||||
|
|
||||||
d->m_filter->setFilteredCategories(categories);
|
d->m_filter->setFilteredCategories(categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskWindow::saveSettings()
|
void TaskWindow::saveSettings()
|
||||||
{
|
{
|
||||||
QStringList categories = Utils::transform(d->m_filter->filteredCategories(), &Id::toString);
|
const QStringList categories = Utils::toList(
|
||||||
|
Utils::transform(d->m_filter->filteredCategories(), &Id::toString));
|
||||||
SessionManager::setValue(QLatin1String(SESSION_FILTER_CATEGORIES), categories);
|
SessionManager::setValue(QLatin1String(SESSION_FILTER_CATEGORIES), categories);
|
||||||
SessionManager::setValue(QLatin1String(SESSION_FILTER_WARNINGS), d->m_filter->filterIncludesWarnings());
|
SessionManager::setValue(QLatin1String(SESSION_FILTER_WARNINGS), d->m_filter->filterIncludesWarnings());
|
||||||
}
|
}
|
||||||
@@ -348,7 +349,8 @@ void TaskWindow::loadSettings()
|
|||||||
{
|
{
|
||||||
QVariant value = SessionManager::value(QLatin1String(SESSION_FILTER_CATEGORIES));
|
QVariant value = SessionManager::value(QLatin1String(SESSION_FILTER_CATEGORIES));
|
||||||
if (value.isValid()) {
|
if (value.isValid()) {
|
||||||
QList<Id> categories = Utils::transform(value.toStringList(), &Id::fromString);
|
const QSet<Id> categories = Utils::toSet(
|
||||||
|
Utils::transform(value.toStringList(), &Id::fromString));
|
||||||
d->m_filter->setFilteredCategories(categories);
|
d->m_filter->setFilteredCategories(categories);
|
||||||
}
|
}
|
||||||
value = SessionManager::value(QLatin1String(SESSION_FILTER_WARNINGS));
|
value = SessionManager::value(QLatin1String(SESSION_FILTER_WARNINGS));
|
||||||
@@ -369,8 +371,8 @@ void TaskWindow::addCategory(Id categoryId, const QString &displayName, bool vis
|
|||||||
{
|
{
|
||||||
d->m_model->addCategory(categoryId, displayName, priority);
|
d->m_model->addCategory(categoryId, displayName, priority);
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
QList<Id> filters = d->m_filter->filteredCategories();
|
QSet<Id> filters = d->m_filter->filteredCategories();
|
||||||
filters += categoryId;
|
filters.insert(categoryId);
|
||||||
d->m_filter->setFilteredCategories(filters);
|
d->m_filter->setFilteredCategories(filters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -469,7 +471,7 @@ void TaskWindow::updateCategoriesMenu()
|
|||||||
|
|
||||||
d->m_categoriesMenu->clear();
|
d->m_categoriesMenu->clear();
|
||||||
|
|
||||||
const QList<Id> filteredCategories = d->m_filter->filteredCategories();
|
const QSet<Id> filteredCategories = d->m_filter->filteredCategories();
|
||||||
|
|
||||||
QMap<QString, Id> nameToIds;
|
QMap<QString, Id> nameToIds;
|
||||||
const QList<Id> ids = d->m_model->categoryIds();
|
const QList<Id> ids = d->m_model->categoryIds();
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
|
|
||||||
#include "toolchainoptionspage.h"
|
#include "toolchainoptionspage.h"
|
||||||
|
|
||||||
#include "toolchain.h"
|
|
||||||
#include "abi.h"
|
#include "abi.h"
|
||||||
|
#include "devicesupport/devicemanager.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "projectexplorertr.h"
|
#include "projectexplorertr.h"
|
||||||
|
#include "toolchain.h"
|
||||||
#include "toolchainconfigwidget.h"
|
#include "toolchainconfigwidget.h"
|
||||||
#include "toolchainmanager.h"
|
#include "toolchainmanager.h"
|
||||||
|
|
||||||
@@ -404,7 +405,7 @@ void ToolChainOptionsWidget::redetectToolchains()
|
|||||||
QSet<ToolChain *> toDelete;
|
QSet<ToolChain *> toDelete;
|
||||||
ToolChainManager::resetBadToolchains();
|
ToolChainManager::resetBadToolchains();
|
||||||
for (ToolChainFactory *f : ToolChainFactory::allToolChainFactories()) {
|
for (ToolChainFactory *f : ToolChainFactory::allToolChainFactories()) {
|
||||||
const ToolchainDetector detector(knownTcs, {}, {}); // FIXME: Pass device and search paths
|
const ToolchainDetector detector(knownTcs, DeviceManager::defaultDesktopDevice(), {}); // FIXME: Pass search paths
|
||||||
for (ToolChain * const tc : f->autoDetect(detector)) {
|
for (ToolChain * const tc : f->autoDetect(detector)) {
|
||||||
if (knownTcs.contains(tc) || toDelete.contains(tc))
|
if (knownTcs.contains(tc) || toDelete.contains(tc))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -512,7 +512,9 @@ QWidget *QMakeStep::createConfigWidget()
|
|||||||
connect(abisListWidget, &QListWidget::itemChanged, this, [this] {
|
connect(abisListWidget, &QListWidget::itemChanged, this, [this] {
|
||||||
if (m_ignoreChanges.isLocked())
|
if (m_ignoreChanges.isLocked())
|
||||||
return;
|
return;
|
||||||
handleAbiWidgetChange();
|
updateAbiWidgets();
|
||||||
|
if (QmakeBuildConfiguration *bc = qmakeBuildConfiguration())
|
||||||
|
BuildManager::buildLists({bc->cleanSteps()});
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(widget, &QObject::destroyed, this, [this] {
|
connect(widget, &QObject::destroyed, this, [this] {
|
||||||
@@ -704,7 +706,7 @@ void QMakeStep::updateAbiWidgets()
|
|||||||
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
|
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
|
||||||
item->setCheckState(selectedAbis.contains(param) ? Qt::Checked : Qt::Unchecked);
|
item->setCheckState(selectedAbis.contains(param) ? Qt::Checked : Qt::Unchecked);
|
||||||
}
|
}
|
||||||
handleAbiWidgetChange();
|
abisChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,13 +715,6 @@ void QMakeStep::updateEffectiveQMakeCall()
|
|||||||
m_effectiveCall->setValue(effectiveQMakeCall());
|
m_effectiveCall->setValue(effectiveQMakeCall());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStep::handleAbiWidgetChange()
|
|
||||||
{
|
|
||||||
abisChanged();
|
|
||||||
if (QmakeBuildConfiguration *bc = qmakeBuildConfiguration())
|
|
||||||
BuildManager::buildLists({bc->cleanSteps()});
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeStep::recompileMessageBoxFinished(int button)
|
void QMakeStep::recompileMessageBoxFinished(int button)
|
||||||
{
|
{
|
||||||
if (button == QMessageBox::Yes) {
|
if (button == QMessageBox::Yes) {
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ private:
|
|||||||
|
|
||||||
void updateAbiWidgets();
|
void updateAbiWidgets();
|
||||||
void updateEffectiveQMakeCall();
|
void updateEffectiveQMakeCall();
|
||||||
void handleAbiWidgetChange();
|
|
||||||
|
|
||||||
Utils::CommandLine m_qmakeCommand;
|
Utils::CommandLine m_qmakeCommand;
|
||||||
Utils::CommandLine m_makeCommand;
|
Utils::CommandLine m_makeCommand;
|
||||||
|
|||||||
@@ -1675,8 +1675,8 @@ void DesignerActionManager::createDefaultDesignerActions()
|
|||||||
setFlowStartDisplayName,
|
setFlowStartDisplayName,
|
||||||
{},
|
{},
|
||||||
flowCategory,
|
flowCategory,
|
||||||
2,
|
|
||||||
{},
|
{},
|
||||||
|
2,
|
||||||
&setFlowStartItem,
|
&setFlowStartItem,
|
||||||
&isFlowItem,
|
&isFlowItem,
|
||||||
&flowOptionVisible));
|
&flowOptionVisible));
|
||||||
|
|||||||
@@ -29,8 +29,11 @@ FileTransferMethod defaultTransferMethod(Kit *kit)
|
|||||||
return FileTransferMethod::Rsync;
|
return FileTransferMethod::Rsync;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runDevice && runDevice->extraData(Constants::SupportsSftp).toBool())
|
if (runDevice) {
|
||||||
|
const QVariant sftpInfo = runDevice->extraData(Constants::SupportsSftp);
|
||||||
|
if (!sftpInfo.isValid() || sftpInfo.toBool())
|
||||||
return FileTransferMethod::Sftp;
|
return FileTransferMethod::Sftp;
|
||||||
|
}
|
||||||
|
|
||||||
return FileTransferMethod::GenericCopy;
|
return FileTransferMethod::GenericCopy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ EventItem::EventItem(const QPointF &pos, BaseItem *parent)
|
|||||||
{
|
{
|
||||||
m_eventNameItem = new TextItem(this);
|
m_eventNameItem = new TextItem(this);
|
||||||
m_eventNameItem->setParentItem(this);
|
m_eventNameItem->setParentItem(this);
|
||||||
QFont serifFont("Times", 13, QFont::Normal);
|
QFont serifFont("Times", 10, QFont::Normal);
|
||||||
m_eventNameItem->setFont(serifFont);
|
m_eventNameItem->setFont(serifFont);
|
||||||
|
|
||||||
QString color = editorInfo("fontColor");
|
QString color = editorInfo("fontColor");
|
||||||
@@ -49,7 +49,7 @@ OnEntryExitItem::OnEntryExitItem(BaseItem *parent)
|
|||||||
{
|
{
|
||||||
m_eventNameItem = new TextItem(this);
|
m_eventNameItem = new TextItem(this);
|
||||||
m_eventNameItem->setParentItem(this);
|
m_eventNameItem->setParentItem(this);
|
||||||
QFont serifFont("Times", 13, QFont::Normal);
|
QFont serifFont("Times", 10, QFont::Normal);
|
||||||
m_eventNameItem->setFont(serifFont);
|
m_eventNameItem->setFont(serifFont);
|
||||||
m_eventNameItem->setDefaultTextColor(Qt::black);
|
m_eventNameItem->setDefaultTextColor(Qt::black);
|
||||||
m_eventNameItem->setTextInteractionFlags(Qt::NoTextInteraction);
|
m_eventNameItem->setTextInteractionFlags(Qt::NoTextInteraction);
|
||||||
|
|||||||
@@ -232,6 +232,9 @@ void StateItem::transitionsChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_transitionRect = rectInternalTransitions;
|
m_transitionRect = rectInternalTransitions;
|
||||||
|
positionOnEntryItems();
|
||||||
|
positionOnExitItems();
|
||||||
|
|
||||||
updateBoundingRect();
|
updateBoundingRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,8 +440,7 @@ void StateItem::updatePolygon()
|
|||||||
f.setPixelSize(m_titleRect.height() * 0.65);
|
f.setPixelSize(m_titleRect.height() * 0.65);
|
||||||
m_stateNameItem->setFont(f);
|
m_stateNameItem->setFont(f);
|
||||||
|
|
||||||
if (m_onEntryItem)
|
positionOnEntryItems();
|
||||||
m_onEntryItem->setPos(m_titleRect.x(), m_titleRect.bottom());
|
|
||||||
positionOnExitItems();
|
positionOnExitItems();
|
||||||
|
|
||||||
updateTextPositions();
|
updateTextPositions();
|
||||||
@@ -552,7 +554,7 @@ void StateItem::addChild(ScxmlTag *child)
|
|||||||
item->setTag(child);
|
item->setTag(child);
|
||||||
item->finalizeCreation();
|
item->finalizeCreation();
|
||||||
item->updateAttributes();
|
item->updateAttributes();
|
||||||
m_onEntryItem->setPos(m_titleRect.x(), m_titleRect.bottom());
|
positionOnEntryItems();
|
||||||
} else if (child->tagName() == "onexit") {
|
} else if (child->tagName() == "onexit") {
|
||||||
OnEntryExitItem *item = new OnEntryExitItem(this);
|
OnEntryExitItem *item = new OnEntryExitItem(this);
|
||||||
m_onExitItem = item;
|
m_onExitItem = item;
|
||||||
@@ -566,8 +568,18 @@ void StateItem::addChild(ScxmlTag *child)
|
|||||||
void StateItem::positionOnExitItems()
|
void StateItem::positionOnExitItems()
|
||||||
{
|
{
|
||||||
int offset = m_onEntryItem ? m_onEntryItem->boundingRect().height() : 0;
|
int offset = m_onEntryItem ? m_onEntryItem->boundingRect().height() : 0;
|
||||||
if (m_onExitItem)
|
if (m_onExitItem) {
|
||||||
m_onExitItem->setPos(m_titleRect.x(), m_titleRect.bottom() + offset);
|
auto x = m_transitionRect.isValid() ? m_transitionRect.right() : m_titleRect.x();
|
||||||
|
m_onExitItem->setPos(x, m_titleRect.bottom() + offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void StateItem::positionOnEntryItems()
|
||||||
|
{
|
||||||
|
if (m_onEntryItem) {
|
||||||
|
auto x = m_transitionRect.isValid() ? m_transitionRect.right() : m_titleRect.x();
|
||||||
|
m_onEntryItem->setPos(x, m_titleRect.bottom());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString StateItem::itemId() const
|
QString StateItem::itemId() const
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ private:
|
|||||||
void checkParentBoundingRect();
|
void checkParentBoundingRect();
|
||||||
void checkWarningItems();
|
void checkWarningItems();
|
||||||
void positionOnExitItems();
|
void positionOnExitItems();
|
||||||
|
void positionOnEntryItems();
|
||||||
|
|
||||||
TextItem *m_stateNameItem;
|
TextItem *m_stateNameItem;
|
||||||
StateWarningItem *m_stateWarningItem = nullptr;
|
StateWarningItem *m_stateWarningItem = nullptr;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <vterm.h>
|
#include <vterm.h>
|
||||||
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
namespace Terminal::Internal {
|
namespace Terminal::Internal {
|
||||||
|
|
||||||
@@ -21,6 +22,8 @@ QColor toQColor(const VTermColor &c)
|
|||||||
return QColor(qRgb(c.rgb.red, c.rgb.green, c.rgb.blue));
|
return QColor(qRgb(c.rgb.red, c.rgb.green, c.rgb.blue));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr int batchFlushSize = 256;
|
||||||
|
|
||||||
struct TerminalSurfacePrivate
|
struct TerminalSurfacePrivate
|
||||||
{
|
{
|
||||||
TerminalSurfacePrivate(TerminalSurface *surface,
|
TerminalSurfacePrivate(TerminalSurface *surface,
|
||||||
@@ -33,13 +36,64 @@ struct TerminalSurfacePrivate
|
|||||||
, q(surface)
|
, q(surface)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
void flush()
|
||||||
|
{
|
||||||
|
if (m_writeBuffer.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QByteArray data = m_writeBuffer.left(batchFlushSize);
|
||||||
|
qint64 result = m_writeToPty(data);
|
||||||
|
|
||||||
|
if (result != data.size()) {
|
||||||
|
// Not all data was written, remove the unwritten data from the array
|
||||||
|
data.resize(qMax(0, result));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the written data from the buffer
|
||||||
|
if (data.size() > 0)
|
||||||
|
m_writeBuffer = m_writeBuffer.mid(data.size());
|
||||||
|
|
||||||
|
if (!m_writeBuffer.isEmpty())
|
||||||
|
m_delayWriteTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
|
m_delayWriteTimer.setInterval(1);
|
||||||
|
m_delayWriteTimer.setSingleShot(true);
|
||||||
|
|
||||||
|
QObject::connect(&m_delayWriteTimer, &QTimer::timeout, &m_delayWriteTimer, [this] {
|
||||||
|
flush();
|
||||||
|
});
|
||||||
|
|
||||||
vterm_set_utf8(m_vterm.get(), true);
|
vterm_set_utf8(m_vterm.get(), true);
|
||||||
|
|
||||||
static auto writeToPty = [](const char *s, size_t len, void *user) {
|
static auto writeToPty = [](const char *s, size_t len, void *user) {
|
||||||
auto p = static_cast<TerminalSurfacePrivate *>(user);
|
auto p = static_cast<TerminalSurfacePrivate *>(user);
|
||||||
emit p->q->writeToPty(QByteArray(s, static_cast<int>(len)));
|
QByteArray d(s, len);
|
||||||
|
|
||||||
|
// If its just a couple of chars, or we already have data in the writeBuffer,
|
||||||
|
// add the new data to the write buffer and start the delay timer
|
||||||
|
if (d.size() < batchFlushSize || !p->m_writeBuffer.isEmpty()) {
|
||||||
|
p->m_writeBuffer.append(d);
|
||||||
|
p->m_delayWriteTimer.start();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to write the data ...
|
||||||
|
qint64 result = p->m_writeToPty(d);
|
||||||
|
|
||||||
|
if (result != d.size()) {
|
||||||
|
// if writing failed, append the data to the writeBuffer and start the delay timer
|
||||||
|
|
||||||
|
// Check if partial data may have already been written ...
|
||||||
|
if (result <= 0)
|
||||||
|
p->m_writeBuffer.append(d);
|
||||||
|
else
|
||||||
|
p->m_writeBuffer.append(d.mid(result));
|
||||||
|
|
||||||
|
p->m_delayWriteTimer.start();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
vterm_output_set_callback(m_vterm.get(), writeToPty, this);
|
vterm_output_set_callback(m_vterm.get(), writeToPty, this);
|
||||||
@@ -313,6 +367,10 @@ struct TerminalSurfacePrivate
|
|||||||
ShellIntegration *m_shellIntegration{nullptr};
|
ShellIntegration *m_shellIntegration{nullptr};
|
||||||
|
|
||||||
TerminalSurface *q;
|
TerminalSurface *q;
|
||||||
|
QTimer m_delayWriteTimer;
|
||||||
|
QByteArray m_writeBuffer;
|
||||||
|
|
||||||
|
TerminalSurface::WriteToPty m_writeToPty;
|
||||||
};
|
};
|
||||||
|
|
||||||
TerminalSurface::TerminalSurface(QSize initialGridSize, ShellIntegration *shellIntegration)
|
TerminalSurface::TerminalSurface(QSize initialGridSize, ShellIntegration *shellIntegration)
|
||||||
@@ -385,7 +443,7 @@ void TerminalSurface::clearAll()
|
|||||||
vterm_input_write(d->m_vterm.get(), data.constData(), data.size());
|
vterm_input_write(d->m_vterm.get(), data.constData(), data.size());
|
||||||
|
|
||||||
// Send Ctrl+L which will clear the screen
|
// Send Ctrl+L which will clear the screen
|
||||||
emit writeToPty(QByteArray("\f"));
|
d->m_writeToPty(QByteArray("\f"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalSurface::resize(QSize newSize)
|
void TerminalSurface::resize(QSize newSize)
|
||||||
@@ -419,8 +477,14 @@ void TerminalSurface::pasteFromClipboard(const QString &clipboardText)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
vterm_keyboard_start_paste(d->m_vterm.get());
|
vterm_keyboard_start_paste(d->m_vterm.get());
|
||||||
for (unsigned int ch : clipboardText.toUcs4())
|
for (unsigned int ch : clipboardText.toUcs4()) {
|
||||||
|
// Workaround for weird nano behavior to correctly paste newlines
|
||||||
|
// see: http://savannah.gnu.org/bugs/?49176
|
||||||
|
// and: https://github.com/kovidgoyal/kitty/issues/994
|
||||||
|
if (ch == '\n')
|
||||||
|
ch = '\r';
|
||||||
vterm_keyboard_unichar(d->m_vterm.get(), ch, VTERM_MOD_NONE);
|
vterm_keyboard_unichar(d->m_vterm.get(), ch, VTERM_MOD_NONE);
|
||||||
|
}
|
||||||
vterm_keyboard_end_paste(d->m_vterm.get());
|
vterm_keyboard_end_paste(d->m_vterm.get());
|
||||||
|
|
||||||
if (!d->m_altscreen) {
|
if (!d->m_altscreen) {
|
||||||
@@ -487,6 +551,11 @@ ShellIntegration *TerminalSurface::shellIntegration() const
|
|||||||
return d->m_shellIntegration;
|
return d->m_shellIntegration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TerminalSurface::setWriteToPty(WriteToPty writeToPty)
|
||||||
|
{
|
||||||
|
d->m_writeToPty = writeToPty;
|
||||||
|
}
|
||||||
|
|
||||||
CellIterator TerminalSurface::begin() const
|
CellIterator TerminalSurface::begin() const
|
||||||
{
|
{
|
||||||
auto res = CellIterator(this, {0, 0});
|
auto res = CellIterator(this, {0, 0});
|
||||||
|
|||||||
@@ -95,8 +95,9 @@ public:
|
|||||||
|
|
||||||
ShellIntegration *shellIntegration() const;
|
ShellIntegration *shellIntegration() const;
|
||||||
|
|
||||||
|
using WriteToPty = std::function<qint64(const QByteArray &)>;
|
||||||
|
void setWriteToPty(WriteToPty writeToPty);
|
||||||
signals:
|
signals:
|
||||||
void writeToPty(const QByteArray &data);
|
|
||||||
void invalidated(QRect grid);
|
void invalidated(QRect grid);
|
||||||
void fullSizeChanged(QSize newSize);
|
void fullSizeChanged(QSize newSize);
|
||||||
void cursorChanged(Cursor oldCursor, Cursor newCursor);
|
void cursorChanged(Cursor oldCursor, Cursor newCursor);
|
||||||
|
|||||||
@@ -327,10 +327,12 @@ void TerminalWidget::closeTerminal()
|
|||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalWidget::writeToPty(const QByteArray &data)
|
qint64 TerminalWidget::writeToPty(const QByteArray &data)
|
||||||
{
|
{
|
||||||
if (m_process && m_process->isRunning())
|
if (m_process && m_process->isRunning())
|
||||||
m_process->writeRaw(data);
|
return m_process->writeRaw(data);
|
||||||
|
|
||||||
|
return data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalWidget::setupSurface()
|
void TerminalWidget::setupSurface()
|
||||||
@@ -351,10 +353,8 @@ void TerminalWidget::setupSurface()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_surface.get(),
|
m_surface->setWriteToPty([this](const QByteArray &data) { return writeToPty(data); });
|
||||||
&Internal::TerminalSurface::writeToPty,
|
|
||||||
this,
|
|
||||||
&TerminalWidget::writeToPty);
|
|
||||||
connect(m_surface.get(), &Internal::TerminalSurface::fullSizeChanged, this, [this] {
|
connect(m_surface.get(), &Internal::TerminalSurface::fullSizeChanged, this, [this] {
|
||||||
updateScrollBars();
|
updateScrollBars();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ protected:
|
|||||||
void setupColors();
|
void setupColors();
|
||||||
void setupActions();
|
void setupActions();
|
||||||
|
|
||||||
void writeToPty(const QByteArray &data);
|
qint64 writeToPty(const QByteArray &data);
|
||||||
|
|
||||||
int paintCell(QPainter &p,
|
int paintCell(QPainter &p,
|
||||||
const QRectF &cellRect,
|
const QRectF &cellRect,
|
||||||
|
|||||||
@@ -837,7 +837,7 @@ bool TextDocument::reload(QString *errorString, const FilePath &realFilePath)
|
|||||||
auto documentLayout =
|
auto documentLayout =
|
||||||
qobject_cast<TextDocumentLayout*>(d->m_document.documentLayout());
|
qobject_cast<TextDocumentLayout*>(d->m_document.documentLayout());
|
||||||
if (documentLayout)
|
if (documentLayout)
|
||||||
documentLayout->documentAboutToReload(); // removes text marks non-permanently
|
documentLayout->documentAboutToReload(this); // removes text marks non-permanently
|
||||||
|
|
||||||
bool success = openImpl(errorString, filePath(), realFilePath, /*reload =*/true)
|
bool success = openImpl(errorString, filePath(), realFilePath, /*reload =*/true)
|
||||||
== OpenResult::Success;
|
== OpenResult::Success;
|
||||||
|
|||||||
@@ -4,9 +4,16 @@
|
|||||||
#include "textdocumentlayout.h"
|
#include "textdocumentlayout.h"
|
||||||
#include "fontsettings.h"
|
#include "fontsettings.h"
|
||||||
#include "textdocument.h"
|
#include "textdocument.h"
|
||||||
|
#include "texteditorplugin.h"
|
||||||
#include "texteditorsettings.h"
|
#include "texteditorsettings.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#ifdef WITH_TESTS
|
||||||
|
#include <QTest>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
|
|
||||||
@@ -667,11 +674,15 @@ TextMarks TextDocumentLayout::documentClosing()
|
|||||||
return marks;
|
return marks;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextDocumentLayout::documentAboutToReload()
|
void TextDocumentLayout::documentAboutToReload(TextDocument *baseTextDocument)
|
||||||
{
|
{
|
||||||
m_reloadMarks = documentClosing();
|
m_reloadMarks = documentClosing();
|
||||||
for (TextMark *mark : std::as_const(m_reloadMarks))
|
for (TextMark *mark : std::as_const(m_reloadMarks)) {
|
||||||
mark->setDeleteCallback([this, mark] { m_reloadMarks.removeOne(mark); });
|
mark->setDeleteCallback([this, mark, baseTextDocument] {
|
||||||
|
baseTextDocument->removeMarkFromMarksCache(mark);
|
||||||
|
m_reloadMarks.removeOne(mark);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
|
void TextDocumentLayout::documentReloaded(TextDocument *baseTextDocument)
|
||||||
@@ -860,4 +871,23 @@ TextSuggestion::TextSuggestion()
|
|||||||
|
|
||||||
TextSuggestion::~TextSuggestion() = default;
|
TextSuggestion::~TextSuggestion() = default;
|
||||||
|
|
||||||
|
#ifdef WITH_TESTS
|
||||||
|
|
||||||
|
void Internal::TextEditorPlugin::testDeletingMarkOnReload()
|
||||||
|
{
|
||||||
|
auto doc = new TextDocument();
|
||||||
|
doc->setFilePath(Utils::TemporaryDirectory::masterDirectoryFilePath() / "TestMarkDoc.txt");
|
||||||
|
doc->setPlainText("asd");
|
||||||
|
auto documentLayout = qobject_cast<TextDocumentLayout *>(doc->document()->documentLayout());
|
||||||
|
QVERIFY(documentLayout);
|
||||||
|
auto mark = new TextMark(doc, 1, TextMarkCategory{"testMark","testMark"});
|
||||||
|
QVERIFY(doc->marks().contains(mark));
|
||||||
|
documentLayout->documentAboutToReload(doc); // removes text marks non-permanently
|
||||||
|
delete mark;
|
||||||
|
documentLayout->documentReloaded(doc); // re-adds text marks
|
||||||
|
QVERIFY(!doc->marks().contains(mark));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace TextEditor
|
} // namespace TextEditor
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ public:
|
|||||||
QRectF blockBoundingRect(const QTextBlock &block) const override;
|
QRectF blockBoundingRect(const QTextBlock &block) const override;
|
||||||
|
|
||||||
TextMarks documentClosing();
|
TextMarks documentClosing();
|
||||||
void documentAboutToReload();
|
void documentAboutToReload(TextDocument *baseTextDocument);
|
||||||
void documentReloaded(TextDocument *baseextDocument);
|
void documentReloaded(TextDocument *baseextDocument);
|
||||||
void updateMarksLineNumber();
|
void updateMarksLineNumber();
|
||||||
void updateMarksBlock(const QTextBlock &block);
|
void updateMarksBlock(const QTextBlock &block);
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ private slots:
|
|||||||
|
|
||||||
void testFormatting_data();
|
void testFormatting_data();
|
||||||
void testFormatting();
|
void testFormatting();
|
||||||
|
|
||||||
|
void testDeletingMarkOnReload();
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Submodule src/shared/qbs updated: d75d1e8f1a...d8c97a5f0b
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
#include <sys/ptrace.h>
|
#include <sys/ptrace.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -221,7 +222,23 @@ void onInferiorStarted()
|
|||||||
if (!debugMode)
|
if (!debugMode)
|
||||||
sendPid(inferiorId);
|
sendPid(inferiorId);
|
||||||
#else
|
#else
|
||||||
|
qCInfo(log) << "Detaching ...";
|
||||||
ptrace(PTRACE_DETACH, inferiorId, 0, SIGSTOP);
|
ptrace(PTRACE_DETACH, inferiorId, 0, SIGSTOP);
|
||||||
|
|
||||||
|
// Wait until the process actually finished detaching
|
||||||
|
int status = 0;
|
||||||
|
waitpid(inferiorId, &status, WUNTRACED);
|
||||||
|
if (log().isInfoEnabled()) {
|
||||||
|
if (WIFEXITED(status))
|
||||||
|
qCInfo(log) << "inferior exited, status=" << WEXITSTATUS(status);
|
||||||
|
else if (WIFSIGNALED(status))
|
||||||
|
qCInfo(log) << "inferior killed by signal" << WTERMSIG(status);
|
||||||
|
else if (WIFSTOPPED(status))
|
||||||
|
qCInfo(log) << "inferior stopped by signal" << WSTOPSIG(status);
|
||||||
|
else if (WIFCONTINUED(status))
|
||||||
|
qCInfo(log) << "inferior continued";
|
||||||
|
}
|
||||||
|
|
||||||
sendPid(inferiorId);
|
sendPid(inferiorId);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,6 +252,15 @@ void AddQtOperation::unittest()
|
|||||||
QCOMPARE(version1.value(QLatin1String(QMAKE)).toString(), QLatin1String("/tmp/test/qmake2"));
|
QCOMPARE(version1.value(QLatin1String(QMAKE)).toString(), QLatin1String("/tmp/test/qmake2"));
|
||||||
QVERIFY(version1.contains(QLatin1String("extraData")));
|
QVERIFY(version1.contains(QLatin1String("extraData")));
|
||||||
QCOMPARE(version1.value(QLatin1String("extraData")).toString(), QLatin1String("extraValue"));
|
QCOMPARE(version1.value(QLatin1String("extraData")).toString(), QLatin1String("extraValue"));
|
||||||
|
|
||||||
|
// Docker paths
|
||||||
|
qtData.m_id = "testId3";
|
||||||
|
qtData.m_qmake = "docker://image///path/to//some/qmake";
|
||||||
|
|
||||||
|
map = qtData.addQt(map);
|
||||||
|
QVariantMap version2 = map.value(QLatin1String("QtVersion.2")).toMap();
|
||||||
|
QVERIFY(version2.contains(QLatin1String(QMAKE)));
|
||||||
|
QCOMPARE(version2.value(QLatin1String(QMAKE)).toString(), QLatin1String("docker://image/path/to/some/qmake"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -279,7 +288,7 @@ QVariantMap AddQtData::addQt(const QVariantMap &map) const
|
|||||||
const QString qt = QString::fromLatin1(PREFIX) + QString::number(versionCount);
|
const QString qt = QString::fromLatin1(PREFIX) + QString::number(versionCount);
|
||||||
|
|
||||||
// Sanitize qmake path:
|
// Sanitize qmake path:
|
||||||
QString saneQmake = QDir::cleanPath(m_qmake);
|
const QString saneQmake = cleanPath(m_qmake);
|
||||||
|
|
||||||
// insert data:
|
// insert data:
|
||||||
KeyValuePairList data;
|
KeyValuePairList data;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ bool Operation::save(const QVariantMap &map, const QString &file) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString dirName = QDir::cleanPath(path + "/..");
|
QString dirName = cleanPath(path + "/..");
|
||||||
QDir dir(dirName);
|
QDir dir(dirName);
|
||||||
if (!dir.exists() && !dir.mkpath(QLatin1String("."))) {
|
if (!dir.exists() && !dir.mkpath(QLatin1String("."))) {
|
||||||
std::cerr << "Error: Could not create directory " << qPrintable(dirName)
|
std::cerr << "Error: Could not create directory " << qPrintable(dirName)
|
||||||
@@ -108,3 +108,12 @@ bool Operation::save(const QVariantMap &map, const QString &file) const
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString cleanPath(const QString &orig)
|
||||||
|
{
|
||||||
|
// QDir::cleanPath() destroys "//", one of which might be needed.
|
||||||
|
const int pos = orig.indexOf("://");
|
||||||
|
if (pos == -1)
|
||||||
|
return QDir::cleanPath(orig);
|
||||||
|
return orig.left(pos) + "://" + QDir::cleanPath(orig.mid(pos + 3));
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ using KeyValuePairList = QList<KeyValuePair>;
|
|||||||
|
|
||||||
QVariant valueFromString(const QString &v);
|
QVariant valueFromString(const QString &v);
|
||||||
|
|
||||||
|
QString cleanPath(const QString &orig);
|
||||||
|
|
||||||
class Operation
|
class Operation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include "sdkpersistentsettings.h"
|
#include "sdkpersistentsettings.h"
|
||||||
|
|
||||||
|
#include "operation.h" // for cleanPath()
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -826,7 +828,7 @@ void SdkPersistentSettingsWriter::setContents(const QVariantMap &data)
|
|||||||
|
|
||||||
bool SdkPersistentSettingsWriter::write(const QVariantMap &data, QString *errorString) const
|
bool SdkPersistentSettingsWriter::write(const QVariantMap &data, QString *errorString) const
|
||||||
{
|
{
|
||||||
const QString parentDir = QDir::cleanPath(m_fileName + "/..");
|
const QString parentDir = cleanPath(m_fileName + "/..");
|
||||||
|
|
||||||
const QFileInfo fi(parentDir);
|
const QFileInfo fi(parentDir);
|
||||||
if (!(fi.exists() && fi.isDir() && fi.isWritable())) {
|
if (!(fi.exists() && fi.isDir() && fi.isWritable())) {
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ private slots:
|
|||||||
void sort();
|
void sort();
|
||||||
void sort_data();
|
void sort_data();
|
||||||
|
|
||||||
|
void isRootPath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTemporaryDir tempDir;
|
QTemporaryDir tempDir;
|
||||||
QString rootPath;
|
QString rootPath;
|
||||||
@@ -1308,6 +1310,14 @@ void tst_filepath::startsWithDriveLetter_data()
|
|||||||
QTest::newRow("simple-win") << FilePath::fromString("c:/a") << true;
|
QTest::newRow("simple-win") << FilePath::fromString("c:/a") << true;
|
||||||
QTest::newRow("simple-linux") << FilePath::fromString("/c:/a") << false;
|
QTest::newRow("simple-linux") << FilePath::fromString("/c:/a") << false;
|
||||||
QTest::newRow("relative") << FilePath("a/b") << false;
|
QTest::newRow("relative") << FilePath("a/b") << false;
|
||||||
|
|
||||||
|
QTest::newRow("remote-slash") << FilePath::fromString("docker://1234/") << false;
|
||||||
|
QTest::newRow("remote-single-letter") << FilePath::fromString("docker://1234/c") << false;
|
||||||
|
QTest::newRow("remote-drive") << FilePath::fromString("docker://1234/c:") << true;
|
||||||
|
QTest::newRow("remote-invalid-drive") << FilePath::fromString("docker://1234/c:a") << true;
|
||||||
|
QTest::newRow("remote-with-path") << FilePath::fromString("docker://1234/c:/a") << true;
|
||||||
|
QTest::newRow("remote-z") << FilePath::fromString("docker://1234/z:") << true;
|
||||||
|
QTest::newRow("remote-1") << FilePath::fromString("docker://1234/1:") << false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_filepath::startsWithDriveLetter()
|
void tst_filepath::startsWithDriveLetter()
|
||||||
@@ -1656,6 +1666,31 @@ void tst_filepath::sort()
|
|||||||
QCOMPARE(sortedPaths, sorted);
|
QCOMPARE(sortedPaths, sorted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_filepath::isRootPath()
|
||||||
|
{
|
||||||
|
FilePath localRoot = FilePath::fromString(QDir::rootPath());
|
||||||
|
QVERIFY(localRoot.isRootPath());
|
||||||
|
|
||||||
|
FilePath localNonRoot = FilePath::fromString(QDir::rootPath() + "x");
|
||||||
|
QVERIFY(!localNonRoot.isRootPath());
|
||||||
|
|
||||||
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
|
FilePath remoteWindowsRoot = FilePath::fromString("device://test/c:/");
|
||||||
|
QVERIFY(remoteWindowsRoot.isRootPath());
|
||||||
|
|
||||||
|
FilePath remoteWindowsRoot1 = FilePath::fromString("device://test/c:");
|
||||||
|
QVERIFY(remoteWindowsRoot1.isRootPath());
|
||||||
|
|
||||||
|
FilePath remoteWindowsNotRoot = FilePath::fromString("device://test/c:/x");
|
||||||
|
QVERIFY(!remoteWindowsNotRoot.isRootPath());
|
||||||
|
} else {
|
||||||
|
FilePath remoteRoot = FilePath::fromString("device://test/");
|
||||||
|
QVERIFY(remoteRoot.isRootPath());
|
||||||
|
|
||||||
|
FilePath remotePath = FilePath::fromString("device://test/x");
|
||||||
|
QVERIFY(!remotePath.isRootPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
void tst_filepath::sort_data()
|
void tst_filepath::sort_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QStringList>("input");
|
QTest::addColumn<QStringList>("input");
|
||||||
|
|||||||
33
tests/system/0001-Fix-build-on-macOS.patch
Normal file
33
tests/system/0001-Fix-build-on-macOS.patch
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
From e5aec585120ca65b92e642b50b1552f75df26b93 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christian Stenger <christian.stenger@qt.io>
|
||||||
|
Date: Thu, 27 Jul 2023 08:49:30 +0200
|
||||||
|
Subject: [PATCH] Fix build on macOS
|
||||||
|
|
||||||
|
---
|
||||||
|
src/CMakeLists.txt | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||||
|
index 7be6aad..0cad721 100644
|
||||||
|
--- a/src/CMakeLists.txt
|
||||||
|
+++ b/src/CMakeLists.txt
|
||||||
|
@@ -18,7 +18,6 @@ if(APPLE)
|
||||||
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${speedcrunch_VERSION})
|
||||||
|
set(MACOSX_BUNDLE_VERSION ${speedcrunch_VERSION})
|
||||||
|
set(MACOSX_BUNDLE_LONG_VERSION_STRING Version ${speedcrunch_VERSION})
|
||||||
|
- set(CMAKE_OSX_ARCHITECTURES ppc;i386)
|
||||||
|
else(APPLE)
|
||||||
|
set(PROGNAME speedcrunch)
|
||||||
|
endif(APPLE)
|
||||||
|
@@ -71,7 +70,7 @@ if(APPLE)
|
||||||
|
set( speedcrunch_RESOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PROGNAME}.app/Contents/Resources )
|
||||||
|
add_custom_command(TARGET ${PROGNAME} POST_BUILD
|
||||||
|
COMMAND mkdir ARGS -p ${speedcrunch_RESOURCE_DIR}
|
||||||
|
- COMMAND cp ARGS -f resources/${MACOSX_BUNDLE_ICON_FILE} ${speedcrunch_RESOURCE_DIR})
|
||||||
|
+ COMMAND cp ARGS -f ${CMAKE_CURRENT_SOURCE_DIR}/resources/${MACOSX_BUNDLE_ICON_FILE} ${speedcrunch_RESOURCE_DIR})
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
|
add_custom_target(confclean COMMAND rm -rf Makefile CMakeFiles/ CMakeCache.txt cmake_install.cmake DartTestfile.txt install_manifest.txt)
|
||||||
|
--
|
||||||
|
2.32.0 (Apple Git-132)
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ def __logDebugResult__():
|
|||||||
|
|
||||||
def verifyBreakPoint(bpToVerify):
|
def verifyBreakPoint(bpToVerify):
|
||||||
if isinstance(bpToVerify, dict):
|
if isinstance(bpToVerify, dict):
|
||||||
fileName = list(bpToVerify.keys())[0]
|
fileName = next(iter(bpToVerify.keys()))
|
||||||
editor = getEditorForFileSuffix(fileName)
|
editor = getEditorForFileSuffix(fileName)
|
||||||
if editor:
|
if editor:
|
||||||
test.compare(waitForObject(":DebugModeWidget_QComboBox").toolTip, fileName,
|
test.compare(waitForObject(":DebugModeWidget_QComboBox").toolTip, fileName,
|
||||||
@@ -247,7 +247,7 @@ def verifyBreakPoint(bpToVerify):
|
|||||||
windowTitle = str(waitForObject(":Qt Creator_Core::Internal::MainWindow").windowTitle)
|
windowTitle = str(waitForObject(":Qt Creator_Core::Internal::MainWindow").windowTitle)
|
||||||
test.verify(windowTitle.startswith(os.path.basename(fileName) + " "),
|
test.verify(windowTitle.startswith(os.path.basename(fileName) + " "),
|
||||||
"Verify that Creator's window title changed according to current file")
|
"Verify that Creator's window title changed according to current file")
|
||||||
return test.compare(line, list(bpToVerify.values())[0],
|
return test.compare(line, next(iter(bpToVerify.values())),
|
||||||
"Compare hit breakpoint to expected line number in %s" % fileName)
|
"Compare hit breakpoint to expected line number in %s" % fileName)
|
||||||
else:
|
else:
|
||||||
test.fatal("Expected a dict for bpToVerify - got '%s'" % className(bpToVerify))
|
test.fatal("Expected a dict for bpToVerify - got '%s'" % className(bpToVerify))
|
||||||
|
|||||||
@@ -248,11 +248,16 @@ def createProject_Qt_GUI(path, projectName, checks=True, addToVersionControl="<N
|
|||||||
# param path specifies where to create the project
|
# param path specifies where to create the project
|
||||||
# param projectName is the name for the new project
|
# param projectName is the name for the new project
|
||||||
# param checks turns tests in the function on if set to True
|
# param checks turns tests in the function on if set to True
|
||||||
def createProject_Qt_Console(path, projectName, checks = True, buildSystem = None):
|
def createProject_Qt_Console(path, projectName, checks = True, buildSystem = None, targets=[]):
|
||||||
available = __createProjectOrFileSelectType__(" Application (Qt)", "Qt Console Application")
|
available = __createProjectOrFileSelectType__(" Application (Qt)", "Qt Console Application")
|
||||||
__createProjectSetNameAndPath__(path, projectName, checks)
|
__createProjectSetNameAndPath__(path, projectName, checks)
|
||||||
buildSystem = __handleBuildSystem__(buildSystem)
|
buildSystem = __handleBuildSystem__(buildSystem)
|
||||||
__createProjectHandleTranslationSelection__()
|
__createProjectHandleTranslationSelection__()
|
||||||
|
if targets:
|
||||||
|
available = set(targets).intersection(available)
|
||||||
|
if len(available) < len(targets):
|
||||||
|
test.warning("Could not use all desired targets.",
|
||||||
|
"%s vs %s" % (str(available), str(targets)))
|
||||||
__selectQtVersionDesktop__(buildSystem, checks, available)
|
__selectQtVersionDesktop__(buildSystem, checks, available)
|
||||||
|
|
||||||
expectedFiles = []
|
expectedFiles = []
|
||||||
|
|||||||
@@ -206,7 +206,8 @@ def substituteCdb(settingsDir):
|
|||||||
try:
|
try:
|
||||||
serverIni = readFile(os.path.join(os.getenv("APPDATA"), "froglogic",
|
serverIni = readFile(os.path.join(os.getenv("APPDATA"), "froglogic",
|
||||||
"Squish", "ver1", "server.ini"))
|
"Squish", "ver1", "server.ini"))
|
||||||
autLine = list(filter(lambda line: "AUT/qtcreator" in line, serverIni.splitlines()))[0]
|
autLine = next(iter(filter(lambda line: "AUT/qtcreator" in line,
|
||||||
|
serverIni.splitlines())))
|
||||||
autPath = autLine.split("\"")[1]
|
autPath = autLine.split("\"")[1]
|
||||||
return os.path.exists(os.path.join(autPath, "..", "lib", "qtcreatorcdbext64"))
|
return os.path.exists(os.path.join(autPath, "..", "lib", "qtcreatorcdbext64"))
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -41,8 +41,9 @@ def main():
|
|||||||
listView = waitForObject(":popupFrame_Proposal_QListView")
|
listView = waitForObject(":popupFrame_Proposal_QListView")
|
||||||
shownProposals = dumpItems(listView.model())
|
shownProposals = dumpItems(listView.model())
|
||||||
usedProposal = "class derived from QObject"
|
usedProposal = "class derived from QObject"
|
||||||
expectedProposals = ["class", "class ", "class template",
|
expectedProposals = ["class ", "class template",
|
||||||
usedProposal, "class derived from QWidget"]
|
usedProposal, "class derived from QWidget"]
|
||||||
|
expectedProposals += [" class"] if useClang else ["class"]
|
||||||
test.xcompare(len(shownProposals), len(expectedProposals), # QTCREATORBUG-23159
|
test.xcompare(len(shownProposals), len(expectedProposals), # QTCREATORBUG-23159
|
||||||
"Number of proposed templates")
|
"Number of proposed templates")
|
||||||
test.verify(set(expectedProposals).issubset(set(shownProposals)),
|
test.verify(set(expectedProposals).issubset(set(shownProposals)),
|
||||||
@@ -58,12 +59,15 @@ def main():
|
|||||||
type(editorWidget, "<Tab>")
|
type(editorWidget, "<Tab>")
|
||||||
type(editorWidget, "Myname")
|
type(editorWidget, "Myname")
|
||||||
result = re.search(pattern.replace("name", "Myname"), str(editorWidget.plainText))
|
result = re.search(pattern.replace("name", "Myname"), str(editorWidget.plainText))
|
||||||
|
failMsg = ("Step 5: Seems that not all instances of variable had been renamed "
|
||||||
|
"- Content of editor:\n%s" % editorWidget.plainText)
|
||||||
if result:
|
if result:
|
||||||
test.passes("Step 5: Verifying if: A value for a variable is inserted and all "
|
test.passes("Step 5: Verifying if: A value for a variable is inserted and all "
|
||||||
"instances of the variable within the snippet are renamed.")
|
"instances of the variable within the snippet are renamed.")
|
||||||
|
elif JIRA.isBugStillOpen(29012):
|
||||||
|
test.xfail(failMsg)
|
||||||
else:
|
else:
|
||||||
test.fail("Step 5: Seems that not all instances of variable had been renamed "
|
test.fail(failMsg)
|
||||||
"- Content of editor:\n%s" % editorWidget.plainText)
|
|
||||||
invokeMenuItem('File', 'Revert "main.cpp" to Saved')
|
invokeMenuItem('File', 'Revert "main.cpp" to Saved')
|
||||||
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
|
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def checkQtCreatorHelpVersion(expectedVersion):
|
|||||||
helpContentWidget = waitForObject(':Qt Creator_QHelpContentWidget', 5000)
|
helpContentWidget = waitForObject(':Qt Creator_QHelpContentWidget', 5000)
|
||||||
waitFor("any(map(rightStart, dumpItems(helpContentWidget.model())))", 10000)
|
waitFor("any(map(rightStart, dumpItems(helpContentWidget.model())))", 10000)
|
||||||
items = dumpItems(helpContentWidget.model())
|
items = dumpItems(helpContentWidget.model())
|
||||||
test.compare(list(filter(rightStart, items))[0],
|
test.compare(next(iter(filter(rightStart, items))),
|
||||||
'Qt Creator Manual %s' % expectedVersion,
|
'Qt Creator Manual %s' % expectedVersion,
|
||||||
'Verifying whether manual uses expected version.')
|
'Verifying whether manual uses expected version.')
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ def main():
|
|||||||
startQC()
|
startQC()
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
createProject_Qt_Console(tempDir(), project)
|
targets = []
|
||||||
|
if platform.system() in ('Microsoft', 'Windows'):
|
||||||
|
# Qt5.10 has constructs that do not work on Win because of limitation to older C++
|
||||||
|
targets = [Targets.DESKTOP_5_14_1_DEFAULT, Targets.DESKTOP_6_2_4]
|
||||||
|
createProject_Qt_Console(tempDir(), project, targets=targets)
|
||||||
|
|
||||||
mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
replaceEditorContent(mainEditor, "")
|
replaceEditorContent(mainEditor, "")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ def cmakeSupported():
|
|||||||
versionLines = filter(lambda line: "cmake version " in line,
|
versionLines = filter(lambda line: "cmake version " in line,
|
||||||
getOutputFromCmdline(["cmake", "--version"]).splitlines())
|
getOutputFromCmdline(["cmake", "--version"]).splitlines())
|
||||||
try:
|
try:
|
||||||
versionLine = list(versionLines)[0]
|
versionLine = next(iter(versionLines))
|
||||||
test.log("Using " + versionLine)
|
test.log("Using " + versionLine)
|
||||||
matcher = re.match("cmake version (\d+)\.(\d+)\.\d+", versionLine)
|
matcher = re.match("cmake version (\d+)\.(\d+)\.\d+", versionLine)
|
||||||
major = __builtin__.int(matcher.group(1))
|
major = __builtin__.int(matcher.group(1))
|
||||||
@@ -32,6 +32,16 @@ def main():
|
|||||||
if not SpeedCrunchPath:
|
if not SpeedCrunchPath:
|
||||||
test.fatal("Could not clone SpeedCrunch")
|
test.fatal("Could not clone SpeedCrunch")
|
||||||
return
|
return
|
||||||
|
# patch CMakeLists.txt outside of QC
|
||||||
|
try:
|
||||||
|
patchFile = os.path.join(os.path.dirname(__file__),
|
||||||
|
"..", "..", "0001-Fix-build-on-macOS.patch")
|
||||||
|
subprocess.check_call(["git", "am", patchFile], cwd=SpeedCrunchPath)
|
||||||
|
test.log("Patched speedcrunch.")
|
||||||
|
except:
|
||||||
|
t, v = sys.exc_info()[:2]
|
||||||
|
test.warning("Patching speedcrunch failed.", "%s(%s)" % (str(t), str(v)))
|
||||||
|
|
||||||
startQC()
|
startQC()
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"text" "nestinglevel"
|
"text" "nestinglevel"
|
||||||
"CMakeLists.txt" "0"
|
"CMakeLists.txt" "0"
|
||||||
"speedcrunch" "0"
|
|
||||||
"Header Files" "1"
|
"Header Files" "1"
|
||||||
"genericdock.h" "2"
|
"genericdock.h" "2"
|
||||||
"Source Files" "1"
|
"Source Files" "1"
|
||||||
|
|||||||
|
@@ -49,8 +49,8 @@ def main():
|
|||||||
availableProjectTypes.append({category:template})
|
availableProjectTypes.append({category:template})
|
||||||
safeClickButton("Cancel")
|
safeClickButton("Cancel")
|
||||||
for current in availableProjectTypes:
|
for current in availableProjectTypes:
|
||||||
category = list(current.keys())[0]
|
category = next(iter(current.keys()))
|
||||||
template = list(current.values())[0]
|
template = next(iter(current.values()))
|
||||||
with TestSection("Testing project template %s -> %s" % (category, template)):
|
with TestSection("Testing project template %s -> %s" % (category, template)):
|
||||||
displayedPlatforms = __createProject__(category, template)
|
displayedPlatforms = __createProject__(category, template)
|
||||||
if template.startswith("Qt Quick Application"):
|
if template.startswith("Qt Quick Application"):
|
||||||
|
|||||||
@@ -311,15 +311,15 @@ def __compareCompilers__(foundCompilers, expectedCompilers):
|
|||||||
for currentExp in expectedCompilers:
|
for currentExp in expectedCompilers:
|
||||||
if isString(currentExp):
|
if isString(currentExp):
|
||||||
continue
|
continue
|
||||||
key = list(currentExp.keys())[0]
|
key = next(iter(currentExp.keys()))
|
||||||
# the regex .*? is used for the different possible version strings of the WinSDK
|
# the regex .*? is used for the different possible version strings of the WinSDK
|
||||||
# if it's present a regex will be validated otherwise simple string comparison
|
# if it's present a regex will be validated otherwise simple string comparison
|
||||||
# same applies for [.0-9]+ which is used for minor/patch versions
|
# same applies for [.0-9]+ which is used for minor/patch versions
|
||||||
isRegex = ".*?" in key or "[.0-9]+" in key
|
isRegex = ".*?" in key or "[.0-9]+" in key
|
||||||
if (((isRegex and re.match(key, list(currentFound.keys())[0], flags)))
|
if (((isRegex and re.match(key, next(iter(currentFound.keys())), flags)))
|
||||||
or currentFound.keys() == currentExp.keys()):
|
or currentFound.keys() == currentExp.keys()):
|
||||||
if ((isWin and os.path.abspath(list(currentFound.values())[0].lower())
|
if ((isWin and os.path.abspath(next(iter(currentFound.values())).lower())
|
||||||
== os.path.abspath(list(currentExp.values())[0].lower()))
|
== os.path.abspath(next(iter(currentExp.values())).lower()))
|
||||||
or currentFound.values() == currentExp.values()):
|
or currentFound.values() == currentExp.values()):
|
||||||
foundExp = True
|
foundExp = True
|
||||||
break
|
break
|
||||||
@@ -359,24 +359,22 @@ def __lowerStrs__(iterable):
|
|||||||
def __checkCreatedSettings__(settingsFolder):
|
def __checkCreatedSettings__(settingsFolder):
|
||||||
waitForCleanShutdown()
|
waitForCleanShutdown()
|
||||||
qtProj = os.path.join(settingsFolder, "QtProject")
|
qtProj = os.path.join(settingsFolder, "QtProject")
|
||||||
folders = []
|
creatorFolder = os.path.join(qtProj, "qtcreator")
|
||||||
files = [{os.path.join(qtProj, "QtCreator.db"):0},
|
folders = [creatorFolder,
|
||||||
{os.path.join(qtProj, "QtCreator.ini"):30}]
|
os.path.join(creatorFolder, "generic-highlighter"),
|
||||||
folders.append(os.path.join(qtProj, "qtcreator"))
|
os.path.join(creatorFolder, "macros")]
|
||||||
files.extend([{os.path.join(folders[0], "debuggers.xml"):0},
|
files = {os.path.join(qtProj, "QtCreator.db"):0,
|
||||||
{os.path.join(folders[0], "devices.xml"):0},
|
os.path.join(qtProj, "QtCreator.ini"):30,
|
||||||
{os.path.join(folders[0], "helpcollection.qhc"):0},
|
os.path.join(creatorFolder, "debuggers.xml"):0,
|
||||||
{os.path.join(folders[0], "profiles.xml"):0},
|
os.path.join(creatorFolder, "devices.xml"):0,
|
||||||
{os.path.join(folders[0], "qtversion.xml"):0},
|
os.path.join(creatorFolder, "helpcollection.qhc"):0,
|
||||||
{os.path.join(folders[0], "toolchains.xml"):0}])
|
os.path.join(creatorFolder, "profiles.xml"):0,
|
||||||
folders.extend([os.path.join(folders[0], "generic-highlighter"),
|
os.path.join(creatorFolder, "qtversion.xml"):0,
|
||||||
os.path.join(folders[0], "macros")])
|
os.path.join(creatorFolder, "toolchains.xml"):0}
|
||||||
for f in folders:
|
for f in folders:
|
||||||
test.verify(os.path.isdir(f),
|
test.verify(os.path.isdir(f),
|
||||||
"Verifying whether folder '%s' has been created." % os.path.basename(f))
|
"Verifying whether folder '%s' has been created." % os.path.basename(f))
|
||||||
for f in files:
|
for fName, fMinSize in files.items():
|
||||||
fName = list(f.keys())[0]
|
|
||||||
fMinSize = list(f.values())[0]
|
|
||||||
text = "created non-empty"
|
text = "created non-empty"
|
||||||
if fMinSize > 0:
|
if fMinSize > 0:
|
||||||
text = "modified"
|
text = "modified"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ def main():
|
|||||||
if not neededFilePresent(pathCreator):
|
if not neededFilePresent(pathCreator):
|
||||||
return
|
return
|
||||||
|
|
||||||
startQC()
|
startQC(["-noload", "ClangCodeModel"])
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
openQbsProject(pathCreator)
|
openQbsProject(pathCreator)
|
||||||
@@ -24,7 +24,7 @@ def main():
|
|||||||
else:
|
else:
|
||||||
test.warning("Parsing project timed out")
|
test.warning("Parsing project timed out")
|
||||||
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
|
compareProjectTree(rootNodeTemplate % "Qt Creator", "projecttree_creator.tsv")
|
||||||
buildIssuesTexts = map(lambda i: str(i[0]), getBuildIssues())
|
buildIssuesTexts = map(lambda i: str(i[0]), getBuildIssues(False))
|
||||||
deprecationWarnings = "\n".join(set(filter(lambda s: "deprecated" in s, buildIssuesTexts)))
|
deprecationWarnings = "\n".join(set(filter(lambda s: "deprecated" in s, buildIssuesTexts)))
|
||||||
if deprecationWarnings:
|
if deprecationWarnings:
|
||||||
test.warning("Creator claims that the .qbs file uses deprecated features.",
|
test.warning("Creator claims that the .qbs file uses deprecated features.",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ def main():
|
|||||||
if not pathSpeedcrunch:
|
if not pathSpeedcrunch:
|
||||||
test.fatal("Could not clone SpeedCrunch")
|
test.fatal("Could not clone SpeedCrunch")
|
||||||
return
|
return
|
||||||
startQC()
|
startQC(["-noload", "ClangCodeModel"])
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -4166,7 +4166,6 @@
|
|||||||
"Headers" "5"
|
"Headers" "5"
|
||||||
"touchbar.h" "6"
|
"touchbar.h" "6"
|
||||||
"Sources" "5"
|
"Sources" "5"
|
||||||
"touchbar.cpp" "6"
|
|
||||||
"Headers" "4"
|
"Headers" "4"
|
||||||
"optional" "6"
|
"optional" "6"
|
||||||
"optional.hpp" "7"
|
"optional.hpp" "7"
|
||||||
@@ -16895,21 +16894,6 @@
|
|||||||
"qtc-askpass-main.cpp" "4"
|
"qtc-askpass-main.cpp" "4"
|
||||||
"Other files" "3"
|
"Other files" "3"
|
||||||
"qtc-askpass.qbs" "4"
|
"qtc-askpass.qbs" "4"
|
||||||
"qtcreatortool" "3"
|
|
||||||
"qtcreatortool.pri" "4"
|
|
||||||
"qtcreator" "4"
|
|
||||||
"qtcreator.pri" "5"
|
|
||||||
"qtcreator_ide_branding" "5"
|
|
||||||
"qtcreator_ide_branding.pri" "6"
|
|
||||||
"qtcreator_testvars" "5"
|
|
||||||
"qtcreator_testvars.pri" "6"
|
|
||||||
"Other files" "5"
|
|
||||||
"CMakeLists.txt" "7"
|
|
||||||
"rpath" "4"
|
|
||||||
"rpath.pri" "5"
|
|
||||||
"Sources" "3"
|
|
||||||
"main.cpp" "4"
|
|
||||||
"Other files" "3"
|
|
||||||
"qtpromaker" "2"
|
"qtpromaker" "2"
|
||||||
"qtpromaker.pro" "3"
|
"qtpromaker.pro" "3"
|
||||||
"qtcreatortool" "3"
|
"qtcreatortool" "3"
|
||||||
@@ -20837,7 +20821,6 @@
|
|||||||
"Headers" "5"
|
"Headers" "5"
|
||||||
"touchbar.h" "6"
|
"touchbar.h" "6"
|
||||||
"Sources" "5"
|
"Sources" "5"
|
||||||
"touchbar.cpp" "6"
|
|
||||||
"Headers" "4"
|
"Headers" "4"
|
||||||
"optional" "6"
|
"optional" "6"
|
||||||
"optional.hpp" "7"
|
"optional.hpp" "7"
|
||||||
@@ -21758,7 +21741,6 @@
|
|||||||
"Headers" "6"
|
"Headers" "6"
|
||||||
"touchbar.h" "7"
|
"touchbar.h" "7"
|
||||||
"Sources" "6"
|
"Sources" "6"
|
||||||
"touchbar.cpp" "7"
|
|
||||||
"Headers" "5"
|
"Headers" "5"
|
||||||
"optional" "7"
|
"optional" "7"
|
||||||
"optional.hpp" "8"
|
"optional.hpp" "8"
|
||||||
|
|||||||
|
Can't render this file because it is too large.
|
@@ -86,12 +86,12 @@ def __clickCommit__(count):
|
|||||||
show = str(description.plainText)
|
show = str(description.plainText)
|
||||||
id = "Nobody <nobody@nowhere\.com>"
|
id = "Nobody <nobody@nowhere\.com>"
|
||||||
time = "\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2} \d{4}.* seconds ago\)"
|
time = "\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2} \d{4}.* seconds ago\)"
|
||||||
expected = [{"commit %s" % commit:False},
|
expected = [["commit %s" % commit, False],
|
||||||
{"Author: %s, %s" % (id, time): True},
|
["Author: %s, %s" % (id, time), True],
|
||||||
{"Committer: %s, %s" % (id, time): True}]
|
["Committer: %s, %s" % (id, time), True]]
|
||||||
for line, exp in zip(show.splitlines(), expected):
|
for line, exp in zip(show.splitlines(), expected):
|
||||||
expLine = list(exp.keys())[0]
|
expLine = exp[0]
|
||||||
isRegex = list(exp.values())[0]
|
isRegex = exp[1]
|
||||||
if isRegex:
|
if isRegex:
|
||||||
test.verify(re.match(expLine, line), "Verifying commit header line '%s'" % line)
|
test.verify(re.match(expLine, line), "Verifying commit header line '%s'" % line)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user