Merge remote-tracking branch 'origin/5.0'

Change-Id: I66f81270c7dcd5a2fa00e6063c2b46b53ab9f39d
This commit is contained in:
Eike Ziller
2021-07-09 16:07:44 +02:00
27 changed files with 111 additions and 67 deletions

View File

@@ -152,7 +152,8 @@ constexpr char onlyKey[] = "only";
constexpr char openCloseKey[] = "openClose"; constexpr char openCloseKey[] = "openClose";
constexpr char optionsKey[] = "options"; constexpr char optionsKey[] = "options";
constexpr char overlappingTokenSupportKey[] = "overlappingTokenSupport"; constexpr char overlappingTokenSupportKey[] = "overlappingTokenSupport";
constexpr char parametersKey[] = "params"; constexpr char parametersKey[] = "parameters";
constexpr char paramsKey[] = "params";
constexpr char patternKey[] = "pattern"; constexpr char patternKey[] = "pattern";
constexpr char percentageKey[] = "percentage"; constexpr char percentageKey[] = "percentage";
constexpr char placeHolderKey[] = "placeHolder"; constexpr char placeHolderKey[] = "placeHolder";

View File

@@ -104,12 +104,12 @@ public:
Utils::optional<Params> params() const Utils::optional<Params> params() const
{ {
const QJsonValue &params = m_jsonObject.value(parametersKey); const QJsonValue &params = m_jsonObject.value(paramsKey);
return params.isUndefined() ? Utils::nullopt : Utils::make_optional(Params(params)); return params.isUndefined() ? Utils::nullopt : Utils::make_optional(Params(params));
} }
void setParams(const Params &params) void setParams(const Params &params)
{ m_jsonObject.insert(parametersKey, QJsonValue(params)); } { m_jsonObject.insert(paramsKey, QJsonValue(params)); }
void clearParams() { m_jsonObject.remove(parametersKey); } void clearParams() { m_jsonObject.remove(paramsKey); }
bool isValid(QString *errorMessage) const override bool isValid(QString *errorMessage) const override
{ {
@@ -149,8 +149,8 @@ public:
Utils::optional<std::nullptr_t> params() const Utils::optional<std::nullptr_t> params() const
{ return nullptr; } { return nullptr; }
void setParams(const std::nullptr_t &/*params*/) void setParams(const std::nullptr_t &/*params*/)
{ m_jsonObject.insert(parametersKey, QJsonValue::Null); } { m_jsonObject.insert(paramsKey, QJsonValue::Null); }
void clearParams() { m_jsonObject.remove(parametersKey); } void clearParams() { m_jsonObject.remove(paramsKey); }
bool isValid(QString *errorMessage) const override bool isValid(QString *errorMessage) const override
{ {

View File

@@ -967,11 +967,11 @@ QList<FilePath> FilePath::dirEntries(QDir::Filters filters) const
return dirEntries({}, filters); return dirEntries({}, filters);
} }
QByteArray FilePath::fileContents(int maxSize) const QByteArray FilePath::fileContents(qint64 maxSize, qint64 offset) const
{ {
if (needsDevice()) { if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.fileContents, return {}); QTC_ASSERT(s_deviceHooks.fileContents, return {});
return s_deviceHooks.fileContents(*this, maxSize); return s_deviceHooks.fileContents(*this, maxSize, offset);
} }
const QString path = toString(); const QString path = toString();
@@ -982,6 +982,9 @@ QByteArray FilePath::fileContents(int maxSize) const
if (!f.open(QFile::ReadOnly)) if (!f.open(QFile::ReadOnly))
return {}; return {};
if (offset != 0)
f.seek(offset);
if (maxSize != -1) if (maxSize != -1)
return f.read(maxSize); return f.read(maxSize);

View File

@@ -89,7 +89,7 @@ public:
std::function<FilePath(const FilePath &)> symLinkTarget; std::function<FilePath(const FilePath &)> symLinkTarget;
std::function<QList<FilePath>(const FilePath &, const QStringList &, std::function<QList<FilePath>(const FilePath &, const QStringList &,
QDir::Filters, QDir::SortFlags)> dirEntries; QDir::Filters, QDir::SortFlags)> dirEntries;
std::function<QByteArray(const FilePath &, int)> fileContents; std::function<QByteArray(const FilePath &, qint64, qint64)> fileContents;
std::function<bool(const FilePath &, const QByteArray &)> writeFileContents; std::function<bool(const FilePath &, const QByteArray &)> writeFileContents;
std::function<QDateTime(const FilePath &)> lastModified; std::function<QDateTime(const FilePath &)> lastModified;
std::function<QFile::Permissions(const FilePath &)> permissions; std::function<QFile::Permissions(const FilePath &)> permissions;
@@ -155,7 +155,7 @@ public:
QDir::Filters filters, QDir::Filters filters,
QDir::SortFlags sort = QDir::NoSort) const; QDir::SortFlags sort = QDir::NoSort) const;
QList<FilePath> dirEntries(QDir::Filters filters) const; QList<FilePath> dirEntries(QDir::Filters filters) const;
QByteArray fileContents(int maxSize = -1) const; QByteArray fileContents(qint64 maxSize = -1, qint64 offset = 0) const;
bool writeFileContents(const QByteArray &data) const; bool writeFileContents(const QByteArray &data) const;
FilePath parentDir() const; FilePath parentDir() const;

View File

@@ -34,6 +34,8 @@ namespace Internal {
class BazaarSettings final : public VcsBase::VcsBaseSettings class BazaarSettings final : public VcsBase::VcsBaseSettings
{ {
Q_DECLARE_TR_FUNCTIONS(Bazaar::Internal::BazaarSettings)
public: public:
BazaarSettings(); BazaarSettings();

View File

@@ -72,7 +72,7 @@ CMakeSpecificSettings::CMakeSpecificSettings()
CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *settings) CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *settings)
{ {
setId("CMakeSpecificSettings"); setId("CMakeSpecificSettings");
setDisplayName(CMakeSpecificSettings::tr("CMake")); setDisplayName(::CMakeProjectManager::Internal::CMakeSpecificSettings::tr("CMake"));
setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
setSettings(settings); setSettings(settings);
@@ -81,7 +81,7 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *sett
using namespace Layouting; using namespace Layouting;
Column { Column {
Group { Group {
Title(CMakeSpecificSettings::tr("Adding Files")), Title(::CMakeProjectManager::Internal::CMakeSpecificSettings::tr("Adding Files")),
s.afterAddFileSetting s.afterAddFileSetting
}, },
s.packageManagerAutoSetup, s.packageManagerAutoSetup,

View File

@@ -64,7 +64,7 @@ FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(FileShareProtocolSe
setLayouter([&s = *settings](QWidget *widget) { setLayouter([&s = *settings](QWidget *widget) {
using namespace Layouting; using namespace Layouting;
auto label = new QLabel(FileShareProtocolSettingsPage::tr( auto label = new QLabel(FileShareProtocolSettings::tr(
"The fileshare-based paster protocol allows for sharing code snippets using " "The fileshare-based paster protocol allows for sharing code snippets using "
"simple files on a shared network drive. Files are never deleted.")); "simple files on a shared network drive. Files are never deleted."));
label->setWordWrap(true); label->setWordWrap(true);

View File

@@ -48,6 +48,8 @@ const char DEFAULT_DOCKER_COMMAND[] = "run --read-only --rm %{BuildDevice:Docker
class DockerBuildStep : public AbstractProcessStep class DockerBuildStep : public AbstractProcessStep
{ {
Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerBuildStep)
public: public:
DockerBuildStep(BuildStepList *bsl, Id id) DockerBuildStep(BuildStepList *bsl, Id id)
: AbstractProcessStep(bsl, id) : AbstractProcessStep(bsl, id)

View File

@@ -1064,12 +1064,12 @@ FilePaths DockerDevice::directoryEntries(const FilePath &filePath,
return {}; return {};
} }
QByteArray DockerDevice::fileContents(const FilePath &filePath, int limit) const QByteArray DockerDevice::fileContents(const FilePath &filePath, qint64 limit, qint64 offset) const
{ {
QTC_ASSERT(handlesFile(filePath), return {}); QTC_ASSERT(handlesFile(filePath), return {});
tryCreateLocalFileAccess(); tryCreateLocalFileAccess();
if (hasLocalFileAccess()) if (hasLocalFileAccess())
return mapToLocalAccess(filePath).fileContents(limit); return mapToLocalAccess(filePath).fileContents(limit, offset);
QTC_CHECK(false); // FIXME: Implement QTC_CHECK(false); // FIXME: Implement
return {}; return {};
@@ -1203,7 +1203,7 @@ public:
DockerDeviceSetupWizard() DockerDeviceSetupWizard()
: QDialog(ICore::dialogParent()) : QDialog(ICore::dialogParent())
{ {
setWindowTitle(tr("Docker Image Selection")); setWindowTitle(DockerDevice::tr("Docker Image Selection"));
resize(800, 600); resize(800, 600);
m_model.setHeader({"Image", "Repository", "Tag", "Size"}); m_model.setHeader({"Image", "Repository", "Tag", "Size"});
@@ -1232,7 +1232,7 @@ public:
m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false); m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
CommandLine cmd{"docker", {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}}; CommandLine cmd{"docker", {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}};
m_log->append(tr("Running \"%1\"\n").arg(cmd.toUserOutput())); m_log->append(DockerDevice::tr("Running \"%1\"\n").arg(cmd.toUserOutput()));
m_process = new QtcProcess(this); m_process = new QtcProcess(this);
m_process->setCommand(cmd); m_process->setCommand(cmd);
@@ -1243,7 +1243,7 @@ public:
for (const QString &line : out.split('\n')) { for (const QString &line : out.split('\n')) {
const QStringList parts = line.trimmed().split('\t'); const QStringList parts = line.trimmed().split('\t');
if (parts.size() != 4) { if (parts.size() != 4) {
m_log->append(tr("Unexpected result: %1").arg(line) + '\n'); m_log->append(DockerDevice::tr("Unexpected result: %1").arg(line) + '\n');
continue; continue;
} }
auto item = new DockerImageItem; auto item = new DockerImageItem;
@@ -1253,12 +1253,12 @@ public:
item->size = parts.at(3); item->size = parts.at(3);
m_model.rootItem()->appendChild(item); m_model.rootItem()->appendChild(item);
} }
m_log->append(tr("Done.")); m_log->append(DockerDevice::tr("Done."));
}); });
connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] { connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] {
const QString out = tr("Error: %1").arg(m_process->stdErr()); const QString out = DockerDevice::tr("Error: %1").arg(m_process->stdErr());
m_log->append(tr("Error: %1").arg(out)); m_log->append(DockerDevice::tr("Error: %1").arg(out));
}); });
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, [this] { connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, [this] {

View File

@@ -44,7 +44,7 @@ public:
QString tag; QString tag;
QString size; QString size;
bool useLocalUidGid = true; bool useLocalUidGid = true;
QStringList mounts = {"/opt", "/data"}; QStringList mounts;
}; };
class DockerDevice : public ProjectExplorer::IDevice class DockerDevice : public ProjectExplorer::IDevice
@@ -93,7 +93,7 @@ public:
const QStringList &nameFilters, const QStringList &nameFilters,
QDir::Filters filters, QDir::Filters filters,
QDir::SortFlags sort) const override; QDir::SortFlags sort) const override;
QByteArray fileContents(const Utils::FilePath &filePath, int limit) const override; QByteArray fileContents(const Utils::FilePath &filePath, qint64 limit, qint64 offset) const override;
bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const override; bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const override;
QDateTime lastModified(const Utils::FilePath &filePath) const override; QDateTime lastModified(const Utils::FilePath &filePath) const override;
void runProcess(Utils::QtcProcess &process) const override; void runProcess(Utils::QtcProcess &process) const override;

View File

@@ -35,6 +35,8 @@ namespace Internal {
class DockerSettings : public Utils::AspectContainer class DockerSettings : public Utils::AspectContainer
{ {
Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerSettings)
public: public:
DockerSettings(); DockerSettings();
static DockerSettings *instance(); static DockerSettings *instance();

View File

@@ -248,6 +248,7 @@ class LanguageClientCompletionModel : public GenericProposalModel
{ {
public: public:
// GenericProposalModel interface // GenericProposalModel interface
bool containsDuplicates() const override { return false; }
bool isSortable(const QString &/*prefix*/) const override { return true; } bool isSortable(const QString &/*prefix*/) const override { return true; }
void sort(const QString &/*prefix*/) override; void sort(const QString &/*prefix*/) override;
bool supportsPrefixExpansion() const override { return false; } bool supportsPrefixExpansion() const override { return false; }

View File

@@ -34,6 +34,8 @@ namespace Internal {
class MercurialSettings : public VcsBase::VcsBaseSettings class MercurialSettings : public VcsBase::VcsBaseSettings
{ {
Q_DECLARE_TR_FUNCTIONS(Mercurial::Internal::MercurialSettings)
public: public:
Utils::StringAspect diffIgnoreWhiteSpace; Utils::StringAspect diffIgnoreWhiteSpace;
Utils::StringAspect diffIgnoreBlankLines; Utils::StringAspect diffIgnoreBlankLines;

View File

@@ -254,7 +254,8 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings)
connect(checker, &PerforceChecker::succeeded, errorLabel, connect(checker, &PerforceChecker::succeeded, errorLabel,
[errorLabel, testButton, checker](const QString &repo) { [errorLabel, testButton, checker](const QString &repo) {
errorLabel->setStyleSheet({}); errorLabel->setStyleSheet({});
errorLabel->setText(tr("Test succeeded (%1).").arg(QDir::toNativeSeparators(repo))); errorLabel->setText(PerforceSettings::tr("Test succeeded (%1).")
.arg(QDir::toNativeSeparators(repo)));
testButton->setEnabled(true); testButton->setEnabled(true);
checker->deleteLater(); checker->deleteLater();
}); });

View File

@@ -31,7 +31,6 @@
#include <QDebug> #include <QDebug>
#include <QtEndian> #include <QtEndian>
#include <QFile>
#include <QRegularExpression> #include <QRegularExpression>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
@@ -1168,9 +1167,6 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path)
&& getUint8(data, 6) == '>' && getUint8(data, 7) == 0x0a) { && getUint8(data, 6) == '>' && getUint8(data, 7) == 0x0a) {
// We got an ar file: possibly a static lib for ELF, PE or Mach-O // We got an ar file: possibly a static lib for ELF, PE or Mach-O
QFile f(path.toString());
const bool canRead = f.open(QFile::ReadOnly);
data = data.mid(8); // Cut of ar file magic data = data.mid(8); // Cut of ar file magic
quint64 offset = 8; quint64 offset = 8;
@@ -1196,14 +1192,8 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path)
if (!tmp.isEmpty() && tmp.at(0).binaryFormat() != MachOFormat) if (!tmp.isEmpty() && tmp.at(0).binaryFormat() != MachOFormat)
break; break;
if (!canRead) {
// FIXME: Implement remote
QTC_ASSERT(!path.needsDevice(), return {});
}
offset += (offset % 2); // ar is 2 byte aligned offset += (offset % 2); // ar is 2 byte aligned
f.seek(offset); data = path.fileContents(1024, offset);
data = f.read(1024);
} }
} else { } else {
tmp = abiOf(data); tmp = abiOf(data);

View File

@@ -280,10 +280,10 @@ FilePath DesktopDevice::symLinkTarget(const FilePath &filePath) const
return filePath.symLinkTarget(); return filePath.symLinkTarget();
} }
QByteArray DesktopDevice::fileContents(const FilePath &filePath, int limit) const QByteArray DesktopDevice::fileContents(const FilePath &filePath, qint64 limit, qint64 offset) const
{ {
QTC_ASSERT(handlesFile(filePath), return {}); QTC_ASSERT(handlesFile(filePath), return {});
return filePath.fileContents(limit); return filePath.fileContents(limit, offset);
} }
bool DesktopDevice::writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const bool DesktopDevice::writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const

View File

@@ -75,7 +75,7 @@ public:
bool renameFile(const Utils::FilePath &filePath, const Utils::FilePath &target) const override; bool renameFile(const Utils::FilePath &filePath, const Utils::FilePath &target) const override;
QDateTime lastModified(const Utils::FilePath &filePath) const override; QDateTime lastModified(const Utils::FilePath &filePath) const override;
Utils::FilePath symLinkTarget(const Utils::FilePath &filePath) const override; Utils::FilePath symLinkTarget(const Utils::FilePath &filePath) const override;
QByteArray fileContents(const Utils::FilePath &filePath, int limit) const override; QByteArray fileContents(const Utils::FilePath &filePath, qint64 limit, qint64 offset) const override;
bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const override; bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const override;
protected: protected:

View File

@@ -477,10 +477,10 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager
return device->directoryEntries(filePath, nameFilters, filters, sort); return device->directoryEntries(filePath, nameFilters, filters, sort);
}; };
deviceHooks.fileContents = [](const FilePath &filePath, int maxSize) { deviceHooks.fileContents = [](const FilePath &filePath, qint64 maxSize, qint64 offset) {
auto device = DeviceManager::deviceForPath(filePath); auto device = DeviceManager::deviceForPath(filePath);
QTC_ASSERT(device, return QByteArray()); QTC_ASSERT(device, return QByteArray());
return device->fileContents(filePath, maxSize); return device->fileContents(filePath, maxSize, offset);
}; };
deviceHooks.writeFileContents = [](const FilePath &filePath, const QByteArray &data) { deviceHooks.writeFileContents = [](const FilePath &filePath, const QByteArray &data) {

View File

@@ -353,7 +353,7 @@ QList<FilePath> IDevice::directoryEntries(const FilePath &filePath,
return {}; return {};
} }
QByteArray IDevice::fileContents(const FilePath &filePath, int limit) const QByteArray IDevice::fileContents(const FilePath &filePath, qint64 limit, qint64 offset) const
{ {
Q_UNUSED(filePath); Q_UNUSED(filePath);
Q_UNUSED(limit); Q_UNUSED(limit);

View File

@@ -257,7 +257,9 @@ public:
const QStringList &nameFilters, const QStringList &nameFilters,
QDir::Filters filters, QDir::Filters filters,
QDir::SortFlags sort = QDir::NoSort) const; QDir::SortFlags sort = QDir::NoSort) const;
virtual QByteArray fileContents(const Utils::FilePath &filePath, int limit) const; virtual QByteArray fileContents(const Utils::FilePath &filePath,
qint64 limit,
qint64 offset) const;
virtual bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const; virtual bool writeFileContents(const Utils::FilePath &filePath, const QByteArray &data) const;
virtual QDateTime lastModified(const Utils::FilePath &filePath) const; virtual QDateTime lastModified(const Utils::FilePath &filePath) const;
virtual QFile::Permissions permissions(const Utils::FilePath &filePath) const; virtual QFile::Permissions permissions(const Utils::FilePath &filePath) const;

View File

@@ -121,7 +121,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow()
m_filterActionRegexp = new QAction(this); m_filterActionRegexp = new QAction(this);
m_filterActionRegexp->setCheckable(true); m_filterActionRegexp->setCheckable(true);
m_filterActionRegexp->setText(tr("Use Regular Expressions")); m_filterActionRegexp->setText(ProjectWindow::tr("Use Regular Expressions"));
connect(m_filterActionRegexp, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter); connect(m_filterActionRegexp, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter);
Core::ActionManager::registerAction(m_filterActionRegexp, Core::ActionManager::registerAction(m_filterActionRegexp,
kRegExpActionId, kRegExpActionId,
@@ -129,7 +129,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow()
m_filterActionCaseSensitive = new QAction(this); m_filterActionCaseSensitive = new QAction(this);
m_filterActionCaseSensitive->setCheckable(true); m_filterActionCaseSensitive->setCheckable(true);
m_filterActionCaseSensitive->setText(tr("Case Sensitive")); m_filterActionCaseSensitive->setText(ProjectWindow::tr("Case Sensitive"));
connect(m_filterActionCaseSensitive, connect(m_filterActionCaseSensitive,
&QAction::toggled, &QAction::toggled,
this, this,
@@ -140,7 +140,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow()
m_invertFilterAction = new QAction(this); m_invertFilterAction = new QAction(this);
m_invertFilterAction->setCheckable(true); m_invertFilterAction->setCheckable(true);
m_invertFilterAction->setText(tr("Show Non-matching Lines")); m_invertFilterAction->setText(ProjectWindow::tr("Show Non-matching Lines"));
connect(m_invertFilterAction, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter); connect(m_invertFilterAction, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter);
Core::ActionManager::registerAction(m_invertFilterAction, Core::ActionManager::registerAction(m_invertFilterAction,
kInvertActionId, kInvertActionId,

View File

@@ -100,7 +100,8 @@ void MetaInfoReader::elementStart(const QString &name)
case ParsingHints: case ParsingHints:
case Finished: case Finished:
case Undefined: setParserState(Error); case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing."), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."),
currentSourceLocation());
case Error: case Error:
default: return; default: return;
} }
@@ -120,7 +121,8 @@ void MetaInfoReader::elementEnd()
case ParsingDocument: case ParsingDocument:
case Finished: case Finished:
case Undefined: setParserState(Error); case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing."), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."),
currentSourceLocation());
case Error: case Error:
default: return; default: return;
} }
@@ -135,12 +137,16 @@ void MetaInfoReader::propertyDefinition(const QString &name, const QVariant &val
case ParsingProperty: readPropertyProperty(name, value); break; case ParsingProperty: readPropertyProperty(name, value); break;
case ParsingQmlSource: readQmlSourceProperty(name, value); break; case ParsingQmlSource: readQmlSourceProperty(name, value); break;
case ParsingExtraFile: readExtraFileProperty(name, value); break; case ParsingExtraFile: readExtraFileProperty(name, value); break;
case ParsingMetaInfo: addError(tr("No property definition allowed."), currentSourceLocation()); break; case ParsingMetaInfo:
addError(::QmlDesigner::Internal::MetaInfoReader::tr("No property definition allowed."),
currentSourceLocation());
break;
case ParsingDocument: case ParsingDocument:
case ParsingHints: readHint(name, value); break; case ParsingHints: readHint(name, value); break;
case Finished: case Finished:
case Undefined: setParserState(Error); case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing."), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."),
currentSourceLocation());
case Error: case Error:
default: return; default: return;
} }
@@ -203,26 +209,30 @@ MetaInfoReader::ParserSate MetaInfoReader::readItemLibraryEntryElement(const QSt
} else if (name == ExtraFileElementName) { } else if (name == ExtraFileElementName) {
return ParsingExtraFile; return ParsingExtraFile;
} else { } else {
addError(tr("Invalid type %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error; return Error;
} }
} }
MetaInfoReader::ParserSate MetaInfoReader::readPropertyElement(const QString &name) MetaInfoReader::ParserSate MetaInfoReader::readPropertyElement(const QString &name)
{ {
addError(tr("Invalid type %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error; return Error;
} }
MetaInfoReader::ParserSate MetaInfoReader::readQmlSourceElement(const QString &name) MetaInfoReader::ParserSate MetaInfoReader::readQmlSourceElement(const QString &name)
{ {
addError(tr("Invalid type %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error; return Error;
} }
MetaInfoReader::ParserSate MetaInfoReader::readExtraFileElement(const QString &name) MetaInfoReader::ParserSate MetaInfoReader::readExtraFileElement(const QString &name)
{ {
addError(tr("Invalid type %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error; return Error;
} }
@@ -237,7 +247,9 @@ void MetaInfoReader::readImportsProperty(const QString &name, const QVariant &va
// imports to keep compatibility with old metainfo files. // imports to keep compatibility with old metainfo files.
m_metaInfo.itemLibraryInfo()->addPriorityImports(Utils::toSet(values)); m_metaInfo.itemLibraryInfo()->addPriorityImports(Utils::toSet(values));
} else { } else {
addError(tr("Unknown property for Imports %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Imports %1")
.arg(name),
currentSourceLocation());
setParserState(Error); setParserState(Error);
} }
} }
@@ -251,7 +263,9 @@ void MetaInfoReader::readTypeProperty(const QString &name, const QVariant &value
} else if (name == QStringLiteral("icon")) { } else if (name == QStringLiteral("icon")) {
m_currentIcon = absoluteFilePathForDocument(value.toString()); m_currentIcon = absoluteFilePathForDocument(value.toString());
} else { } else {
addError(tr("Unknown property for Type %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Type %1")
.arg(name),
currentSourceLocation());
setParserState(Error); setParserState(Error);
} }
} }
@@ -269,7 +283,10 @@ void MetaInfoReader::readItemLibraryEntryProperty(const QString &name, const QVa
} else if (name == QStringLiteral("requiredImport")) { } else if (name == QStringLiteral("requiredImport")) {
m_currentEntry.setRequiredImport(value.toString()); m_currentEntry.setRequiredImport(value.toString());
} else { } else {
addError(tr("Unknown property for ItemLibraryEntry %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr(
"Unknown property for ItemLibraryEntry %1")
.arg(name),
currentSourceLocation());
setParserState(Error); setParserState(Error);
} }
} }
@@ -299,7 +316,9 @@ void MetaInfoReader::readPropertyProperty(const QString &name, const QVariant &v
} else if (name == QStringLiteral("value")) { } else if (name == QStringLiteral("value")) {
m_currentPropertyValue = deEscapeVariant(value); m_currentPropertyValue = deEscapeVariant(value);
} else { } else {
addError(tr("Unknown property for Property %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Property %1")
.arg(name),
currentSourceLocation());
setParserState(Error); setParserState(Error);
} }
} }
@@ -309,7 +328,9 @@ void MetaInfoReader::readQmlSourceProperty(const QString &name, const QVariant &
if (name == QLatin1String("source")) { if (name == QLatin1String("source")) {
m_currentEntry.setQmlPath(absoluteFilePathForDocument(value.toString())); m_currentEntry.setQmlPath(absoluteFilePathForDocument(value.toString()));
} else { } else {
addError(tr("Unknown property for QmlSource %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for QmlSource %1")
.arg(name),
currentSourceLocation());
setParserState(Error); setParserState(Error);
} }
} }
@@ -319,7 +340,9 @@ void MetaInfoReader::readExtraFileProperty(const QString &name, const QVariant &
if (name == QLatin1String("source")) { if (name == QLatin1String("source")) {
m_currentEntry.addExtraFilePath(absoluteFilePathForDocument(value.toString())); m_currentEntry.addExtraFilePath(absoluteFilePathForDocument(value.toString()));
} else { } else {
addError(tr("Unknown property for ExtraFile %1").arg(name), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for ExtraFile %1")
.arg(name),
currentSourceLocation());
setParserState(Error); setParserState(Error);
} }
} }
@@ -366,7 +389,10 @@ void MetaInfoReader::syncItemLibraryEntries()
try { try {
m_metaInfo.itemLibraryInfo()->addEntries(m_bufferedEntries, m_overwriteDuplicates); m_metaInfo.itemLibraryInfo()->addEntries(m_bufferedEntries, m_overwriteDuplicates);
} catch (const InvalidMetaInfoException &) { } catch (const InvalidMetaInfoException &) {
addError(tr("Invalid or duplicate library entry %1").arg(m_currentEntry.name()), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr(
"Invalid or duplicate library entry %1")
.arg(m_currentEntry.name()),
currentSourceLocation());
} }
m_bufferedEntries.clear(); m_bufferedEntries.clear();
} }
@@ -383,7 +409,8 @@ void MetaInfoReader::insertProperty()
void MetaInfoReader::addErrorInvalidType(const QString &typeName) void MetaInfoReader::addErrorInvalidType(const QString &typeName)
{ {
addError(tr("Invalid type %1").arg(typeName), currentSourceLocation()); addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(typeName),
currentSourceLocation());
} }
QString MetaInfoReader::absoluteFilePathForDocument(const QString &relativeFilePath) QString MetaInfoReader::absoluteFilePathForDocument(const QString &relativeFilePath)

View File

@@ -407,7 +407,7 @@ void SubComponentManager::parseQuick3DAssetsItem(const QString &importUrl, const
ItemLibraryEntry itemLibraryEntry; ItemLibraryEntry itemLibraryEntry;
itemLibraryEntry.setType(type.toUtf8(), 1, 0); itemLibraryEntry.setType(type.toUtf8(), 1, 0);
itemLibraryEntry.setName(name); itemLibraryEntry.setName(name);
itemLibraryEntry.setCategory(tr("My 3D Components")); itemLibraryEntry.setCategory(::QmlDesigner::SubComponentManager::tr("My 3D Components"));
itemLibraryEntry.setRequiredImport(importUrl); itemLibraryEntry.setRequiredImport(importUrl);
QString iconPath = qmlIt.fileInfo().absolutePath() + '/' QString iconPath = qmlIt.fileInfo().absolutePath() + '/'
+ Constants::QUICK_3D_ASSET_ICON_DIR + '/' + name + Constants::QUICK_3D_ASSET_ICON_DIR + '/' + name

View File

@@ -70,9 +70,9 @@ QString DocumentMessage::toString() const
QString str; QString str;
if (m_type == ParseError) if (m_type == ParseError)
str += tr("Error parsing"); str += ::QmlDesigner::DocumentMessage::tr("Error parsing");
else if (m_type == InternalError) else if (m_type == InternalError)
str += tr("Internal error"); str += ::QmlDesigner::DocumentMessage::tr("Internal error");
if (url().isValid()) { if (url().isValid()) {
if (!str.isEmpty()) if (!str.isEmpty())
@@ -84,14 +84,14 @@ QString DocumentMessage::toString() const
if (line() != -1) { if (line() != -1) {
if (!str.isEmpty()) if (!str.isEmpty())
str += QLatin1Char(' '); str += QLatin1Char(' ');
str += tr("line %1").arg(line()); str += ::QmlDesigner::DocumentMessage::tr("line %1").arg(line());
} }
if (column() != -1) { if (column() != -1) {
if (!str.isEmpty()) if (!str.isEmpty())
str += QLatin1Char(' '); str += QLatin1Char(' ');
str += tr("column %1").arg(column()); str += ::QmlDesigner::DocumentMessage::tr("column %1").arg(column());
} }
if (!str.isEmpty()) if (!str.isEmpty())

View File

@@ -26,7 +26,7 @@
#include "remotelinuxkillappservice.h" #include "remotelinuxkillappservice.h"
#include <utils/fileutils.h> #include <utils/fileutils.h>
#
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
class RemoteLinuxKillAppServicePrivate class RemoteLinuxKillAppServicePrivate

View File

@@ -40,6 +40,8 @@ class SuppressionAspectPrivate;
class SuppressionAspect final : public Utils::BaseAspect class SuppressionAspect final : public Utils::BaseAspect
{ {
Q_DECLARE_TR_FUNCTIONS(Valgrind::Internal::SuppressionAspect)
public: public:
explicit SuppressionAspect(bool global); explicit SuppressionAspect(bool global);
~SuppressionAspect() final; ~SuppressionAspect() final;

View File

@@ -350,6 +350,15 @@ inline ProStringList operator+(const ProStringList &one, const ProStringList &tw
typedef QMap<ProKey, ProStringList> ProValueMap; typedef QMap<ProKey, ProStringList> ProValueMap;
// For std::list (sic!)
#ifdef Q_CC_MSVC
inline bool operator<(const ProValueMap &, const ProValueMap &)
{
Q_ASSERT(false);
return false;
}
#endif
// These token definitions affect both ProFileEvaluator and ProWriter // These token definitions affect both ProFileEvaluator and ProWriter
enum ProToken { enum ProToken {
TokTerminator = 0, // end of stream (possibly not included in length; must be zero) TokTerminator = 0, // end of stream (possibly not included in length; must be zero)