forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/4.14'"
This commit is contained in:
@@ -895,13 +895,15 @@ void AndroidBuildApkStep::setBuildTargetSdk(const QString &sdk)
|
||||
void AndroidBuildApkStep::stdError(const QString &output)
|
||||
{
|
||||
AbstractProcessStep::stdError(output);
|
||||
if (output == "\n")
|
||||
return;
|
||||
|
||||
if (output.startsWith("warning", Qt::CaseInsensitive) || output.startsWith("note", Qt::CaseInsensitive))
|
||||
TaskHub::addTask(BuildSystemTask(Task::Warning, output));
|
||||
QString newOutput = output;
|
||||
newOutput.remove(QRegularExpression("^(\\n)+"));
|
||||
|
||||
if (newOutput.startsWith("warning", Qt::CaseInsensitive)
|
||||
|| newOutput.startsWith("note", Qt::CaseInsensitive))
|
||||
TaskHub::addTask(BuildSystemTask(Task::Warning, newOutput));
|
||||
else
|
||||
TaskHub::addTask(BuildSystemTask(Task::Error, output));
|
||||
TaskHub::addTask(BuildSystemTask(Task::Error, newOutput));
|
||||
}
|
||||
|
||||
QVariant AndroidBuildApkStep::data(Utils::Id id) const
|
||||
|
||||
@@ -552,13 +552,15 @@ void AndroidDeployQtStep::processReadyReadStdError(DeployErrorCode &errorCode)
|
||||
void AndroidDeployQtStep::stdError(const QString &line)
|
||||
{
|
||||
emit addOutput(line, BuildStep::OutputFormat::Stderr, BuildStep::DontAppendNewline);
|
||||
if (line == "\n")
|
||||
return;
|
||||
|
||||
if (line.startsWith("warning", Qt::CaseInsensitive) || line.startsWith("note", Qt::CaseInsensitive))
|
||||
TaskHub::addTask(DeploymentTask(Task::Warning, line));
|
||||
QString newOutput = line;
|
||||
newOutput.remove(QRegularExpression("^(\\n)+"));
|
||||
|
||||
if (newOutput.startsWith("warning", Qt::CaseInsensitive)
|
||||
|| newOutput.startsWith("note", Qt::CaseInsensitive))
|
||||
TaskHub::addTask(DeploymentTask(Task::Warning, newOutput));
|
||||
else
|
||||
TaskHub::addTask(DeploymentTask(Task::Error, line));
|
||||
TaskHub::addTask(DeploymentTask(Task::Error, newOutput));
|
||||
}
|
||||
|
||||
AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::parseDeployErrors(QString &deployOutputLine) const
|
||||
|
||||
@@ -855,8 +855,6 @@ void AndroidManifestEditorWidget::syncToWidgets(const QDomDocument &doc)
|
||||
setApiLevel(m_androidTargetSdkVersion, usesSdkElement, QLatin1String("android:targetSdkVersion"));
|
||||
}
|
||||
|
||||
QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
|
||||
|
||||
QDomElement applicationElement = manifest.firstChildElement(QLatin1String("application"));
|
||||
m_appNameLineEdit->setText(applicationElement.attribute(QLatin1String("android:label")));
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <utils/temporaryfile.h>
|
||||
#include <utils/url.h>
|
||||
|
||||
#include <QDate>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFileInfo>
|
||||
@@ -498,22 +499,45 @@ void AndroidRunnerWorker::setAndroidDeviceInfo(const AndroidDeviceInfo &info)
|
||||
<< m_deviceSerialNumber << m_apiLevel;
|
||||
}
|
||||
|
||||
void AndroidRunnerWorker::asyncStartHelper()
|
||||
void Android::Internal::AndroidRunnerWorker::asyncStartLogcat()
|
||||
{
|
||||
forceStop();
|
||||
|
||||
// Its assumed that the device or avd returned by selector() is online.
|
||||
// Start the logcat process before app starts.
|
||||
QTC_ASSERT(!m_adbLogcatProcess, /**/);
|
||||
m_adbLogcatProcess.reset(AndroidManager::runAdbCommandDetached(selector() << "logcat"));
|
||||
if (m_adbLogcatProcess) {
|
||||
m_adbLogcatProcess->setObjectName("AdbLogcatProcess");
|
||||
connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardOutput,
|
||||
this, &AndroidRunnerWorker::logcatReadStandardOutput);
|
||||
connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardError,
|
||||
this, &AndroidRunnerWorker::logcatReadStandardError);
|
||||
|
||||
// Ideally AndroidManager::runAdbCommandDetached() should be used, but here
|
||||
// we need to connect the readyRead signals from logcat otherwise we might
|
||||
// lost some output between the process start and connecting those signals.
|
||||
m_adbLogcatProcess.reset(new QProcess());
|
||||
|
||||
connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardOutput,
|
||||
this, &AndroidRunnerWorker::logcatReadStandardOutput);
|
||||
connect(m_adbLogcatProcess.get(), &QProcess::readyReadStandardError,
|
||||
this, &AndroidRunnerWorker::logcatReadStandardError);
|
||||
|
||||
// Get target current time to fetch only recent logs
|
||||
QString dateInSeconds;
|
||||
QStringList timeArg;
|
||||
if (runAdb({"shell", "date", "+%s"}, &dateInSeconds)) {
|
||||
timeArg << "-T";
|
||||
timeArg << QDateTime::fromSecsSinceEpoch(dateInSeconds.toInt())
|
||||
.toString("MM-dd hh:mm:ss.mmm");
|
||||
}
|
||||
|
||||
const QStringList logcatArgs = selector() << "logcat" << timeArg;
|
||||
const QString adb = AndroidConfigurations::currentConfig().adbToolPath().toString();
|
||||
qCDebug(androidRunWorkerLog) << "Running logcat command (async):"
|
||||
<< CommandLine(adb, logcatArgs).toUserOutput();
|
||||
m_adbLogcatProcess->start(adb, logcatArgs);
|
||||
if (m_adbLogcatProcess->waitForStarted(500) && m_adbLogcatProcess->state() == QProcess::Running)
|
||||
m_adbLogcatProcess->setObjectName("AdbLogcatProcess");
|
||||
}
|
||||
|
||||
void AndroidRunnerWorker::asyncStartHelper()
|
||||
{
|
||||
forceStop();
|
||||
asyncStartLogcat();
|
||||
|
||||
for (const QString &entry : m_beforeStartAdbCommands)
|
||||
runAdb(entry.split(' ', Qt::SkipEmptyParts));
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ private:
|
||||
bool deviceFileExists(const QString &filePath);
|
||||
bool packageFileExists(const QString& filePath);
|
||||
bool uploadDebugServer(const QString &debugServerFileName);
|
||||
void asyncStartLogcat();
|
||||
|
||||
enum class JDBState {
|
||||
Idle,
|
||||
|
||||
@@ -146,7 +146,6 @@ void AvdDialog::parseDeviceDefinitionsList()
|
||||
if (line.startsWith("---------") || line.isEmpty()) {
|
||||
DeviceDefinitionStruct deviceDefinition;
|
||||
for (const QString &line : avdDeviceInfo) {
|
||||
QString value;
|
||||
if (line.contains("id:")) {
|
||||
deviceDefinition.name_id = line.split("or").at(1);
|
||||
deviceDefinition.name_id = deviceDefinition.name_id.remove(0, 1).remove('"');
|
||||
|
||||
@@ -182,8 +182,8 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
|
||||
|
||||
if (wizard->copyGradle()) {
|
||||
auto checkBox = new QCheckBox(this);
|
||||
checkBox->setChecked(false);
|
||||
connect(checkBox, &QCheckBox::toggled, wizard, &CreateAndroidManifestWizard::setCopyGradle);
|
||||
checkBox->setChecked(false);
|
||||
checkBox->setText(tr("Copy the Gradle files to Android directory"));
|
||||
checkBox->setToolTip(tr("It is highly recommended if you are planning to extend the Java part of your Qt application."));
|
||||
m_layout->addRow(checkBox);
|
||||
|
||||
@@ -74,6 +74,7 @@ void QdbMakeDefaultAppService::handleProcessFinished(const QString &error)
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: Check that ignoring is fine
|
||||
QByteArray processOutput = d->processRunner->readAllStandardOutput();
|
||||
|
||||
if (d->makeDefault)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
add_qtc_plugin(ClangFormat
|
||||
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0
|
||||
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH
|
||||
DEPENDS Utils Qt5::Widgets clangFormat
|
||||
INCLUDES "${CLANG_INCLUDE_DIRS}"
|
||||
PLUGIN_DEPENDS Core TextEditor CppEditor CppTools ProjectExplorer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_qtc_plugin(ClangPchManager
|
||||
BUILD_DEFAULT OFF
|
||||
CONDITION TARGET libclang
|
||||
CONDITION TARGET libclang AND QTC_CLANG_BUILDMODE_MATCH
|
||||
DEPENDS ClangSupport CPlusPlus
|
||||
DEFINES CLANGPCHMANAGER_LIB
|
||||
PLUGIN_DEPENDS Core CppTools
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_qtc_plugin(ClangRefactoring
|
||||
BUILD_DEFAULT OFF
|
||||
CONDITION TARGET libclang
|
||||
CONDITION TARGET libclang AND QTC_CLANG_BUILDMODE_MATCH
|
||||
DEPENDS ClangSupport CPlusPlus
|
||||
PLUGIN_DEPENDS Core CppTools TextEditor ClangPchManager
|
||||
SOURCES ${TEST_SOURCES}
|
||||
|
||||
@@ -825,7 +825,7 @@ void ClangTool::loadDiagnosticsFromFiles()
|
||||
|
||||
// Show imported
|
||||
reset();
|
||||
onNewDiagnosticsAvailable(diagnostics);
|
||||
onNewDiagnosticsAvailable(diagnostics, /*generateMarks =*/ true);
|
||||
setState(State::ImportFinished);
|
||||
}
|
||||
|
||||
@@ -1129,10 +1129,10 @@ QSet<Diagnostic> ClangTool::diagnostics() const
|
||||
});
|
||||
}
|
||||
|
||||
void ClangTool::onNewDiagnosticsAvailable(const Diagnostics &diagnostics)
|
||||
void ClangTool::onNewDiagnosticsAvailable(const Diagnostics &diagnostics, bool generateMarks)
|
||||
{
|
||||
QTC_ASSERT(m_diagnosticModel, return);
|
||||
m_diagnosticModel->addDiagnostics(diagnostics);
|
||||
m_diagnosticModel->addDiagnostics(diagnostics, generateMarks);
|
||||
}
|
||||
|
||||
void ClangTool::updateForCurrentState()
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
const QString &name() const;
|
||||
|
||||
void onNewDiagnosticsAvailable(const Diagnostics &diagnostics);
|
||||
void onNewDiagnosticsAvailable(const Diagnostics &diagnostics, bool generateMarks);
|
||||
|
||||
QAction *startAction() const { return m_startAction; }
|
||||
QAction *startOnCurrentFileAction() const { return m_startOnCurrentFileAction; }
|
||||
|
||||
@@ -364,8 +364,12 @@ void ClangToolRunWorker::onRunnerFinishedWithSuccess(const QString &filePath)
|
||||
} else {
|
||||
if (!m_filesNotAnalyzed.contains(filePath))
|
||||
m_filesAnalyzed.insert(filePath);
|
||||
if (!diagnostics.isEmpty())
|
||||
tool()->onNewDiagnosticsAvailable(diagnostics);
|
||||
if (!diagnostics.isEmpty()) {
|
||||
// do not generate marks when we always analyze open files since marks from that
|
||||
// analysis should be more up to date
|
||||
const bool generateMarks = !m_runSettings.analyzeOpenFiles();
|
||||
tool()->onNewDiagnosticsAvailable(diagnostics, generateMarks);
|
||||
}
|
||||
}
|
||||
|
||||
handleFinished();
|
||||
@@ -381,7 +385,6 @@ void ClangToolRunWorker::onRunnerFinishedWithFailure(const QString &errorMessage
|
||||
|
||||
auto *toolRunner = qobject_cast<ClangToolRunner *>(sender());
|
||||
const QString fileToAnalyze = toolRunner->fileToAnalyze();
|
||||
const QString outputFilePath = toolRunner->outputFilePath();
|
||||
|
||||
m_filesAnalyzed.remove(fileToAnalyze);
|
||||
m_filesNotAnalyzed.insert(fileToAnalyze);
|
||||
|
||||
@@ -58,7 +58,7 @@ QVariant FilePathItem::data(int column, int role) const
|
||||
case Qt::DisplayRole:
|
||||
return m_filePath;
|
||||
case Qt::DecorationRole:
|
||||
return Core::FileIconProvider::icon(m_filePath);
|
||||
return Core::FileIconProvider::icon(QFileInfo(m_filePath));
|
||||
case Debugger::DetailedErrorView::FullTextRole:
|
||||
return m_filePath;
|
||||
default:
|
||||
@@ -102,7 +102,7 @@ QDebug operator<<(QDebug debug, const Diagnostic &d)
|
||||
;
|
||||
}
|
||||
|
||||
void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics)
|
||||
void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics, bool generateMarks)
|
||||
{
|
||||
const auto onFixitStatusChanged =
|
||||
[this](const QModelIndex &index, FixitStatus oldStatus, FixitStatus newStatus) {
|
||||
@@ -129,7 +129,7 @@ void ClangToolsDiagnosticModel::addDiagnostics(const Diagnostics &diagnostics)
|
||||
|
||||
// Add to file path item
|
||||
qCDebug(LOG) << "Adding diagnostic:" << d;
|
||||
filePathItem->appendChild(new DiagnosticItem(d, onFixitStatusChanged, this));
|
||||
filePathItem->appendChild(new DiagnosticItem(d, onFixitStatusChanged, generateMarks, this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,11 +284,12 @@ static QString fullText(const Diagnostic &diagnostic)
|
||||
|
||||
DiagnosticItem::DiagnosticItem(const Diagnostic &diag,
|
||||
const OnFixitStatusChanged &onFixitStatusChanged,
|
||||
bool generateMark,
|
||||
ClangToolsDiagnosticModel *parent)
|
||||
: m_diagnostic(diag)
|
||||
, m_onFixitStatusChanged(onFixitStatusChanged)
|
||||
, m_parentModel(parent)
|
||||
, m_mark(new DiagnosticMark(diag))
|
||||
, m_mark(generateMark ? new DiagnosticMark(diag) : nullptr)
|
||||
{
|
||||
if (diag.hasFixits)
|
||||
m_fixitStatus = FixitStatus::NotScheduled;
|
||||
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
= std::function<void(const QModelIndex &index, FixitStatus oldStatus, FixitStatus newStatus)>;
|
||||
DiagnosticItem(const Diagnostic &diag,
|
||||
const OnFixitStatusChanged &onFixitStatusChanged,
|
||||
bool generateMark,
|
||||
ClangToolsDiagnosticModel *parent);
|
||||
~DiagnosticItem() override;
|
||||
|
||||
@@ -112,7 +113,7 @@ class ClangToolsDiagnosticModel : public ClangToolsDiagnosticModelBase
|
||||
public:
|
||||
ClangToolsDiagnosticModel(QObject *parent = nullptr);
|
||||
|
||||
void addDiagnostics(const Diagnostics &diagnostics);
|
||||
void addDiagnostics(const Diagnostics &diagnostics, bool generateMarks);
|
||||
QSet<Diagnostic> diagnostics() const;
|
||||
|
||||
enum ItemRole {
|
||||
|
||||
@@ -61,6 +61,8 @@ void VirtualFileSystemOverlay::update()
|
||||
documentRoots[doc->filePath().absolutePath()] << doc;
|
||||
AutoSavedPath saved = m_saved.take(document);
|
||||
if (saved.revision != document->document()->revision()) {
|
||||
if (saved.path.exists())
|
||||
Utils::FileUtils::removeRecursively(saved.path);
|
||||
saved.revision = document->document()->revision();
|
||||
QString error;
|
||||
saved.path = Utils::FilePath::fromString(m_root.path())
|
||||
|
||||
@@ -466,7 +466,6 @@ void addCompileGroups(ProjectNode *targetRoot,
|
||||
QSet<FilePath> &knownHeaderNodes)
|
||||
{
|
||||
const bool inSourceBuild = (sourceDirectory == buildDirectory);
|
||||
const QDir currentSourceDir(sourceDirectory.toString());
|
||||
|
||||
std::vector<std::unique_ptr<FileNode>> toList;
|
||||
QSet<Utils::FilePath> alreadyListed;
|
||||
|
||||
@@ -422,7 +422,7 @@ void ReadOnlyFilesDialogPrivate::initDialog(const FilePaths &filePaths)
|
||||
auto item = new QTreeWidgetItem(ui.treeWidget);
|
||||
item->setText(FileName, visibleName);
|
||||
item->setIcon(FileName, FileIconProvider::icon(info));
|
||||
item->setText(Folder, Utils::FilePath::fromFileInfo(directory).shortNativePath());
|
||||
item->setText(Folder, Utils::FilePath::fromString(directory).shortNativePath());
|
||||
auto radioButtonGroup = new QButtonGroup;
|
||||
|
||||
// Add a button for opening the file with a version control system
|
||||
|
||||
@@ -79,7 +79,7 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent,
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.treeWidget, QStringList()
|
||||
<< visibleName << QDir::toNativeSeparators(directory));
|
||||
if (!fileName.isEmpty())
|
||||
item->setIcon(0, FileIconProvider::icon(fileName));
|
||||
item->setIcon(0, FileIconProvider::icon(QFileInfo(fileName)));
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue(document));
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ QVariant LocatorModel::data(const QModelIndex &index, int role) const
|
||||
if (index.column() == DisplayNameColumn) {
|
||||
LocatorFilterEntry &entry = mEntries[index.row()];
|
||||
if (!entry.displayIcon && !entry.fileName.isEmpty())
|
||||
entry.displayIcon = FileIconProvider::icon(entry.fileName);
|
||||
entry.displayIcon = FileIconProvider::icon(QFileInfo(entry.fileName));
|
||||
return entry.displayIcon ? entry.displayIcon.value() : QIcon();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -47,7 +47,7 @@ QVariant FilePathItem::data(int column, int role) const
|
||||
case Qt::DisplayRole:
|
||||
return m_filePath;
|
||||
case Qt::DecorationRole:
|
||||
return Core::FileIconProvider::icon(m_filePath);
|
||||
return Core::FileIconProvider::icon(QFileInfo(m_filePath));
|
||||
case Debugger::DetailedErrorView::FullTextRole:
|
||||
return m_filePath;
|
||||
default:
|
||||
|
||||
@@ -171,6 +171,18 @@ void DebuggerItem::reinitializeFromFile()
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent calling lldb on Windows because the lldb from the llvm package is linked against
|
||||
// python but does not contain a python dll.
|
||||
if (HostOsInfo::isWindowsHost() && m_command.fileName().startsWith("lldb")) {
|
||||
QString errorMessage;
|
||||
m_version = winGetDLLVersion(WinDLLFileVersion,
|
||||
fileInfo.absoluteFilePath(),
|
||||
&errorMessage);
|
||||
m_engineType = LldbEngineType;
|
||||
m_abis = Abi::abisOfBinary(m_command);
|
||||
return;
|
||||
}
|
||||
|
||||
SynchronousProcess proc;
|
||||
SynchronousProcessResponse response = proc.runBlocking({m_command, {version}});
|
||||
if (response.result != SynchronousProcessResponse::Finished) {
|
||||
|
||||
@@ -62,11 +62,6 @@ void FormClassWizardDialog::setPath(const QString &p)
|
||||
m_classPage->setPath(p);
|
||||
}
|
||||
|
||||
bool FormClassWizardDialog::validateCurrentPage()
|
||||
{
|
||||
return QWizard::validateCurrentPage();
|
||||
}
|
||||
|
||||
void FormClassWizardDialog::initializePage(int id)
|
||||
{
|
||||
Core::BaseFileWizard::initializePage(id);
|
||||
|
||||
@@ -50,8 +50,6 @@ public:
|
||||
|
||||
Designer::FormClassWizardParameters parameters() const;
|
||||
|
||||
bool validateCurrentPage() final;
|
||||
|
||||
protected:
|
||||
void initializePage(int id) final;
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ void GenericBuildSystem::parse(RefreshOptions options)
|
||||
FilePath GenericBuildSystem::findCommonSourceRoot()
|
||||
{
|
||||
if (m_files.isEmpty())
|
||||
return FilePath::fromFileInfo(QFileInfo(m_filesFileName).absolutePath());
|
||||
return FilePath::fromFileInfo(QFileInfo(m_filesFileName));
|
||||
|
||||
QString root = m_files.front();
|
||||
for (const QString &item : qAsConst(m_files)) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
QmlDebug::QmlDebugServicesPreset qmlDebugServices() const;
|
||||
|
||||
void start() override;
|
||||
void stop() override final;
|
||||
void stop() final;
|
||||
|
||||
virtual void appOutput(const QString &/*output*/) {}
|
||||
virtual void errorMsg(const QString &/*msg*/) {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_qtc_plugin(McuSupport
|
||||
DEPENDS Qt5::Core
|
||||
PLUGIN_DEPENDS Core ProjectExplorer Debugger CMakeProjectManager QtSupport
|
||||
PLUGIN_DEPENDS Core BareMetal ProjectExplorer Debugger CMakeProjectManager QtSupport
|
||||
SOURCES
|
||||
mcusupport.qrc
|
||||
mcusupport_global.h
|
||||
|
||||
@@ -8,6 +8,7 @@ QtcPlugin {
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "BareMetal" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "Debugger" }
|
||||
Depends { name: "CMakeProjectManager" }
|
||||
|
||||
@@ -6,6 +6,7 @@ QTC_LIB_DEPENDS += \
|
||||
|
||||
QTC_PLUGIN_DEPENDS += \
|
||||
coreplugin \
|
||||
baremetal \
|
||||
projectexplorer \
|
||||
debugger \
|
||||
cmakeprojectmanager \
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "mcusupportoptions.h"
|
||||
#include "mcusupportsdk.h"
|
||||
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <cmakeprojectmanager/cmaketoolmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/helpmanager.h>
|
||||
@@ -74,7 +75,7 @@ static QString packagePathFromSettings(const QString &settingsKey,
|
||||
const QString key = QLatin1String(Constants::SETTINGS_GROUP) + '/' +
|
||||
QLatin1String(Constants::SETTINGS_KEY_PACKAGE_PREFIX) + settingsKey;
|
||||
const QString path = settings->value(key, defaultPath).toString();
|
||||
return FilePath::fromFileInfo(path).toString();
|
||||
return FilePath::fromUserInput(path).toString();
|
||||
}
|
||||
|
||||
static bool automaticKitCreationFromSettings(QSettings::Scope scope = QSettings::UserScope)
|
||||
@@ -330,6 +331,33 @@ static ToolChain *armGccToolChain(const FilePath &path, Id language)
|
||||
return toolChain;
|
||||
}
|
||||
|
||||
static ToolChain *iarToolChain(Id language)
|
||||
{
|
||||
ToolChain *toolChain = ToolChainManager::toolChain([language](const ToolChain *t){
|
||||
return t->typeId() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID
|
||||
&& t->language() == language;
|
||||
});
|
||||
if (!toolChain) {
|
||||
ToolChainFactory *iarFactory =
|
||||
Utils::findOrDefault(ToolChainFactory::allToolChainFactories(), [](ToolChainFactory *f){
|
||||
return f->supportedToolChainType() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID;
|
||||
});
|
||||
if (iarFactory) {
|
||||
const QList<ToolChain*> detected = iarFactory->autoDetect(QList<ToolChain*>());
|
||||
for (auto tc: detected) {
|
||||
if (tc->language() == language) {
|
||||
toolChain = tc;
|
||||
toolChain->setDetection(ToolChain::ManualDetection);
|
||||
toolChain->setDisplayName("IAREW");
|
||||
ToolChainManager::registerToolChain(toolChain);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return toolChain;
|
||||
}
|
||||
|
||||
ToolChain *McuToolChainPackage::toolChain(Id language) const
|
||||
{
|
||||
ToolChain *tc = nullptr;
|
||||
@@ -337,6 +365,9 @@ ToolChain *McuToolChainPackage::toolChain(Id language) const
|
||||
tc = msvcToolChain(language);
|
||||
else if (m_type == TypeGCC)
|
||||
tc = gccToolChain(language);
|
||||
else if (m_type == TypeIAR) {
|
||||
tc = iarToolChain(language);
|
||||
}
|
||||
else {
|
||||
const QLatin1String compilerName(
|
||||
language == ProjectExplorer::Constants::C_LANGUAGE_ID ? "gcc" : "g++");
|
||||
@@ -344,20 +375,25 @@ ToolChain *McuToolChainPackage::toolChain(Id language) const
|
||||
HostOsInfo::withExecutableSuffix(
|
||||
path() + (
|
||||
m_type == TypeArmGcc
|
||||
? "/bin/arm-none-eabi-%1" : m_type == TypeIAR
|
||||
? "/foo/bar-iar-%1" : "/bar/foo-keil-%1")).arg(compilerName));
|
||||
? "/bin/arm-none-eabi-%1" : "/bar/foo-keil-%1")).arg(compilerName));
|
||||
|
||||
tc = armGccToolChain(compiler, language);
|
||||
}
|
||||
return tc;
|
||||
}
|
||||
|
||||
QString McuToolChainPackage::cmakeToolChainFileName() const
|
||||
QString McuToolChainPackage::toolChainName() const
|
||||
{
|
||||
return QLatin1String(m_type == TypeArmGcc
|
||||
? "armgcc" : m_type == McuToolChainPackage::TypeIAR
|
||||
? "iar" : m_type == McuToolChainPackage::TypeKEIL
|
||||
? "keil" : "ghs") + QLatin1String(".cmake");
|
||||
? "keil" : m_type == McuToolChainPackage::TypeGHS
|
||||
? "ghs" : "unsupported");
|
||||
}
|
||||
|
||||
QString McuToolChainPackage::cmakeToolChainFileName() const
|
||||
{
|
||||
return toolChainName() + QLatin1String(".cmake");
|
||||
}
|
||||
|
||||
QVariant McuToolChainPackage::debuggerId() const
|
||||
@@ -368,7 +404,7 @@ QVariant McuToolChainPackage::debuggerId() const
|
||||
HostOsInfo::withExecutableSuffix(path() + (
|
||||
m_type == TypeArmGcc
|
||||
? "/bin/arm-none-eabi-gdb-py" : m_type == TypeIAR
|
||||
? "/foo/bar-iar-gdb" : "/bar/foo-keil-gdb")));
|
||||
? "../common/bin/CSpyBat" : "/bar/foo-keil-gdb")));
|
||||
const DebuggerItem *debugger = DebuggerItemManager::findByCommand(command);
|
||||
QVariant debuggerId;
|
||||
if (!debugger) {
|
||||
@@ -376,7 +412,7 @@ QVariant McuToolChainPackage::debuggerId() const
|
||||
newDebugger.setCommand(command);
|
||||
const QString displayName = m_type == TypeArmGcc
|
||||
? McuPackage::tr("Arm GDB at %1")
|
||||
: m_type == TypeIAR ? QLatin1String("/foo/bar-iar-gdb")
|
||||
: m_type == TypeIAR ? QLatin1String("CSpy")
|
||||
: QLatin1String("/bar/foo-keil-gdb");
|
||||
newDebugger.setUnexpandedDisplayName(displayName.arg(command.toUserOutput()));
|
||||
debuggerId = DebuggerItemManager::registerDebugger(newDebugger);
|
||||
@@ -561,7 +597,8 @@ static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mc
|
||||
static void setKitToolchains(Kit *k, const McuToolChainPackage *tcPackage)
|
||||
{
|
||||
// No Green Hills toolchain, because support for it is missing.
|
||||
if (tcPackage->type() == McuToolChainPackage::TypeGHS)
|
||||
if (tcPackage->type() == McuToolChainPackage::TypeUnsupported
|
||||
|| tcPackage->type() == McuToolChainPackage::TypeGHS)
|
||||
return;
|
||||
|
||||
ToolChainKitAspect::setToolChain(k, tcPackage->toolChain(
|
||||
@@ -575,8 +612,10 @@ static void setKitDebugger(Kit *k, const McuToolChainPackage *tcPackage)
|
||||
// Qt Creator seems to be smart enough to deduce the right Kit debugger from the ToolChain
|
||||
// We rely on that at least in the Desktop case.
|
||||
if (tcPackage->isDesktopToolchain()
|
||||
// No Green Hills debugger, because support for it is missing.
|
||||
|| tcPackage->type() == McuToolChainPackage::TypeGHS)
|
||||
// No Green Hills and IAR debugger, because support for it is missing.
|
||||
|| tcPackage->type() == McuToolChainPackage::TypeUnsupported
|
||||
|| tcPackage->type() == McuToolChainPackage::TypeGHS
|
||||
|| tcPackage->type() == McuToolChainPackage::TypeIAR)
|
||||
return;
|
||||
|
||||
Debugger::DebuggerKitAspect::setDebugger(k, tcPackage->debuggerId());
|
||||
@@ -676,18 +715,23 @@ QString McuSupportOptions::kitName(const McuTarget *mcuTarget)
|
||||
// Starting from Qul 1.4 each OS is a separate platform
|
||||
os = QLatin1String(" FreeRTOS");
|
||||
|
||||
const McuToolChainPackage *tcPkg = mcuTarget->toolChainPackage();
|
||||
const QString compilerName = tcPkg && !tcPkg->isDesktopToolchain()
|
||||
? QString::fromLatin1(" (%1)").arg(tcPkg->toolChainName().toUpper())
|
||||
: "";
|
||||
const QString colorDepth = mcuTarget->colorDepth() > 0
|
||||
? QString::fromLatin1(" %1bpp").arg(mcuTarget->colorDepth())
|
||||
: "";
|
||||
const QString targetName = mcuTarget->platform().displayName.isEmpty()
|
||||
? mcuTarget->platform().name
|
||||
: mcuTarget->platform().displayName;
|
||||
return QString::fromLatin1("Qt for MCUs %1.%2 - %3%4%5")
|
||||
return QString::fromLatin1("Qt for MCUs %1.%2 - %3%4%5%6")
|
||||
.arg(QString::number(mcuTarget->qulVersion().majorVersion()),
|
||||
QString::number(mcuTarget->qulVersion().minorVersion()),
|
||||
targetName,
|
||||
os,
|
||||
colorDepth);
|
||||
colorDepth,
|
||||
compilerName);
|
||||
}
|
||||
|
||||
QList<Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTarget)
|
||||
|
||||
@@ -116,7 +116,8 @@ public:
|
||||
TypeKEIL,
|
||||
TypeGHS,
|
||||
TypeMSVC,
|
||||
TypeGCC
|
||||
TypeGCC,
|
||||
TypeUnsupported
|
||||
};
|
||||
|
||||
McuToolChainPackage(const QString &label,
|
||||
@@ -128,6 +129,7 @@ public:
|
||||
Type type() const;
|
||||
bool isDesktopToolchain() const;
|
||||
ProjectExplorer::ToolChain *toolChain(Utils::Id language) const;
|
||||
QString toolChainName() const;
|
||||
QString cmakeToolChainFileName() const;
|
||||
QVariant debuggerId() const;
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#include "mcusupportoptions.h"
|
||||
#include "mcusupportsdk.h"
|
||||
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/fileutils.h>
|
||||
@@ -78,6 +81,11 @@ static McuToolChainPackage *createGccToolChainPackage()
|
||||
return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::TypeGCC);
|
||||
}
|
||||
|
||||
static McuToolChainPackage *createUnsupportedToolChainPackage()
|
||||
{
|
||||
return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::TypeUnsupported);
|
||||
}
|
||||
|
||||
static McuToolChainPackage *createArmGccPackage()
|
||||
{
|
||||
const char envVar[] = "ARMGCC_DIR";
|
||||
@@ -126,6 +134,36 @@ static McuToolChainPackage *createGhsToolchainPackage()
|
||||
return result;
|
||||
}
|
||||
|
||||
static McuToolChainPackage *createIarToolChainPackage()
|
||||
{
|
||||
const char envVar[] = "IAR_ARM_COMPILER_DIR";
|
||||
|
||||
QString defaultPath;
|
||||
if (qEnvironmentVariableIsSet(envVar))
|
||||
defaultPath = qEnvironmentVariable(envVar);
|
||||
else {
|
||||
const ProjectExplorer::ToolChain *tc =
|
||||
ProjectExplorer::ToolChainManager::toolChain([](const ProjectExplorer::ToolChain *t) {
|
||||
return t->typeId() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID;
|
||||
});
|
||||
if (tc) {
|
||||
const Utils::FilePath compilerExecPath = tc->compilerCommand();
|
||||
defaultPath = compilerExecPath.parentDir().parentDir().toString();
|
||||
}
|
||||
else
|
||||
defaultPath = QDir::homePath();
|
||||
}
|
||||
|
||||
auto result = new McuToolChainPackage(
|
||||
"IAR ARM Compiler",
|
||||
defaultPath,
|
||||
Utils::HostOsInfo::withExecutableSuffix("bin/iccarm"),
|
||||
"IARToolchain",
|
||||
McuToolChainPackage::TypeIAR);
|
||||
result->setEnvironmentVariableName(envVar);
|
||||
return result;
|
||||
}
|
||||
|
||||
static McuPackage *createRGLPackage()
|
||||
{
|
||||
const char envVar[] = "RGL_DIR";
|
||||
@@ -321,6 +359,8 @@ protected:
|
||||
{
|
||||
QVector<McuTarget *> mcuTargets;
|
||||
McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchainId);
|
||||
if (!tcPkg)
|
||||
tcPkg = createUnsupportedToolChainPackage();
|
||||
for (auto os : {McuTarget::OS::BareMetal, McuTarget::OS::FreeRTOS}) {
|
||||
for (int colorDepth : desc.colorDepths) {
|
||||
QVector<McuPackage*> required3rdPartyPkgs = { tcPkg };
|
||||
@@ -366,6 +406,8 @@ protected:
|
||||
QVector<McuTarget *> createDesktopTargetsLegacy(const McuTargetDescription& desc)
|
||||
{
|
||||
McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchainId);
|
||||
if (!tcPkg)
|
||||
tcPkg = createUnsupportedToolChainPackage();
|
||||
const auto platform = McuTarget::Platform{ desc.platform, desc.platformName, desc.platformVendor };
|
||||
auto desktopTarget = new McuTarget(QVersionNumber::fromString(desc.qulVersion),
|
||||
platform, McuTarget::OS::Desktop, {}, tcPkg);
|
||||
@@ -385,10 +427,14 @@ protected:
|
||||
|
||||
QVector<McuTarget *> mcuTargets;
|
||||
McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchainId);
|
||||
if (!tcPkg)
|
||||
tcPkg = createUnsupportedToolChainPackage();
|
||||
for (int colorDepth : desc.colorDepths) {
|
||||
QVector<McuPackage*> required3rdPartyPkgs;
|
||||
// Desktop toolchains don't need any additional settings
|
||||
if (tcPkg && !tcPkg->isDesktopToolchain())
|
||||
if (tcPkg
|
||||
&& !tcPkg->isDesktopToolchain()
|
||||
&& tcPkg->type() != McuToolChainPackage::TypeUnsupported)
|
||||
required3rdPartyPkgs.append(tcPkg);
|
||||
|
||||
// Add setting specific to platform IDE
|
||||
@@ -440,6 +486,7 @@ static QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescrip
|
||||
const QHash<QString, McuToolChainPackage *> tcPkgs = {
|
||||
{{"armgcc"}, createArmGccPackage()},
|
||||
{{"greenhills"}, createGhsToolchainPackage()},
|
||||
{{"iar"}, createIarToolChainPackage()},
|
||||
{{"msvc"}, createMsvcToolChainPackage()},
|
||||
{{"gcc"}, createGccToolChainPackage()},
|
||||
};
|
||||
|
||||
@@ -661,7 +661,7 @@ void MercurialPluginPrivate::showCommitWidget(const QList<VcsBaseClient::StatusI
|
||||
commitEditor->document()->setPreferredDisplayName(msg);
|
||||
|
||||
const QString branch = vcsTopic(m_submitRepository);
|
||||
commitEditor->setFields(m_submitRepository, branch,
|
||||
commitEditor->setFields(QFileInfo(m_submitRepository), branch,
|
||||
m_settings.stringValue(MercurialSettings::userNameKey),
|
||||
m_settings.stringValue(MercurialSettings::userEmailKey), status);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const
|
||||
case Qt::CheckStateRole:
|
||||
return SessionManager::hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked;
|
||||
case Qt::DecorationRole:
|
||||
return Core::FileIconProvider::icon(p->projectFilePath().toString());
|
||||
return Core::FileIconProvider::icon(p->projectFilePath().toFileInfo());
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
@@ -1029,7 +1029,6 @@ QList<ToolChain *> GccToolChainFactory::autoDetect(const QList<ToolChain *> &alr
|
||||
if (HostOsInfo::isMacHost())
|
||||
return {};
|
||||
QList<ToolChain *> tcs;
|
||||
QList<ToolChain *> known = alreadyKnown;
|
||||
static const auto tcChecker = [](const ToolChain *tc) {
|
||||
return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor
|
||||
&& tc->compilerCommand().fileName() != "c89-gcc"
|
||||
|
||||
@@ -636,7 +636,6 @@ void LineEditField::setupCompletion(FancyLineEdit *lineEdit)
|
||||
const auto handleResults = [this, lineEdit, watcher](int firstIndex, int endIndex) {
|
||||
QSet<QString> namespaces;
|
||||
QStringList classes;
|
||||
QString projectBaseDir;
|
||||
Project * const project = ProjectTree::currentProject();
|
||||
for (int i = firstIndex; i < endIndex; ++i) {
|
||||
static const auto isReservedName = [](const QString &name) {
|
||||
|
||||
@@ -542,7 +542,6 @@ JsonWizardJsExtension::JsonWizardJsExtension(JsonWizard *wizard)
|
||||
|
||||
QVariant JsonWizardJsExtension::value(const QString &name) const
|
||||
{
|
||||
const QVariant value = m_wizard->value(name);
|
||||
return m_wizard->expander()->expandVariant(m_wizard->value(name));
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
case Qt::DecorationRole: {
|
||||
if (!folderNode)
|
||||
return Core::FileIconProvider::icon(node->filePath().toString());
|
||||
return Core::FileIconProvider::icon(node->filePath().toFileInfo());
|
||||
if (!project)
|
||||
return folderNode->icon();
|
||||
static QIcon warnIcon = Utils::Icons::WARNING.icon();
|
||||
|
||||
@@ -396,7 +396,6 @@ public:
|
||||
{
|
||||
Kit *kit = KitManager::kit(m_kitId);
|
||||
QTC_ASSERT(kit, return);
|
||||
const QString kitName = kit->displayName();
|
||||
const QString projectName = m_project->displayName();
|
||||
|
||||
QAction *enableAction = menu->addAction(tr("Enable Kit for Project \"%1\"").arg(projectName));
|
||||
|
||||
@@ -45,7 +45,7 @@ void findQmlFiles(QFutureInterface<Utils::FilePath> &f, const Project *project)
|
||||
return;
|
||||
|
||||
int index = 0;
|
||||
Utils::FilePaths qmlFiles = project->files([&f, &index](const Node* node) ->bool {
|
||||
project->files([&f, &index](const Node* node) ->bool {
|
||||
if (f.isCanceled())
|
||||
return false;
|
||||
Utils::FilePath path = node->filePath();
|
||||
|
||||
@@ -54,7 +54,6 @@ QJsonObject AssetNodeParser::json(Component &component) const
|
||||
{
|
||||
QJsonObject jsonObject = ItemNodeParser::json(component);
|
||||
|
||||
QPixmap asset = objectNode().toQmlItemNode().instanceRenderPixmap();
|
||||
Utils::FilePath assetPath = component.exporter().exportAsset(objectNode(), uuid());
|
||||
QJsonObject assetData;
|
||||
assetData.insert(AssetPathTag, assetPath.toString());
|
||||
|
||||
@@ -64,7 +64,7 @@ void AnnotationEditor::showWidget()
|
||||
m_modelNode.customId(),
|
||||
m_modelNode.annotation());
|
||||
|
||||
QObject::connect(m_dialog, &AnnotationEditorDialog::accepted,
|
||||
QObject::connect(m_dialog, &AnnotationEditorDialog::acceptedDialog,
|
||||
this, &AnnotationEditor::acceptedClicked);
|
||||
QObject::connect(m_dialog, &AnnotationEditorDialog::rejected,
|
||||
this, &AnnotationEditor::cancelClicked);
|
||||
|
||||
@@ -149,7 +149,7 @@ void AnnotationEditorDialog::acceptedClicked()
|
||||
|
||||
m_annotation = annotation;
|
||||
|
||||
emit AnnotationEditorDialog::accepted();
|
||||
emit AnnotationEditorDialog::acceptedDialog();
|
||||
}
|
||||
|
||||
void AnnotationEditorDialog::commentTitleChanged(const QString &text, QWidget *tab)
|
||||
|
||||
@@ -49,6 +49,9 @@ public:
|
||||
void setCustomId(const QString &customId);
|
||||
QString customId() const;
|
||||
|
||||
signals:
|
||||
void acceptedDialog(); //use instead of QDialog::accepted
|
||||
|
||||
private slots:
|
||||
void acceptedClicked();
|
||||
void tabChanged(int index);
|
||||
|
||||
@@ -53,7 +53,7 @@ void GlobalAnnotationEditor::showWidget()
|
||||
modelNode().globalAnnotation(),
|
||||
modelNode().globalStatus());
|
||||
|
||||
QObject::connect(m_dialog, &GlobalAnnotationEditorDialog::accepted,
|
||||
QObject::connect(m_dialog, &GlobalAnnotationEditorDialog::acceptedDialog,
|
||||
this, &GlobalAnnotationEditor::acceptedClicked);
|
||||
QObject::connect(m_dialog, &GlobalAnnotationEditorDialog::rejected,
|
||||
this, &GlobalAnnotationEditor::cancelClicked);
|
||||
|
||||
@@ -164,7 +164,7 @@ void GlobalAnnotationEditorDialog::acceptedClicked()
|
||||
m_globalStatus.setStatus(ui->statusComboBox->currentIndex());
|
||||
}
|
||||
|
||||
emit GlobalAnnotationEditorDialog::accepted();
|
||||
emit GlobalAnnotationEditorDialog::acceptedDialog();
|
||||
}
|
||||
|
||||
void GlobalAnnotationEditorDialog::commentTitleChanged(const QString &text, QWidget *tab)
|
||||
|
||||
@@ -49,6 +49,9 @@ public:
|
||||
void setStatus(GlobalAnnotationStatus status);
|
||||
GlobalAnnotationStatus globalStatus() const;
|
||||
|
||||
signals:
|
||||
void acceptedDialog(); //use instead of QDialog::accepted
|
||||
|
||||
private slots:
|
||||
void acceptedClicked();
|
||||
void tabChanged(int index);
|
||||
|
||||
@@ -925,7 +925,7 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
QKeySequence(),
|
||||
200,
|
||||
&toFront,
|
||||
&singleSelection));
|
||||
&raiseAvailable));
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
raiseCommandId,
|
||||
@@ -955,7 +955,7 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
QKeySequence(),
|
||||
140,
|
||||
&toBack,
|
||||
&singleSelection));
|
||||
&lowerAvailable));
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
reverseCommandId,
|
||||
|
||||
@@ -523,7 +523,6 @@ QStringList ConnectionModel::getPossibleSignalsForConnection(const ModelNode &co
|
||||
const BindingProperty bp = connection.bindingProperty("target");
|
||||
|
||||
if (bp.isValid()) {
|
||||
const QString bindExpression = bp.expression();
|
||||
QStringList expression = bp.expression().split(".");
|
||||
if (expression.size() > 1) {
|
||||
const QString itemId = expression.constFirst();
|
||||
|
||||
@@ -535,7 +535,6 @@ void ConnectionViewWidget::editorForDynamic()
|
||||
VariantProperty property = abProp.toVariantProperty();
|
||||
PropertyName name = property.name();
|
||||
TypeName type = property.dynamicTypeName();
|
||||
QVariant value = newValue;
|
||||
|
||||
BindingProperty newProperty = propertiesModel
|
||||
->replaceVariantWithBinding(name);
|
||||
|
||||
@@ -429,7 +429,7 @@ void FormEditorAnnotationIcon::createAnnotationEditor()
|
||||
m_modelNode.customId(),
|
||||
m_modelNode.annotation());
|
||||
|
||||
connect(m_annotationEditor, &AnnotationEditorDialog::accepted,
|
||||
connect(m_annotationEditor, &AnnotationEditorDialog::acceptedDialog,
|
||||
this, &FormEditorAnnotationIcon::annotationDialogAccepted);
|
||||
connect(m_annotationEditor, &QDialog::rejected,
|
||||
this, &FormEditorAnnotationIcon::annotationDialogRejected);
|
||||
|
||||
@@ -605,8 +605,14 @@ void FormEditorFlowItem::updateGeometry()
|
||||
{
|
||||
FormEditorItem::updateGeometry();
|
||||
const QPointF pos = qmlItemNode().flowPosition();
|
||||
|
||||
setTransform(QTransform::fromTranslate(pos.x(), pos.y()));
|
||||
|
||||
if (pos == m_oldPos)
|
||||
return;
|
||||
|
||||
m_oldPos = pos;
|
||||
|
||||
// Call updateGeometry() on all related transitions
|
||||
QmlFlowTargetNode flowItem(qmlItemNode());
|
||||
if (flowItem.isValid() && flowItem.flowView().isValid()) {
|
||||
@@ -652,16 +658,6 @@ void FormEditorFlowActionItem::updateGeometry()
|
||||
FormEditorItem::updateGeometry();
|
||||
//const QPointF pos = qmlItemNode().flowPosition();
|
||||
//setTransform(QTransform::fromTranslate(pos.x(), pos.y()));
|
||||
|
||||
// Call updateGeometry() on all related transitions
|
||||
QmlFlowItemNode flowItem = QmlFlowActionAreaNode(qmlItemNode()).flowItemParent();
|
||||
if (flowItem.isValid() && flowItem.flowView().isValid()) {
|
||||
const auto nodes = flowItem.flowView().transitions();
|
||||
for (const ModelNode &node : nodes) {
|
||||
if (FormEditorItem *item = scene()->itemForQmlItemNode(node))
|
||||
item->updateGeometry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
||||
@@ -1748,16 +1744,6 @@ void FormEditorFlowDecisionItem::updateGeometry()
|
||||
setTransform(qmlItemNode().instanceTransformWithContentTransform());
|
||||
const QPointF pos = qmlItemNode().flowPosition();
|
||||
setTransform(QTransform::fromTranslate(pos.x(), pos.y()));
|
||||
|
||||
// Call updateGeometry() on all related transitions
|
||||
QmlFlowTargetNode flowItem(qmlItemNode());
|
||||
if (flowItem.isValid() && flowItem.flowView().isValid()) {
|
||||
const auto nodes = flowItem.flowView().transitions();
|
||||
for (const ModelNode &node : nodes) {
|
||||
if (FormEditorItem *item = scene()->itemForQmlItemNode(node))
|
||||
item->updateGeometry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
|
||||
@@ -163,6 +163,8 @@ protected:
|
||||
FormEditorFlowItem(const QmlItemNode &qmlItemNode, FormEditorScene *scene)
|
||||
: FormEditorItem(qmlItemNode, scene)
|
||||
{}
|
||||
private:
|
||||
QPointF m_oldPos;
|
||||
};
|
||||
|
||||
class FormEditorFlowActionItem : public FormEditorItem
|
||||
@@ -180,6 +182,8 @@ protected:
|
||||
FormEditorFlowActionItem(const QmlItemNode &qmlItemNode, FormEditorScene *scene)
|
||||
: FormEditorItem(qmlItemNode, scene)
|
||||
{}
|
||||
private:
|
||||
QPointF m_oldPos;
|
||||
};
|
||||
|
||||
class FormEditorTransitionItem : public FormEditorItem
|
||||
|
||||
@@ -118,7 +118,7 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
||||
}
|
||||
} else if (qmlItemNode.isFlowView() && qmlItemNode.isRootNode()) {
|
||||
m_scene->addFormEditorItem(qmlItemNode, FormEditorScene::Flow);
|
||||
FormEditorItem *rootItem = m_scene->addFormEditorItem(qmlItemNode, FormEditorScene::Flow);
|
||||
|
||||
ModelNode node = qmlItemNode.modelNode();
|
||||
if (!node.hasAuxiliaryData("width") && !node.hasAuxiliaryData("height")) {
|
||||
@@ -126,6 +126,9 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
|
||||
node.setAuxiliaryData("height", 10000);
|
||||
}
|
||||
|
||||
m_scene->synchronizeTransformation(rootItem);
|
||||
formEditorWidget()->setRootItemRect(qmlItemNode.instanceBoundingRect());
|
||||
|
||||
for (const QmlObjectNode &nextNode : qmlItemNode.allDirectSubNodes()) {
|
||||
if (QmlItemNode::isValidQmlItemNode(nextNode) && nextNode.toQmlItemNode().isFlowItem()) {
|
||||
setupFormEditorItemTree(nextNode.toQmlItemNode());
|
||||
|
||||
@@ -238,7 +238,6 @@ void ItemLibraryAssetImporter::parseFiles(const QStringList &filePaths,
|
||||
if (isCancelled())
|
||||
return;
|
||||
if (isQuick3DAsset(file)) {
|
||||
QVariantMap varOpts;
|
||||
int index = extToImportOptionsMap.value(QFileInfo(file).suffix());
|
||||
parseQuick3DAsset(file, options[index].toVariantMap());
|
||||
}
|
||||
@@ -383,7 +382,6 @@ void ItemLibraryAssetImporter::parseQuick3DAsset(const QString &file, const QVar
|
||||
out << "canBeDroppedInView3D: true" << Qt::endl;
|
||||
file.close();
|
||||
}
|
||||
QString outIconSource = QString::fromUtf8(content);
|
||||
if (generateComponentIcon(24, iconFileName, qmlIt.filePath())) {
|
||||
// Since icon is generated by external process, the file won't be
|
||||
// ready for asset gathering below, so assume its generation succeeds
|
||||
|
||||
@@ -658,7 +658,7 @@ void RichTextEditor::setupTableActions()
|
||||
m_actionSplitRow->setCheckable(false);
|
||||
|
||||
const QIcon splitColumnIcon(getIcon(Theme::Icon::splitColumns));
|
||||
m_actionSplitColumn = ui->tableBar->addAction(splitRowIcon, tr("Split Column"), [this]() {
|
||||
m_actionSplitColumn = ui->tableBar->addAction(splitColumnIcon, tr("Split Column"), [this]() {
|
||||
QTextCursor cursor = ui->textEdit->textCursor();
|
||||
if (QTextTable *currentTable = cursor.currentTable()) {
|
||||
cursorEditBlock(cursor, [&] () {
|
||||
|
||||
@@ -99,33 +99,50 @@ bool Exception::warnAboutException()
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs an exception. \a line uses the __LINE__ macro, \a function uses
|
||||
the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
|
||||
the __FILE__ macro.
|
||||
*/
|
||||
Exception::Exception(int line,
|
||||
const QByteArray &_function,
|
||||
const QByteArray &_file)
|
||||
: m_line(line),
|
||||
m_function(QString::fromUtf8(_function)),
|
||||
m_file(QString::fromUtf8(_file))
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
static QString getBackTrace()
|
||||
{
|
||||
QString backTrace;
|
||||
void * array[50];
|
||||
int nSize = backtrace(array, 50);
|
||||
char ** symbols = backtrace_symbols(array, nSize);
|
||||
|
||||
for (int i = 0; i < nSize; i++)
|
||||
{
|
||||
m_backTrace.append(QString("%1\n").arg(QLatin1String(symbols[i])));
|
||||
}
|
||||
backTrace.append(QString("%1\n").arg(QLatin1String(symbols[i])));
|
||||
|
||||
free(symbols);
|
||||
|
||||
return backTrace;
|
||||
}
|
||||
#endif
|
||||
|
||||
QString Exception::defaultDescription(int line, const QByteArray &function, const QByteArray &file)
|
||||
{
|
||||
return QString(QStringLiteral("file: %1, function: %2, line: %3"))
|
||||
.arg(QString::fromUtf8(file), QString::fromUtf8(function), QString::number(line));
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs an exception. \a line uses the __LINE__ macro, \a function uses
|
||||
the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
|
||||
the __FILE__ macro.
|
||||
*/
|
||||
Exception::Exception(int line, const QByteArray &function, const QByteArray &file)
|
||||
: Exception(line, function, file, Exception::defaultDescription(line, function, file))
|
||||
{ }
|
||||
|
||||
Exception::Exception(int line, const QByteArray &function,
|
||||
const QByteArray &file, const QString &description)
|
||||
: m_line(line)
|
||||
, m_function(QString::fromUtf8(function))
|
||||
, m_file(QString::fromUtf8(file))
|
||||
, m_description(description)
|
||||
#ifdef Q_OS_LINUX
|
||||
, m_backTrace(getBackTrace())
|
||||
#endif
|
||||
{
|
||||
if (s_shouldAssert) {
|
||||
qDebug() << description();
|
||||
qDebug() << Exception::description();
|
||||
QTC_ASSERT(false, ;);
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
@@ -152,7 +169,7 @@ void Exception::createWarning() const
|
||||
*/
|
||||
QString Exception::description() const
|
||||
{
|
||||
return QString(QStringLiteral("file: %1, function: %2, line: %3")).arg(m_file, m_function, QString::number(m_line));
|
||||
return m_description;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -35,6 +35,19 @@ argument.
|
||||
*/
|
||||
namespace QmlDesigner {
|
||||
|
||||
QString InvalidArgumentException::invalidArgumentDescription(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &argument)
|
||||
{
|
||||
if (QString::fromUtf8(function) == QLatin1String("createNode")) {
|
||||
return QCoreApplication::translate("QmlDesigner::InvalidArgumentException",
|
||||
"Failed to create item of type %1").arg(QString::fromUtf8(argument));
|
||||
}
|
||||
|
||||
return Exception::defaultDescription(line, function, file);
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs the exception for \a argument. \a line uses the __LINE__ macro,
|
||||
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
|
||||
@@ -44,17 +57,21 @@ InvalidArgumentException::InvalidArgumentException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &argument)
|
||||
: Exception(line, function, file), m_argument(QString::fromUtf8(argument))
|
||||
: InvalidArgumentException(line, function, file, argument,
|
||||
invalidArgumentDescription(line, function, file, argument))
|
||||
{
|
||||
createWarning();
|
||||
}
|
||||
|
||||
QString InvalidArgumentException::description() const
|
||||
InvalidArgumentException::InvalidArgumentException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &argument,
|
||||
const QString &description)
|
||||
: Exception(line, function, file, description)
|
||||
, m_argument(QString::fromUtf8(argument))
|
||||
{
|
||||
if (function() == QLatin1String("createNode"))
|
||||
return QCoreApplication::translate("QmlDesigner::InvalidArgumentException", "Failed to create item of type %1").arg(m_argument);
|
||||
|
||||
return Exception::description();
|
||||
createWarning();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -29,28 +29,40 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
InvalidIdException::InvalidIdException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &id,
|
||||
Reason reason) :
|
||||
InvalidArgumentException(line, function, file, "id"),
|
||||
m_id(QString::fromUtf8(id))
|
||||
static QString descriptionBasedOnReason(InvalidIdException::Reason reason)
|
||||
{
|
||||
if (reason == InvalidCharacters)
|
||||
m_description = QCoreApplication::translate("InvalidIdException", "Only alphanumeric characters and underscore allowed.\nIds must begin with a lowercase letter.");
|
||||
else
|
||||
m_description = QCoreApplication::translate("InvalidIdException", "Ids have to be unique.");
|
||||
if (reason == InvalidIdException::InvalidCharacters)
|
||||
return QCoreApplication::translate("InvalidIdException",
|
||||
"Only alphanumeric characters and underscore allowed.\n"
|
||||
"Ids must begin with a lowercase letter.");
|
||||
|
||||
return QCoreApplication::translate("InvalidIdException", "Ids have to be unique.");
|
||||
}
|
||||
|
||||
static QString decorateDescriptionWithId(const QString &id, const QString &description)
|
||||
{
|
||||
return QCoreApplication::translate("InvalidIdException", "Invalid Id: %1\n%2")
|
||||
.arg(id, description);
|
||||
}
|
||||
|
||||
InvalidIdException::InvalidIdException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &id,
|
||||
const QByteArray &description) :
|
||||
InvalidArgumentException(line, function, file, "id"),
|
||||
m_id(QString::fromUtf8(id)),
|
||||
m_description(QString::fromUtf8(description))
|
||||
Reason reason)
|
||||
: InvalidArgumentException(line, function, file, "id",
|
||||
decorateDescriptionWithId(QString::fromUtf8(id),
|
||||
descriptionBasedOnReason(reason)))
|
||||
{ }
|
||||
|
||||
InvalidIdException::InvalidIdException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &id,
|
||||
const QByteArray &description)
|
||||
: InvalidArgumentException(line, function, file, "id",
|
||||
decorateDescriptionWithId(QString::fromUtf8(id),
|
||||
QString::fromUtf8(description)))
|
||||
{
|
||||
createWarning();
|
||||
}
|
||||
@@ -60,9 +72,4 @@ QString InvalidIdException::type() const
|
||||
return QLatin1String("InvalidIdException");
|
||||
}
|
||||
|
||||
QString InvalidIdException::description() const
|
||||
{
|
||||
return QCoreApplication::translate("InvalidIdException", "Invalid Id: %1\n%2").arg(m_id, m_description);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@ InvalidQmlSourceException::InvalidQmlSourceException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &qmlSource)
|
||||
: Exception(line, function, file),
|
||||
m_qmlSource(QString::fromUtf8(qmlSource))
|
||||
: Exception(line, function, file, QString::fromUtf8(qmlSource))
|
||||
{
|
||||
createWarning();
|
||||
}
|
||||
@@ -56,9 +55,4 @@ QString InvalidQmlSourceException::type() const
|
||||
return QLatin1String("InvalidQmlSourceException");
|
||||
}
|
||||
|
||||
QString InvalidQmlSourceException::description() const
|
||||
{
|
||||
return m_qmlSource;
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -31,8 +31,9 @@ RewritingException::RewritingException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &description,
|
||||
const QString &documentTextContent):
|
||||
Exception(line, function, file), m_description(QString::fromUtf8(description)), m_documentTextContent(documentTextContent)
|
||||
const QString &documentTextContent)
|
||||
: Exception(line, function, file, QString::fromUtf8(description))
|
||||
, m_documentTextContent(documentTextContent)
|
||||
{
|
||||
createWarning();
|
||||
}
|
||||
@@ -42,11 +43,6 @@ QString RewritingException::type() const
|
||||
return QLatin1String("RewritingException");
|
||||
}
|
||||
|
||||
QString RewritingException::description() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
QString RewritingException::documentTextContent() const
|
||||
{
|
||||
return m_documentTextContent;
|
||||
|
||||
@@ -41,8 +41,8 @@ public:
|
||||
virtual ~Exception();
|
||||
|
||||
virtual QString type() const = 0;
|
||||
virtual QString description() const;
|
||||
virtual void showException(const QString &title = QString()) const;
|
||||
QString description() const;
|
||||
void showException(const QString &title = QString()) const;
|
||||
|
||||
int line() const;
|
||||
QString function() const;
|
||||
@@ -55,11 +55,20 @@ public:
|
||||
static bool shouldAssert();
|
||||
static bool warnAboutException();
|
||||
|
||||
protected:
|
||||
Exception(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QString &description);
|
||||
static QString defaultDescription(int line, const QByteArray &function, const QByteArray &file);
|
||||
QString defaultDescription();
|
||||
|
||||
private:
|
||||
int m_line;
|
||||
QString m_function;
|
||||
QString m_file;
|
||||
QString m_backTrace;
|
||||
const int m_line;
|
||||
const QString m_function;
|
||||
const QString m_file;
|
||||
const QString m_description;
|
||||
const QString m_backTrace;
|
||||
static bool s_shouldAssert;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,8 +40,17 @@ public:
|
||||
|
||||
QString type() const override;
|
||||
QString argument() const;
|
||||
QString description() const override;
|
||||
|
||||
protected:
|
||||
InvalidArgumentException(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &argument,
|
||||
const QString &description);
|
||||
static QString invalidArgumentDescription(int line,
|
||||
const QByteArray &function,
|
||||
const QByteArray &file,
|
||||
const QByteArray &argument);
|
||||
private:
|
||||
const QString m_argument;
|
||||
};
|
||||
|
||||
@@ -47,11 +47,6 @@ public:
|
||||
const QByteArray &description);
|
||||
|
||||
QString type() const override;
|
||||
QString description() const override;
|
||||
|
||||
private:
|
||||
QString m_id;
|
||||
QString m_description;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -38,10 +38,6 @@ public:
|
||||
const QByteArray &qmlSource = QByteArray());
|
||||
|
||||
QString type() const override;
|
||||
QString description() const override;
|
||||
|
||||
private:
|
||||
QString m_qmlSource;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -39,11 +39,10 @@ public:
|
||||
const QString &documentTextContent);
|
||||
|
||||
QString type() const override;
|
||||
QString description() const override;
|
||||
QString documentTextContent() const;
|
||||
|
||||
private:
|
||||
QString m_description;
|
||||
QString m_documentTextContent;
|
||||
const QString m_documentTextContent;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -277,11 +277,12 @@ void SubComponentManager::parseFile(const QString &canonicalFilePath, bool addTo
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return;
|
||||
|
||||
QString dir = QFileInfo(canonicalFilePath).path();
|
||||
const QFileInfo fi(canonicalFilePath);
|
||||
const QString dir = fi.path();
|
||||
foreach (const QString &qualifier, m_dirToQualifier.values(dir)) {
|
||||
registerQmlFile(canonicalFilePath, qualifier, addToLibrary);
|
||||
registerQmlFile(fi, qualifier, addToLibrary);
|
||||
}
|
||||
registerQmlFile(canonicalFilePath, qualification, addToLibrary);
|
||||
registerQmlFile(fi, qualification, addToLibrary);
|
||||
}
|
||||
|
||||
void SubComponentManager::parseFile(const QString &canonicalFilePath)
|
||||
|
||||
@@ -50,8 +50,8 @@ void DesignerSettings::fromSettings(QSettings *settings)
|
||||
|
||||
restoreValue(settings, DesignerSettingsKey::ITEMSPACING, 6);
|
||||
restoreValue(settings, DesignerSettingsKey::CONTAINERPADDING, 8);
|
||||
restoreValue(settings, DesignerSettingsKey::CANVASWIDTH, 100000);
|
||||
restoreValue(settings, DesignerSettingsKey::CANVASHEIGHT, 100000);
|
||||
restoreValue(settings, DesignerSettingsKey::CANVASWIDTH, 40000);
|
||||
restoreValue(settings, DesignerSettingsKey::CANVASHEIGHT, 40000);
|
||||
restoreValue(settings, DesignerSettingsKey::ROOT_ELEMENT_INIT_WIDTH, 640);
|
||||
restoreValue(settings, DesignerSettingsKey::ROOT_ELEMENT_INIT_HEIGHT, 480);
|
||||
restoreValue(settings, DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER, true);
|
||||
|
||||
@@ -166,15 +166,13 @@ void QmlPreviewPlugin::setLanguageLocale(const QString &locale)
|
||||
|
||||
QObject *QmlPreviewPlugin::getPreviewPlugin()
|
||||
{
|
||||
const QVector<ExtensionSystem::PluginSpec *> specs = ExtensionSystem::PluginManager::plugins();
|
||||
|
||||
auto pluginIt = std::find_if(specs.begin(),
|
||||
specs.end(),
|
||||
const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins();
|
||||
const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(),
|
||||
[](const ExtensionSystem::PluginSpec *p) {
|
||||
return p->name() == "QmlPreview";
|
||||
});
|
||||
|
||||
if (pluginIt != specs.end())
|
||||
if (pluginIt != specs.cend())
|
||||
return (*pluginIt)->plugin();
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -76,13 +76,13 @@
|
||||
namespace {
|
||||
QObject *getPreviewPlugin()
|
||||
{
|
||||
auto pluginIt = std::find_if(ExtensionSystem::PluginManager::plugins().begin(),
|
||||
ExtensionSystem::PluginManager::plugins().end(),
|
||||
const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins();
|
||||
const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(),
|
||||
[](const ExtensionSystem::PluginSpec *p) {
|
||||
return p->name() == "QmlPreview";
|
||||
});
|
||||
|
||||
if (pluginIt != ExtensionSystem::PluginManager::plugins().constEnd())
|
||||
if (pluginIt != specs.cend())
|
||||
return (*pluginIt)->plugin();
|
||||
|
||||
return nullptr;
|
||||
@@ -413,8 +413,6 @@ QString QmlDebugTranslationWidget::currentDir() const
|
||||
void QmlDebugTranslationWidget::setCurrentDir(const QString &path)
|
||||
{
|
||||
m_lastDir = path;
|
||||
const QString currentDir = m_lastDir.isEmpty() ?
|
||||
ProjectExplorer::ProjectTree::currentFilePath().parentDir().toString() : m_lastDir;
|
||||
}
|
||||
|
||||
void QmlDebugTranslationWidget::loadLogFile()
|
||||
|
||||
@@ -142,9 +142,6 @@ LocalQmlPreviewSupport::LocalQmlPreviewSupport(ProjectExplorer::RunControl *runC
|
||||
const QString mainScriptFromProject = qmlBuildSystem->targetFile(
|
||||
Utils::FilePath::fromString(mainScript)).toString();
|
||||
|
||||
const QString currentFileFromProject = qmlBuildSystem->targetFile(
|
||||
Utils::FilePath::fromString(currentFile)).toString();
|
||||
|
||||
if (!currentFile.isEmpty() && qmlProjectRunConfigurationArguments.last().contains(mainScriptFromProject)) {
|
||||
qmlProjectRunConfigurationArguments.removeLast();
|
||||
auto commandLine = Utils::CommandLine(runnable.commandLine().executable(), qmlProjectRunConfigurationArguments);
|
||||
|
||||
@@ -35,13 +35,12 @@
|
||||
|
||||
static bool isMultilanguagePresent()
|
||||
{
|
||||
const QVector<ExtensionSystem::PluginSpec *> specs = ExtensionSystem::PluginManager::plugins();
|
||||
return std::find_if(specs.begin(),
|
||||
specs.end(),
|
||||
const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins();
|
||||
return std::find_if(specs.cbegin(), specs.cend(),
|
||||
[](ExtensionSystem::PluginSpec *spec) {
|
||||
return spec->name() == "MultiLanguage";
|
||||
})
|
||||
!= specs.end();
|
||||
!= specs.cend();
|
||||
}
|
||||
|
||||
static Utils::FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target *target)
|
||||
@@ -57,13 +56,13 @@ static Utils::FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target
|
||||
|
||||
static QObject *getPreviewPlugin()
|
||||
{
|
||||
auto pluginIt = std::find_if(ExtensionSystem::PluginManager::plugins().begin(),
|
||||
ExtensionSystem::PluginManager::plugins().end(),
|
||||
const QVector<ExtensionSystem::PluginSpec *> &specs = ExtensionSystem::PluginManager::plugins();
|
||||
const auto pluginIt = std::find_if(specs.cbegin(), specs.cend(),
|
||||
[](const ExtensionSystem::PluginSpec *p) {
|
||||
return p->name() == "QmlPreview";
|
||||
});
|
||||
|
||||
if (pluginIt != ExtensionSystem::PluginManager::plugins().constEnd())
|
||||
if (pluginIt != specs.cend())
|
||||
return (*pluginIt)->plugin();
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -793,7 +793,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
|
||||
if (iconFileExtension(path))
|
||||
file->icon = QIcon(path);
|
||||
else
|
||||
file->icon = Core::FileIconProvider::icon(path);
|
||||
file->icon = Core::FileIconProvider::icon(QFileInfo(path));
|
||||
}
|
||||
if (!file->icon.isNull())
|
||||
result = file->icon;
|
||||
|
||||
@@ -244,7 +244,7 @@ ResourceTopLevelNode::ResourceTopLevelNode(const FilePath &filePath,
|
||||
const QString &contents)
|
||||
: FolderNode(filePath)
|
||||
{
|
||||
setIcon(FileIconProvider::icon(filePath.toString()));
|
||||
setIcon(FileIconProvider::icon(filePath.toFileInfo()));
|
||||
setPriority(Node::DefaultFilePriority);
|
||||
setListInProject(true);
|
||||
setAddFileFilter("*.png; *.jpg; *.gif; *.svg; *.ico; *.qml; *.qml.ui");
|
||||
|
||||
@@ -130,7 +130,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
|
||||
d->m_checkUpdatesCommand->setDisplayName(tr("Checking for Updates"));
|
||||
connect(d->m_checkUpdatesCommand, &ShellCommand::stdOutText, this, &UpdateInfoPlugin::collectCheckForUpdatesOutput);
|
||||
connect(d->m_checkUpdatesCommand, &ShellCommand::finished, this, &UpdateInfoPlugin::checkForUpdatesFinished);
|
||||
d->m_checkUpdatesCommand->addJob({Utils::FilePath::fromFileInfo(d->m_maintenanceTool), {"--checkupdates"}},
|
||||
d->m_checkUpdatesCommand->addJob({Utils::FilePath::fromString(d->m_maintenanceTool), {"--checkupdates"}},
|
||||
60 * 3, // 3 minutes timeout
|
||||
/*workingDirectory=*/QString(),
|
||||
[](int /*exitCode*/) { return Utils::SynchronousProcessResponse::Finished; });
|
||||
|
||||
@@ -824,6 +824,7 @@ void MemcheckToolPrivate::heobAction()
|
||||
if (!commandLineArguments.isEmpty())
|
||||
arguments += ' ' + commandLineArguments;
|
||||
QByteArray argumentsCopy(reinterpret_cast<const char *>(arguments.utf16()), arguments.size() * 2 + 2);
|
||||
Q_UNUSED(argumentsCopy)
|
||||
|
||||
// process environment
|
||||
QByteArray env;
|
||||
|
||||
Reference in New Issue
Block a user