forked from qt-creator/qt-creator
Compile fix with recent Qt dev
The reasoning in 1b4766e26c
did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.
Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -587,13 +587,8 @@ QList<ServerNodeInstance> NodeInstanceServer::setupInstances(const CreateSceneCo
|
|||||||
setInstanceAuxiliaryData(container);
|
setInstanceAuxiliaryData(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = instanceList.size(); --i >= 0; )
|
||||||
QListIterator<ServerNodeInstance> instanceListIterator(instanceList);
|
instanceList[i].doComponentComplete();
|
||||||
instanceListIterator.toBack();
|
|
||||||
while (instanceListIterator.hasPrevious()) {
|
|
||||||
ServerNodeInstance instance = instanceListIterator.previous();
|
|
||||||
instance.doComponentComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
return instanceList;
|
return instanceList;
|
||||||
}
|
}
|
||||||
|
@@ -581,18 +581,14 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
|
|||||||
accept(ast->expression);
|
accept(ast->expression);
|
||||||
unsigned unaryOp = tokenKind(ast->unary_op_token);
|
unsigned unaryOp = tokenKind(ast->unary_op_token);
|
||||||
if (unaryOp == T_AMPER) {
|
if (unaryOp == T_AMPER) {
|
||||||
QMutableListIterator<LookupItem > it(_results);
|
for (LookupItem &p : _results) {
|
||||||
while (it.hasNext()) {
|
|
||||||
LookupItem p = it.next();
|
|
||||||
FullySpecifiedType ty = p.type();
|
FullySpecifiedType ty = p.type();
|
||||||
ty.setType(control()->pointerType(ty));
|
ty.setType(control()->pointerType(ty));
|
||||||
p.setType(ty);
|
p.setType(ty);
|
||||||
it.setValue(p);
|
|
||||||
}
|
}
|
||||||
} else if (unaryOp == T_STAR) {
|
} else if (unaryOp == T_STAR) {
|
||||||
QMutableListIterator<LookupItem > it(_results);
|
for (int i = 0; i < _results.size(); ++i) {
|
||||||
while (it.hasNext()) {
|
LookupItem &p = _results[i];
|
||||||
LookupItem p = it.next();
|
|
||||||
FullySpecifiedType ty = p.type();
|
FullySpecifiedType ty = p.type();
|
||||||
NamedType *namedTy = ty->asNamedType();
|
NamedType *namedTy = ty->asNamedType();
|
||||||
if (namedTy != 0) {
|
if (namedTy != 0) {
|
||||||
@@ -603,7 +599,6 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
|
|||||||
bool added = false;
|
bool added = false;
|
||||||
if (PointerType *ptrTy = ty->asPointerType()) {
|
if (PointerType *ptrTy = ty->asPointerType()) {
|
||||||
p.setType(ptrTy->elementType());
|
p.setType(ptrTy->elementType());
|
||||||
it.setValue(p);
|
|
||||||
added = true;
|
added = true;
|
||||||
} else if (namedTy != 0) {
|
} else if (namedTy != 0) {
|
||||||
const Name *starOp = control()->operatorNameId(OperatorNameId::StarOp);
|
const Name *starOp = control()->operatorNameId(OperatorNameId::StarOp);
|
||||||
@@ -616,7 +611,6 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
|
|||||||
FullySpecifiedType retTy = proto->returnType().simplified();
|
FullySpecifiedType retTy = proto->returnType().simplified();
|
||||||
p.setType(retTy);
|
p.setType(retTy);
|
||||||
p.setScope(proto->enclosingScope());
|
p.setScope(proto->enclosingScope());
|
||||||
it.setValue(p);
|
|
||||||
added = true;
|
added = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -626,7 +620,7 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!added)
|
if (!added)
|
||||||
it.remove();
|
_results.removeAt(i--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -390,9 +390,8 @@ QSet<PluginSpec *> PluginManager::pluginsRequiredByPlugin(PluginSpec *spec)
|
|||||||
while (!queue.empty()) {
|
while (!queue.empty()) {
|
||||||
PluginSpec *checkSpec = queue.front();
|
PluginSpec *checkSpec = queue.front();
|
||||||
queue.pop();
|
queue.pop();
|
||||||
QHashIterator<PluginDependency, PluginSpec *> depIt(checkSpec->dependencySpecs());
|
const QHash<PluginDependency, PluginSpec *> deps = checkSpec->dependencySpecs();
|
||||||
while (depIt.hasNext()) {
|
for (auto depIt = deps.cbegin(), end = deps.cend(); depIt != end; ++depIt) {
|
||||||
depIt.next();
|
|
||||||
if (depIt.key().type != PluginDependency::Required)
|
if (depIt.key().type != PluginDependency::Required)
|
||||||
continue;
|
continue;
|
||||||
PluginSpec *depSpec = depIt.value();
|
PluginSpec *depSpec = depIt.value();
|
||||||
@@ -933,7 +932,6 @@ void PluginManagerPrivate::deleteAll()
|
|||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|
||||||
using TestPlan = QMap<QObject *, QStringList>; // Object -> selected test functions
|
using TestPlan = QMap<QObject *, QStringList>; // Object -> selected test functions
|
||||||
using TestPlanIterator = QMapIterator<QObject *, QStringList>;
|
|
||||||
|
|
||||||
static bool isTestFunction(const QMetaMethod &metaMethod)
|
static bool isTestFunction(const QMetaMethod &metaMethod)
|
||||||
{
|
{
|
||||||
@@ -1019,9 +1017,7 @@ static int executeTestPlan(const TestPlan &testPlan)
|
|||||||
{
|
{
|
||||||
int failedTests = 0;
|
int failedTests = 0;
|
||||||
|
|
||||||
TestPlanIterator it(testPlan);
|
for (auto it = testPlan.cbegin(), end = testPlan.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QObject *testObject = it.key();
|
QObject *testObject = it.key();
|
||||||
QStringList functions = it.value();
|
QStringList functions = it.value();
|
||||||
|
|
||||||
@@ -1326,9 +1322,8 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add dependencies
|
// add dependencies
|
||||||
QHashIterator<PluginDependency, PluginSpec *> it(spec->dependencySpecs());
|
const QHash<PluginDependency, PluginSpec *> deps = spec->dependencySpecs();
|
||||||
while (it.hasNext()) {
|
for (auto it = deps.cbegin(), end = deps.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
// Skip test dependencies since they are not real dependencies but just force-loaded
|
// Skip test dependencies since they are not real dependencies but just force-loaded
|
||||||
// plugins when running tests
|
// plugins when running tests
|
||||||
if (it.key().type == PluginDependency::Test)
|
if (it.key().type == PluginDependency::Test)
|
||||||
@@ -1374,9 +1369,8 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// check if dependencies have loaded without error
|
// check if dependencies have loaded without error
|
||||||
QHashIterator<PluginDependency, PluginSpec *> it(spec->dependencySpecs());
|
const QHash<PluginDependency, PluginSpec *> deps = spec->dependencySpecs();
|
||||||
while (it.hasNext()) {
|
for (auto it = deps.cbegin(), end = deps.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
if (it.key().type != PluginDependency::Required)
|
if (it.key().type != PluginDependency::Required)
|
||||||
continue;
|
continue;
|
||||||
PluginSpec *depSpec = it.value();
|
PluginSpec *depSpec = it.value();
|
||||||
|
@@ -929,9 +929,7 @@ QVector<PluginSpec *> PluginSpecPrivate::enableDependenciesIndirectly(bool enabl
|
|||||||
if (!q->isEffectivelyEnabled()) // plugin not enabled, nothing to do
|
if (!q->isEffectivelyEnabled()) // plugin not enabled, nothing to do
|
||||||
return {};
|
return {};
|
||||||
QVector<PluginSpec *> enabled;
|
QVector<PluginSpec *> enabled;
|
||||||
QHashIterator<PluginDependency, PluginSpec *> it(dependencySpecs);
|
for (auto it = dependencySpecs.cbegin(), end = dependencySpecs.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (it.key().type != PluginDependency::Required
|
if (it.key().type != PluginDependency::Required
|
||||||
&& (!enableTestDependencies || it.key().type != PluginDependency::Test))
|
&& (!enableTestDependencies || it.key().type != PluginDependency::Test))
|
||||||
continue;
|
continue;
|
||||||
|
@@ -286,12 +286,9 @@ public:
|
|||||||
ReplaceInTrie() { }
|
ReplaceInTrie() { }
|
||||||
void operator()(QString s)
|
void operator()(QString s)
|
||||||
{
|
{
|
||||||
QHashIterator<QString, QString> i(replacements);
|
|
||||||
QString res = s;
|
QString res = s;
|
||||||
while (i.hasNext()) {
|
for (auto i = replacements.cbegin(), end = replacements.cend(); i != end; ++i)
|
||||||
i.next();
|
|
||||||
res.replace(i.key(), i.value());
|
res.replace(i.key(), i.value());
|
||||||
}
|
|
||||||
trie = TrieNode::insertF(trie,res);
|
trie = TrieNode::insertF(trie,res);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1577,9 +1577,8 @@ void Check::scanCommentsForAnnotations()
|
|||||||
|
|
||||||
void Check::warnAboutUnnecessarySuppressions()
|
void Check::warnAboutUnnecessarySuppressions()
|
||||||
{
|
{
|
||||||
QHashIterator< int, QList<MessageTypeAndSuppression> > it(m_disabledMessageTypesByLine);
|
for (auto it = m_disabledMessageTypesByLine.cbegin(), end = m_disabledMessageTypesByLine.cend();
|
||||||
while (it.hasNext()) {
|
it != end; ++it) {
|
||||||
it.next();
|
|
||||||
foreach (const MessageTypeAndSuppression &entry, it.value()) {
|
foreach (const MessageTypeAndSuppression &entry, it.value()) {
|
||||||
if (!entry.wasSuppressed)
|
if (!entry.wasSuppressed)
|
||||||
addMessage(WarnUnnecessaryMessageSuppression, entry.suppressionSource);
|
addMessage(WarnUnnecessaryMessageSuppression, entry.suppressionSource);
|
||||||
|
@@ -584,10 +584,8 @@ void ImportDependencies::filter(const ViewerContext &vContext)
|
|||||||
{
|
{
|
||||||
QMap<QString, CoreImport> newCoreImports;
|
QMap<QString, CoreImport> newCoreImports;
|
||||||
QMap<ImportKey, QStringList> newImportCache;
|
QMap<ImportKey, QStringList> newImportCache;
|
||||||
QMapIterator<QString, CoreImport> j(m_coreImports);
|
|
||||||
bool hasChanges = false;
|
bool hasChanges = false;
|
||||||
while (j.hasNext()) {
|
for (auto j = m_coreImports.cbegin(), end = m_coreImports.cend(); j != end; ++j) {
|
||||||
j.next();
|
|
||||||
const CoreImport &cImport = j.value();
|
const CoreImport &cImport = j.value();
|
||||||
if (vContext.languageIsCompatible(cImport.language)) {
|
if (vContext.languageIsCompatible(cImport.language)) {
|
||||||
QList<Export> newExports;
|
QList<Export> newExports;
|
||||||
@@ -923,10 +921,8 @@ QSet<ImportKey> ImportDependencies::subdirImports(
|
|||||||
|
|
||||||
void ImportDependencies::checkConsistency() const
|
void ImportDependencies::checkConsistency() const
|
||||||
{
|
{
|
||||||
QMapIterator<ImportKey, QStringList> j(m_importCache);
|
for (auto j = m_importCache.cbegin(), end = m_importCache.cend(); j != end; ++j) {
|
||||||
while (j.hasNext()) {
|
for (const QString &s : j.value()) {
|
||||||
j.next();
|
|
||||||
foreach (const QString &s, j.value()) {
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (const Export &e, m_coreImports.value(s).possibleExports)
|
foreach (const Export &e, m_coreImports.value(s).possibleExports)
|
||||||
if (e.exportName == j.key())
|
if (e.exportName == j.key())
|
||||||
@@ -934,19 +930,15 @@ void ImportDependencies::checkConsistency() const
|
|||||||
Q_ASSERT(found); Q_UNUSED(found)
|
Q_ASSERT(found); Q_UNUSED(found)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QMapIterator<QString,CoreImport> i(m_coreImports);
|
for (auto i = m_coreImports.cbegin(), end = m_coreImports.cend(); i != end; ++i) {
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
foreach (const Export &e, i.value().possibleExports) {
|
foreach (const Export &e, i.value().possibleExports) {
|
||||||
if (!m_importCache.value(e.exportName).contains(i.key())) {
|
if (!m_importCache.value(e.exportName).contains(i.key())) {
|
||||||
qCWarning(importsLog) << e.exportName.toString();
|
qCWarning(importsLog) << e.exportName.toString();
|
||||||
qCWarning(importsLog) << i.key();
|
qCWarning(importsLog) << i.key();
|
||||||
|
|
||||||
QMapIterator<ImportKey, QStringList> j(m_importCache);
|
for (auto j = m_importCache.cbegin(), end = m_importCache.cend(); j != end; ++j)
|
||||||
while (j.hasNext()) {
|
|
||||||
j.next();
|
|
||||||
qCWarning(importsLog) << j.key().toString() << j.value();
|
qCWarning(importsLog) << j.key().toString() << j.value();
|
||||||
}
|
|
||||||
qCWarning(importsLog) << m_importCache.contains(e.exportName);
|
qCWarning(importsLog) << m_importCache.contains(e.exportName);
|
||||||
qCWarning(importsLog) << m_importCache.value(e.exportName);
|
qCWarning(importsLog) << m_importCache.value(e.exportName);
|
||||||
}
|
}
|
||||||
|
@@ -1098,11 +1098,7 @@ bool ObjectValue::checkPrototype(const ObjectValue *, QSet<const ObjectValue *>
|
|||||||
|
|
||||||
void ObjectValue::processMembers(MemberProcessor *processor) const
|
void ObjectValue::processMembers(MemberProcessor *processor) const
|
||||||
{
|
{
|
||||||
QHashIterator<QString, PropertyData> it(m_members);
|
for (auto it = m_members.cbegin(), end = m_members.cend(); it != end; ++it) {
|
||||||
|
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
|
|
||||||
if (! processor->processProperty(it.key(), it.value().value, it.value().propertyInfo))
|
if (! processor->processProperty(it.key(), it.value().value, it.value().propertyInfo))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2359,10 +2355,9 @@ TypeScope::TypeScope(const Imports *imports, ValueOwner *valueOwner)
|
|||||||
const Value *TypeScope::lookupMember(const QString &name, const Context *context,
|
const Value *TypeScope::lookupMember(const QString &name, const Context *context,
|
||||||
const ObjectValue **foundInObject, bool) const
|
const ObjectValue **foundInObject, bool) const
|
||||||
{
|
{
|
||||||
QListIterator<Import> it(m_imports->all());
|
const QList<Import> &imports = m_imports->all();
|
||||||
it.toBack();
|
for (int pos = imports.size(); --pos >= 0; ) {
|
||||||
while (it.hasPrevious()) {
|
const Import &i = imports.at(pos);
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
@@ -2374,7 +2369,7 @@ const Value *TypeScope::lookupMember(const QString &name, const Context *context
|
|||||||
if (info.as() == name) {
|
if (info.as() == name) {
|
||||||
if (foundInObject)
|
if (foundInObject)
|
||||||
*foundInObject = this;
|
*foundInObject = this;
|
||||||
i.used = true;
|
i.used = true; // FIXME: This evilly modifies a 'const' object
|
||||||
return import;
|
return import;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -2392,10 +2387,9 @@ const Value *TypeScope::lookupMember(const QString &name, const Context *context
|
|||||||
|
|
||||||
void TypeScope::processMembers(MemberProcessor *processor) const
|
void TypeScope::processMembers(MemberProcessor *processor) const
|
||||||
{
|
{
|
||||||
QListIterator<Import> it(m_imports->all());
|
const QList<Import> &imports = m_imports->all();
|
||||||
it.toBack();
|
for (int pos = imports.size(); --pos >= 0; ) {
|
||||||
while (it.hasPrevious()) {
|
const Import &i = imports.at(pos);
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
@@ -2424,10 +2418,9 @@ JSImportScope::JSImportScope(const Imports *imports, ValueOwner *valueOwner)
|
|||||||
const Value *JSImportScope::lookupMember(const QString &name, const Context *,
|
const Value *JSImportScope::lookupMember(const QString &name, const Context *,
|
||||||
const ObjectValue **foundInObject, bool) const
|
const ObjectValue **foundInObject, bool) const
|
||||||
{
|
{
|
||||||
QListIterator<Import> it(m_imports->all());
|
const QList<Import> &imports = m_imports->all();
|
||||||
it.toBack();
|
for (int pos = imports.size(); --pos >= 0; ) {
|
||||||
while (it.hasPrevious()) {
|
const Import &i = imports.at(pos);
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
@@ -2449,10 +2442,9 @@ const Value *JSImportScope::lookupMember(const QString &name, const Context *,
|
|||||||
|
|
||||||
void JSImportScope::processMembers(MemberProcessor *processor) const
|
void JSImportScope::processMembers(MemberProcessor *processor) const
|
||||||
{
|
{
|
||||||
QListIterator<Import> it(m_imports->all());
|
const QList<Import> &imports = m_imports->all();
|
||||||
it.toBack();
|
for (int pos = imports.size(); --pos >= 0; ) {
|
||||||
while (it.hasPrevious()) {
|
const Import &i = imports.at(pos);
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
@@ -2505,10 +2497,8 @@ ImportInfo Imports::info(const QString &name, const Context *context) const
|
|||||||
if (dotIdx != -1)
|
if (dotIdx != -1)
|
||||||
firstId = firstId.left(dotIdx);
|
firstId = firstId.left(dotIdx);
|
||||||
|
|
||||||
QListIterator<Import> it(m_imports);
|
for (int pos = m_imports.size(); --pos >= 0; ) {
|
||||||
it.toBack();
|
const Import &i = m_imports.at(pos);
|
||||||
while (it.hasPrevious()) {
|
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
@@ -2531,10 +2521,8 @@ ImportInfo Imports::info(const QString &name, const Context *context) const
|
|||||||
|
|
||||||
QString Imports::nameForImportedObject(const ObjectValue *value, const Context *context) const
|
QString Imports::nameForImportedObject(const ObjectValue *value, const Context *context) const
|
||||||
{
|
{
|
||||||
QListIterator<Import> it(m_imports);
|
for (int pos = m_imports.size(); --pos >= 0; ) {
|
||||||
it.toBack();
|
const Import &i = m_imports.at(pos);
|
||||||
while (it.hasPrevious()) {
|
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
@@ -2617,10 +2605,8 @@ public:
|
|||||||
void Imports::dump() const
|
void Imports::dump() const
|
||||||
{
|
{
|
||||||
qCDebug(qmljsLog) << "Imports contents, in search order:";
|
qCDebug(qmljsLog) << "Imports contents, in search order:";
|
||||||
QListIterator<Import> it(m_imports);
|
for (int pos = m_imports.size(); --pos >= 0; ) {
|
||||||
it.toBack();
|
const Import &i = m_imports.at(pos);
|
||||||
while (it.hasPrevious()) {
|
|
||||||
const Import &i = it.previous();
|
|
||||||
const ObjectValue *import = i.object;
|
const ObjectValue *import = i.object;
|
||||||
const ImportInfo &info = i.info;
|
const ImportInfo &info = i.info;
|
||||||
|
|
||||||
|
@@ -143,23 +143,18 @@ Link::Link(const Snapshot &snapshot, const ViewerContext &vContext, const Librar
|
|||||||
|
|
||||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||||
if (modelManager) {
|
if (modelManager) {
|
||||||
ModelManagerInterface::CppDataHash cppDataHash = modelManager->cppData();
|
const ModelManagerInterface::CppDataHash cppDataHash = modelManager->cppData();
|
||||||
{
|
{
|
||||||
// populate engine with types from C++
|
// populate engine with types from C++
|
||||||
ModelManagerInterface::CppDataHashIterator cppDataHashIterator(cppDataHash);
|
for (auto it = cppDataHash.cbegin(), end = cppDataHash.cend(); it != end; ++it)
|
||||||
while (cppDataHashIterator.hasNext()) {
|
d->valueOwner->cppQmlTypes().load(it.key(), it.value().exportedTypes);
|
||||||
cppDataHashIterator.next();
|
|
||||||
d->valueOwner->cppQmlTypes().load(cppDataHashIterator.key(),
|
|
||||||
cppDataHashIterator.value().exportedTypes);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// build an object with the context properties from C++
|
// build an object with the context properties from C++
|
||||||
ObjectValue *cppContextProperties = d->valueOwner->newObject(/* prototype = */ 0);
|
ObjectValue *cppContextProperties = d->valueOwner->newObject(/* prototype = */ 0);
|
||||||
foreach (const ModelManagerInterface::CppData &cppData, cppDataHash) {
|
for (const ModelManagerInterface::CppData &cppData : cppDataHash) {
|
||||||
QHashIterator<QString, QString> it(cppData.contextProperties);
|
for (auto it = cppData.contextProperties.cbegin(), end = cppData.contextProperties.cend();
|
||||||
while (it.hasNext()) {
|
it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const Value *value = 0;
|
const Value *value = 0;
|
||||||
const QString cppTypeName = it.value();
|
const QString cppTypeName = it.value();
|
||||||
if (!cppTypeName.isEmpty())
|
if (!cppTypeName.isEmpty())
|
||||||
@@ -332,10 +327,8 @@ Import LinkPrivate::importFileOrDirectory(Document::Ptr doc, const ImportInfo &i
|
|||||||
|
|
||||||
importLibrary(doc, path, &import);
|
importLibrary(doc, path, &import);
|
||||||
|
|
||||||
QMapIterator<QString,QStringList> iter(ModelManagerInterface::instance()
|
const QMap<QString, QStringList> paths = ModelManagerInterface::instance()->filesInQrcPath(path);
|
||||||
->filesInQrcPath(path));
|
for (auto iter = paths.cbegin(), end = paths.cend(); iter != end; ++iter) {
|
||||||
while (iter.hasNext()) {
|
|
||||||
iter.next();
|
|
||||||
if (ModelManagerInterface::guessLanguageOfFile(iter.key()).isQmlLikeLanguage()) {
|
if (ModelManagerInterface::guessLanguageOfFile(iter.key()).isQmlLikeLanguage()) {
|
||||||
Document::Ptr importedDoc = snapshot.document(iter.value().at(0));
|
Document::Ptr importedDoc = snapshot.document(iter.value().at(0));
|
||||||
if (importedDoc && importedDoc->bind()->rootObjectValue()) {
|
if (importedDoc && importedDoc->bind()->rootObjectValue()) {
|
||||||
|
@@ -175,15 +175,10 @@ Dialect ModelManagerInterface::guessLanguageOfFile(const QString &fileName)
|
|||||||
|
|
||||||
QStringList ModelManagerInterface::globPatternsForLanguages(const QList<Dialect> languages)
|
QStringList ModelManagerInterface::globPatternsForLanguages(const QList<Dialect> languages)
|
||||||
{
|
{
|
||||||
QHash<QString, Dialect> lMapping;
|
|
||||||
if (instance())
|
|
||||||
lMapping = instance()->languageForSuffix();
|
|
||||||
else
|
|
||||||
lMapping = defaultLanguageMapping();
|
|
||||||
QStringList patterns;
|
QStringList patterns;
|
||||||
QHashIterator<QString,Dialect> i(lMapping);
|
const QHash<QString, Dialect> lMapping =
|
||||||
while (i.hasNext()) {
|
instance() ? instance()->languageForSuffix() : defaultLanguageMapping();
|
||||||
i.next();
|
for (auto i = lMapping.cbegin(), end = lMapping.cend(); i != end; ++i) {
|
||||||
if (languages.contains(i.value()))
|
if (languages.contains(i.value()))
|
||||||
patterns << QLatin1String("*.") + i.key();
|
patterns << QLatin1String("*.") + i.key();
|
||||||
}
|
}
|
||||||
@@ -725,9 +720,8 @@ static void findNewFileImports(const Document::Ptr &doc, const Snapshot &snapsho
|
|||||||
*importedFiles += importPath;
|
*importedFiles += importPath;
|
||||||
}
|
}
|
||||||
} else if (import.type() == ImportType::QrcDirectory) {
|
} else if (import.type() == ImportType::QrcDirectory) {
|
||||||
QMapIterator<QString,QStringList> dirContents(ModelManagerInterface::instance()->filesInQrcPath(importName));
|
const QMap<QString, QStringList> files = ModelManagerInterface::instance()->filesInQrcPath(importName);
|
||||||
while (dirContents.hasNext()) {
|
for (auto dirContents = files.cbegin(), end = files.cend(); dirContents != end; ++dirContents) {
|
||||||
dirContents.next();
|
|
||||||
if (ModelManagerInterface::guessLanguageOfFile(dirContents.key()).isQmlLikeOrJsLanguage()) {
|
if (ModelManagerInterface::guessLanguageOfFile(dirContents.key()).isQmlLikeOrJsLanguage()) {
|
||||||
foreach (const QString &filePath, dirContents.value()) {
|
foreach (const QString &filePath, dirContents.value()) {
|
||||||
if (! snapshot.document(filePath))
|
if (! snapshot.document(filePath))
|
||||||
@@ -1091,10 +1085,7 @@ void ModelManagerInterface::updateImportPaths()
|
|||||||
PathsAndLanguages allImportPaths;
|
PathsAndLanguages allImportPaths;
|
||||||
QmlLanguageBundles activeBundles;
|
QmlLanguageBundles activeBundles;
|
||||||
QmlLanguageBundles extendedBundles;
|
QmlLanguageBundles extendedBundles;
|
||||||
QMapIterator<ProjectExplorer::Project *, ProjectInfo> pInfoIter(m_projects);
|
for (auto pInfoIter = m_projects.cbegin(), end = m_projects.cend(); pInfoIter != end; ++pInfoIter) {
|
||||||
QHashIterator<Dialect, QmlJS::ViewerContext> vCtxsIter = m_defaultVContexts;
|
|
||||||
while (pInfoIter.hasNext()) {
|
|
||||||
pInfoIter.next();
|
|
||||||
const PathsAndLanguages &iPaths = pInfoIter.value().importPaths;
|
const PathsAndLanguages &iPaths = pInfoIter.value().importPaths;
|
||||||
for (int i = 0; i < iPaths.size(); ++i) {
|
for (int i = 0; i < iPaths.size(); ++i) {
|
||||||
PathAndLanguage pAndL = iPaths.at(i);
|
PathAndLanguage pAndL = iPaths.at(i);
|
||||||
@@ -1104,14 +1095,12 @@ void ModelManagerInterface::updateImportPaths()
|
|||||||
pAndL.language());
|
pAndL.language());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (vCtxsIter.hasNext()) {
|
for (auto vCtxsIter = m_defaultVContexts.cbegin(), end = m_defaultVContexts.cend();
|
||||||
vCtxsIter.next();
|
vCtxsIter != end; ++ vCtxsIter) {
|
||||||
foreach (const QString &path, vCtxsIter.value().paths)
|
foreach (const QString &path, vCtxsIter.value().paths)
|
||||||
allImportPaths.maybeInsert(Utils::FilePath::fromString(path), vCtxsIter.value().language);
|
allImportPaths.maybeInsert(Utils::FilePath::fromString(path), vCtxsIter.value().language);
|
||||||
}
|
}
|
||||||
pInfoIter.toFront();
|
for (auto pInfoIter = m_projects.cbegin(), end = m_projects.cend(); pInfoIter != end; ++pInfoIter) {
|
||||||
while (pInfoIter.hasNext()) {
|
|
||||||
pInfoIter.next();
|
|
||||||
activeBundles.mergeLanguageBundles(pInfoIter.value().activeBundle);
|
activeBundles.mergeLanguageBundles(pInfoIter.value().activeBundle);
|
||||||
foreach (Dialect l, pInfoIter.value().activeBundle.languages()) {
|
foreach (Dialect l, pInfoIter.value().activeBundle.languages()) {
|
||||||
foreach (const QString &path, pInfoIter.value().activeBundle.bundleForLanguage(l)
|
foreach (const QString &path, pInfoIter.value().activeBundle.bundleForLanguage(l)
|
||||||
@@ -1122,9 +1111,7 @@ void ModelManagerInterface::updateImportPaths()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pInfoIter.toFront();
|
for (auto pInfoIter = m_projects.cbegin(), end = m_projects.cend(); pInfoIter != end; ++pInfoIter) {
|
||||||
while (pInfoIter.hasNext()) {
|
|
||||||
pInfoIter.next();
|
|
||||||
QString pathAtt = pInfoIter.value().qtQmlPath;
|
QString pathAtt = pInfoIter.value().qtQmlPath;
|
||||||
if (!pathAtt.isEmpty())
|
if (!pathAtt.isEmpty())
|
||||||
allImportPaths.maybeInsert(Utils::FilePath::fromString(pathAtt), Dialect::QmlQtQuick2);
|
allImportPaths.maybeInsert(Utils::FilePath::fromString(pathAtt), Dialect::QmlQtQuick2);
|
||||||
|
@@ -132,7 +132,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef QHash<QString, CppData> CppDataHash;
|
typedef QHash<QString, CppData> CppDataHash;
|
||||||
typedef QHashIterator<QString, CppData> CppDataHashIterator;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModelManagerInterface(QObject *parent = nullptr);
|
ModelManagerInterface(QObject *parent = nullptr);
|
||||||
|
@@ -53,11 +53,9 @@ static bool overlaps(int posA, int lengthA, int posB, int lengthB) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChangeSet::hasOverlap(int pos, int length)
|
bool ChangeSet::hasOverlap(int pos, int length) const
|
||||||
{
|
{
|
||||||
QListIterator<EditOp> i(m_operationList);
|
for (const EditOp &cmd : m_operationList) {
|
||||||
while (i.hasNext()) {
|
|
||||||
const EditOp &cmd = i.next();
|
|
||||||
|
|
||||||
switch (cmd.type) {
|
switch (cmd.type) {
|
||||||
case EditOp::Replace:
|
case EditOp::Replace:
|
||||||
@@ -251,9 +249,7 @@ void ChangeSet::doReplace(const EditOp &op, QList<EditOp> *replaceList)
|
|||||||
Q_ASSERT(op.type == EditOp::Replace);
|
Q_ASSERT(op.type == EditOp::Replace);
|
||||||
|
|
||||||
{
|
{
|
||||||
QMutableListIterator<EditOp> i(*replaceList);
|
for (EditOp &c : *replaceList) {
|
||||||
while (i.hasNext()) {
|
|
||||||
EditOp &c = i.next();
|
|
||||||
if (op.pos1 <= c.pos1)
|
if (op.pos1 <= c.pos1)
|
||||||
c.pos1 += op.text.size();
|
c.pos1 += op.text.size();
|
||||||
if (op.pos1 < c.pos1)
|
if (op.pos1 < c.pos1)
|
||||||
|
@@ -105,7 +105,7 @@ private:
|
|||||||
bool flip_helper(int pos1, int length1, int pos2, int length2);
|
bool flip_helper(int pos1, int length1, int pos2, int length2);
|
||||||
bool copy_helper(int pos, int length, int to);
|
bool copy_helper(int pos, int length, int to);
|
||||||
|
|
||||||
bool hasOverlap(int pos, int length);
|
bool hasOverlap(int pos, int length) const;
|
||||||
QString textAt(int pos, int length);
|
QString textAt(int pos, int length);
|
||||||
|
|
||||||
void doReplace(const EditOp &replace, QList<EditOp> *replaceList);
|
void doReplace(const EditOp &replace, QList<EditOp> *replaceList);
|
||||||
|
@@ -468,12 +468,9 @@ void FancyMainWindow::handleVisibilityChanged(bool visible)
|
|||||||
|
|
||||||
void FancyMainWindow::saveSettings(QSettings *settings) const
|
void FancyMainWindow::saveSettings(QSettings *settings) const
|
||||||
{
|
{
|
||||||
QHash<QString, QVariant> hash = saveSettings();
|
const QHash<QString, QVariant> hash = saveSettings();
|
||||||
QHashIterator<QString, QVariant> it(hash);
|
for (auto it = hash.cbegin(), end = hash.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
settings->setValue(it.key(), it.value());
|
settings->setValue(it.key(), it.value());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FancyMainWindow::restoreSettings(const QSettings *settings)
|
void FancyMainWindow::restoreSettings(const QSettings *settings)
|
||||||
|
@@ -313,11 +313,8 @@ QVariant MacroExpander::expandVariant(const QVariant &v) const
|
|||||||
} else if (type == QMetaType::QVariantMap) {
|
} else if (type == QMetaType::QVariantMap) {
|
||||||
const auto map = v.toMap();
|
const auto map = v.toMap();
|
||||||
QVariantMap result;
|
QVariantMap result;
|
||||||
QMapIterator<QString, QVariant> it(map);
|
for (auto it = map.cbegin(), end = map.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
result.insert(it.key(), expandVariant(it.value()));
|
result.insert(it.key(), expandVariant(it.value()));
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
|
@@ -181,10 +181,9 @@ void MimeAllGlobPatterns::addGlob(const MimeGlobPattern &glob)
|
|||||||
|
|
||||||
void MimeAllGlobPatterns::removeMimeType(const QString &mimeType)
|
void MimeAllGlobPatterns::removeMimeType(const QString &mimeType)
|
||||||
{
|
{
|
||||||
QMutableHashIterator<QString, QStringList> it(m_fastPatterns);
|
for (QStringList &x : m_fastPatterns)
|
||||||
while (it.hasNext()) {
|
x.removeAll(mimeType);
|
||||||
it.next().value().removeAll(mimeType);
|
|
||||||
}
|
|
||||||
m_highWeightGlobs.removeMimeType(mimeType);
|
m_highWeightGlobs.removeMimeType(mimeType);
|
||||||
m_lowWeightGlobs.removeMimeType(mimeType);
|
m_lowWeightGlobs.removeMimeType(mimeType);
|
||||||
}
|
}
|
||||||
|
@@ -114,11 +114,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
void removeMimeType(const QString &mimeType)
|
void removeMimeType(const QString &mimeType)
|
||||||
{
|
{
|
||||||
QMutableListIterator<MimeGlobPattern> it(*this);
|
auto isMimeTypeEqual = [&mimeType](const MimeGlobPattern &pattern) {
|
||||||
while (it.hasNext()) {
|
return pattern.mimeType() == mimeType;
|
||||||
if (it.next().mimeType() == mimeType)
|
};
|
||||||
it.remove();
|
erase(std::remove_if(begin(), end(), isMimeTypeEqual), end());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void match(MimeGlobMatchResult &result, const QString &fileName) const;
|
void match(MimeGlobMatchResult &result, const QString &fileName) const;
|
||||||
|
@@ -767,13 +767,12 @@ void MimeXMLProvider::setGlobPatternsForMimeType(const MimeType &mimeType, const
|
|||||||
void MimeXMLProvider::setMagicRulesForMimeType(const MimeType &mimeType, const QMap<int, QList<MimeMagicRule> > &rules)
|
void MimeXMLProvider::setMagicRulesForMimeType(const MimeType &mimeType, const QMap<int, QList<MimeMagicRule> > &rules)
|
||||||
{
|
{
|
||||||
// remove all previous rules
|
// remove all previous rules
|
||||||
QMutableListIterator<MimeMagicRuleMatcher> matcherIt(m_magicMatchers);
|
for (int i = 0; i < m_magicMatchers.size(); ++i) {
|
||||||
while (matcherIt.hasNext()) {
|
if (m_magicMatchers.at(i).mimetype() == mimeType.name())
|
||||||
if (matcherIt.next().mimetype() == mimeType.name())
|
m_magicMatchers.removeAt(i--);
|
||||||
matcherIt.remove();
|
|
||||||
}
|
}
|
||||||
// add new rules
|
// add new rules
|
||||||
for (auto it = rules.constBegin(); it != rules.constEnd(); ++it) {
|
for (auto it = rules.cbegin(); it != rules.cend(); ++it) {
|
||||||
MimeMagicRuleMatcher matcher(mimeType.name(), it.key()/*priority*/);
|
MimeMagicRuleMatcher matcher(mimeType.name(), it.key()/*priority*/);
|
||||||
matcher.addRules(it.value());
|
matcher.addRules(it.value());
|
||||||
addMagicMatcher(matcher);
|
addMagicMatcher(matcher);
|
||||||
@@ -804,15 +803,14 @@ void MimeXMLProvider::ensureLoaded()
|
|||||||
|
|
||||||
// add custom mime types first, which override any default from freedesktop.org.xml
|
// add custom mime types first, which override any default from freedesktop.org.xml
|
||||||
MimeTypeParser parser(*this);
|
MimeTypeParser parser(*this);
|
||||||
QHashIterator<QString, QByteArray> it(m_additionalData);
|
for (auto it = m_additionalData.constBegin(), end = m_additionalData.constEnd(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!parser.parse(it.value(), it.key(), &errorMessage)) {
|
if (!parser.parse(it.value(), it.key(), &errorMessage)) {
|
||||||
qWarning("MimeDatabase: Error loading %s\n%s", qPrintable(it.key()),
|
qWarning("MimeDatabase: Error loading %s\n%s", qPrintable(it.key()),
|
||||||
qPrintable(errorMessage));
|
qPrintable(errorMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QString &file, allFiles)
|
foreach (const QString &file, allFiles)
|
||||||
load(file);
|
load(file);
|
||||||
}
|
}
|
||||||
|
@@ -86,15 +86,18 @@ void BackendReceiver::addExpectedCompletionsMessage(
|
|||||||
|
|
||||||
void BackendReceiver::deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidget *textEditorWidget)
|
void BackendReceiver::deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidget *textEditorWidget)
|
||||||
{
|
{
|
||||||
QMutableHashIterator<quint64, ClangCompletionAssistProcessor *> it(m_assistProcessorsTable);
|
QList<quint64> toRemove;
|
||||||
while (it.hasNext()) {
|
for (auto it = m_assistProcessorsTable.cbegin(), end = m_assistProcessorsTable.cend();
|
||||||
it.next();
|
it != end; ++it)
|
||||||
|
{
|
||||||
ClangCompletionAssistProcessor *assistProcessor = it.value();
|
ClangCompletionAssistProcessor *assistProcessor = it.value();
|
||||||
if (assistProcessor->textEditorWidget() == textEditorWidget) {
|
if (assistProcessor->textEditorWidget() == textEditorWidget) {
|
||||||
delete assistProcessor;
|
delete assistProcessor;
|
||||||
it.remove();
|
toRemove.append(it.key());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (quint64 item : toRemove)
|
||||||
|
m_assistProcessorsTable.remove(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
QFuture<CppTools::CursorInfo> BackendReceiver::addExpectedReferencesMessage(
|
QFuture<CppTools::CursorInfo> BackendReceiver::addExpectedReferencesMessage(
|
||||||
|
@@ -35,7 +35,6 @@ namespace ClangCodeModel {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
using FileToFixits = QMap<QString, QVector<ClangBackEnd::FixItContainer>>;
|
using FileToFixits = QMap<QString, QVector<ClangBackEnd::FixItContainer>>;
|
||||||
using FileToFixitsIterator = QMapIterator<QString, QVector<ClangBackEnd::FixItContainer>>;
|
|
||||||
using RefactoringFilePtr = QSharedPointer<TextEditor::RefactoringFile>;
|
using RefactoringFilePtr = QSharedPointer<TextEditor::RefactoringFile>;
|
||||||
|
|
||||||
ClangFixItOperation::ClangFixItOperation(
|
ClangFixItOperation::ClangFixItOperation(
|
||||||
@@ -75,9 +74,7 @@ void ClangFixItOperation::perform()
|
|||||||
const TextEditor::RefactoringChanges refactoringChanges;
|
const TextEditor::RefactoringChanges refactoringChanges;
|
||||||
const FileToFixits fileToFixIts = fixitsPerFile(fixItContainers);
|
const FileToFixits fileToFixIts = fixitsPerFile(fixItContainers);
|
||||||
|
|
||||||
FileToFixitsIterator i(fileToFixIts);
|
for (auto i = fileToFixIts.cbegin(), end = fileToFixIts.cend(); i != end; ++i) {
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
const QString filePath = i.key();
|
const QString filePath = i.key();
|
||||||
const QVector<ClangBackEnd::FixItContainer> fixits = i.value();
|
const QVector<ClangBackEnd::FixItContainer> fixits = i.value();
|
||||||
|
|
||||||
|
@@ -356,9 +356,7 @@ void ClangToolRunControl::start()
|
|||||||
|
|
||||||
void ClangToolRunControl::stop()
|
void ClangToolRunControl::stop()
|
||||||
{
|
{
|
||||||
QSetIterator<ClangToolRunner *> i(m_runners);
|
for (ClangToolRunner *runner : m_runners) {
|
||||||
while (i.hasNext()) {
|
|
||||||
ClangToolRunner *runner = i.next();
|
|
||||||
QObject::disconnect(runner, nullptr, this, nullptr);
|
QObject::disconnect(runner, nullptr, this, nullptr);
|
||||||
delete runner;
|
delete runner;
|
||||||
}
|
}
|
||||||
|
@@ -276,9 +276,7 @@ void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *m
|
|||||||
auto containerPrivate = static_cast<ActionContainerPrivate *>(menu);
|
auto containerPrivate = static_cast<ActionContainerPrivate *>(menu);
|
||||||
QTC_ASSERT(containerPrivate->canBeAddedToContainer(this), return);
|
QTC_ASSERT(containerPrivate->canBeAddedToContainer(this), return);
|
||||||
|
|
||||||
QMutableListIterator<Group> it(m_groups);
|
for (Group &group : m_groups) {
|
||||||
while (it.hasNext()) {
|
|
||||||
Group &group = it.next();
|
|
||||||
const int insertionPoint = group.items.indexOf(before);
|
const int insertionPoint = group.items.indexOf(before);
|
||||||
if (insertionPoint >= 0) {
|
if (insertionPoint >= 0) {
|
||||||
group.items.insert(insertionPoint, menu);
|
group.items.insert(insertionPoint, menu);
|
||||||
@@ -319,9 +317,7 @@ Command *ActionContainerPrivate::addSeparator(const Context &context, Id group,
|
|||||||
|
|
||||||
void ActionContainerPrivate::clear()
|
void ActionContainerPrivate::clear()
|
||||||
{
|
{
|
||||||
QMutableListIterator<Group> it(m_groups);
|
for (Group &group : m_groups) {
|
||||||
while (it.hasNext()) {
|
|
||||||
Group &group = it.next();
|
|
||||||
foreach (QObject *item, group.items) {
|
foreach (QObject *item, group.items) {
|
||||||
if (auto command = qobject_cast<Command *>(item)) {
|
if (auto command = qobject_cast<Command *>(item)) {
|
||||||
removeAction(command);
|
removeAction(command);
|
||||||
@@ -343,9 +339,7 @@ void ActionContainerPrivate::clear()
|
|||||||
void ActionContainerPrivate::itemDestroyed()
|
void ActionContainerPrivate::itemDestroyed()
|
||||||
{
|
{
|
||||||
QObject *obj = sender();
|
QObject *obj = sender();
|
||||||
QMutableListIterator<Group> it(m_groups);
|
for (Group &group : m_groups) {
|
||||||
while (it.hasNext()) {
|
|
||||||
Group &group = it.next();
|
|
||||||
if (group.items.removeAll(obj) > 0)
|
if (group.items.removeAll(obj) > 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -454,9 +448,7 @@ bool MenuActionContainer::updateInternal()
|
|||||||
bool hasitems = false;
|
bool hasitems = false;
|
||||||
QList<QAction *> actions = m_menu->actions();
|
QList<QAction *> actions = m_menu->actions();
|
||||||
|
|
||||||
QListIterator<Group> it(m_groups);
|
for (const Group &group : m_groups) {
|
||||||
while (it.hasNext()) {
|
|
||||||
const Group &group = it.next();
|
|
||||||
foreach (QObject *item, group.items) {
|
foreach (QObject *item, group.items) {
|
||||||
if (auto container = qobject_cast<ActionContainerPrivate*>(item)) {
|
if (auto container = qobject_cast<ActionContainerPrivate*>(item)) {
|
||||||
actions.removeAll(container->menu()->menuAction());
|
actions.removeAll(container->menu()->menuAction());
|
||||||
|
@@ -325,14 +325,13 @@ void Action::addOverrideAction(QAction *action, const Context &context, bool scr
|
|||||||
|
|
||||||
void Action::removeOverrideAction(QAction *action)
|
void Action::removeOverrideAction(QAction *action)
|
||||||
{
|
{
|
||||||
QMutableMapIterator<Id, QPointer<QAction> > it(m_contextActionMap);
|
QList<Id> toRemove;
|
||||||
while (it.hasNext()) {
|
for (auto it = m_contextActionMap.cbegin(), end = m_contextActionMap.cend(); it != end; ++it) {
|
||||||
it.next();
|
if (it.value() == nullptr || it.value() == action)
|
||||||
if (it.value() == nullptr)
|
toRemove.append(it.key());
|
||||||
it.remove();
|
|
||||||
else if (it.value() == action)
|
|
||||||
it.remove();
|
|
||||||
}
|
}
|
||||||
|
for (Id id : toRemove)
|
||||||
|
m_contextActionMap.remove(id);
|
||||||
setCurrentContext(m_context);
|
setCurrentContext(m_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,11 +58,8 @@ ExternalToolModel::ExternalToolModel(QObject *parent)
|
|||||||
|
|
||||||
ExternalToolModel::~ExternalToolModel()
|
ExternalToolModel::~ExternalToolModel()
|
||||||
{
|
{
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(m_tools);
|
for (QList<ExternalTool *> &toolInCategory : m_tools)
|
||||||
while (it.hasNext()) {
|
qDeleteAll(toolInCategory);
|
||||||
it.next();
|
|
||||||
qDeleteAll(it.value());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::DropActions ExternalToolModel::supportedDropActions() const
|
Qt::DropActions ExternalToolModel::supportedDropActions() const
|
||||||
@@ -192,10 +189,8 @@ QModelIndex ExternalToolModel::parent(const QModelIndex &child) const
|
|||||||
{
|
{
|
||||||
if (ExternalTool *tool = toolForIndex(child)) {
|
if (ExternalTool *tool = toolForIndex(child)) {
|
||||||
int categoryIndex = 0;
|
int categoryIndex = 0;
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(m_tools);
|
for (const QList<ExternalTool *> &toolsInCategory : m_tools) {
|
||||||
while (it.hasNext()) {
|
if (toolsInCategory.contains(tool))
|
||||||
it.next();
|
|
||||||
if (it.value().contains(tool))
|
|
||||||
return index(categoryIndex, 0);
|
return index(categoryIndex, 0);
|
||||||
++categoryIndex;
|
++categoryIndex;
|
||||||
}
|
}
|
||||||
@@ -376,10 +371,7 @@ void ExternalToolModel::removeTool(const QModelIndex &modelIndex)
|
|||||||
QTC_ASSERT(!tool->preset(), return);
|
QTC_ASSERT(!tool->preset(), return);
|
||||||
// remove the tool and the tree item
|
// remove the tool and the tree item
|
||||||
int categoryIndex = 0;
|
int categoryIndex = 0;
|
||||||
QMutableMapIterator<QString, QList<ExternalTool *> > it(m_tools);
|
for (QList<ExternalTool *> &items : m_tools) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QList<ExternalTool *> &items = it.value();
|
|
||||||
int pos = items.indexOf(tool);
|
int pos = items.indexOf(tool);
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
beginRemoveRows(index(categoryIndex, 0), pos, pos);
|
beginRemoveRows(index(categoryIndex, 0), pos, pos);
|
||||||
@@ -473,9 +465,7 @@ ExternalToolConfig::~ExternalToolConfig()
|
|||||||
void ExternalToolConfig::setTools(const QMap<QString, QList<ExternalTool *> > &tools)
|
void ExternalToolConfig::setTools(const QMap<QString, QList<ExternalTool *> > &tools)
|
||||||
{
|
{
|
||||||
QMap<QString, QList<ExternalTool *> > toolsCopy;
|
QMap<QString, QList<ExternalTool *> > toolsCopy;
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(tools);
|
for (auto it = tools.cbegin(), end = tools.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QList<ExternalTool *> itemCopy;
|
QList<ExternalTool *> itemCopy;
|
||||||
for (ExternalTool *tool : it.value())
|
for (ExternalTool *tool : it.value())
|
||||||
itemCopy.append(new ExternalTool(tool));
|
itemCopy.append(new ExternalTool(tool));
|
||||||
|
@@ -427,9 +427,8 @@ void DocumentManager::renamedFile(const QString &from, const QString &to)
|
|||||||
|
|
||||||
// gather the list of IDocuments
|
// gather the list of IDocuments
|
||||||
QList<IDocument *> documentsToRename;
|
QList<IDocument *> documentsToRename;
|
||||||
QMapIterator<IDocument *, QStringList> it(d->m_documentsWithWatch);
|
for (auto it = d->m_documentsWithWatch.cbegin(), end = d->m_documentsWithWatch.cend();
|
||||||
while (it.hasNext()) {
|
it != end; ++it) {
|
||||||
it.next();
|
|
||||||
if (it.value().contains(fromKey))
|
if (it.value().contains(fromKey))
|
||||||
documentsToRename.append(it.key());
|
documentsToRename.append(it.key());
|
||||||
}
|
}
|
||||||
@@ -1247,9 +1246,7 @@ void DocumentManager::checkForReload()
|
|||||||
|
|
||||||
// handle deleted files
|
// handle deleted files
|
||||||
EditorManager::closeDocuments(documentsToClose, false);
|
EditorManager::closeDocuments(documentsToClose, false);
|
||||||
QHashIterator<IDocument *, QString> it(documentsToSave);
|
for (auto it = documentsToSave.cbegin(), end = documentsToSave.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
saveDocument(it.key(), it.value());
|
saveDocument(it.key(), it.value());
|
||||||
it.key()->checkPermissions();
|
it.key()->checkPermissions();
|
||||||
}
|
}
|
||||||
@@ -1270,14 +1267,10 @@ void DocumentManager::addToRecentFiles(const QString &fileName, Id editorId)
|
|||||||
{
|
{
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return;
|
return;
|
||||||
QString fileKey = filePathKey(fileName, KeepLinks);
|
const QString fileKey = filePathKey(fileName, KeepLinks);
|
||||||
QMutableListIterator<RecentFile > it(d->m_recentFiles);
|
Utils::erase(d->m_recentFiles, [fileKey](const RecentFile &file) {
|
||||||
while (it.hasNext()) {
|
return fileKey == filePathKey(file.first, DocumentManager::KeepLinks);
|
||||||
RecentFile file = it.next();
|
});
|
||||||
QString recentFileKey(filePathKey(file.first, DocumentManager::KeepLinks));
|
|
||||||
if (fileKey == recentFileKey)
|
|
||||||
it.remove();
|
|
||||||
}
|
|
||||||
while (d->m_recentFiles.count() >= EditorManagerPrivate::maxRecentFiles())
|
while (d->m_recentFiles.count() >= EditorManagerPrivate::maxRecentFiles())
|
||||||
d->m_recentFiles.removeLast();
|
d->m_recentFiles.removeLast();
|
||||||
d->m_recentFiles.prepend(RecentFile(fileName, editorId));
|
d->m_recentFiles.prepend(RecentFile(fileName, editorId));
|
||||||
@@ -1325,15 +1318,15 @@ void readSettings()
|
|||||||
QSettings *s = ICore::settings();
|
QSettings *s = ICore::settings();
|
||||||
d->m_recentFiles.clear();
|
d->m_recentFiles.clear();
|
||||||
s->beginGroup(QLatin1String(settingsGroupC));
|
s->beginGroup(QLatin1String(settingsGroupC));
|
||||||
QStringList recentFiles = s->value(QLatin1String(filesKeyC)).toStringList();
|
const QStringList recentFiles = s->value(QLatin1String(filesKeyC)).toStringList();
|
||||||
QStringList recentEditorIds = s->value(QLatin1String(editorsKeyC)).toStringList();
|
const QStringList recentEditorIds = s->value(QLatin1String(editorsKeyC)).toStringList();
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
// clean non-existing files
|
// clean non-existing files
|
||||||
QStringListIterator ids(recentEditorIds);
|
for (int i = 0, n = recentFiles.size(); i < n; ++i) {
|
||||||
foreach (const QString &fileName, recentFiles) {
|
const QString &fileName = recentFiles.at(i);
|
||||||
QString editorId;
|
QString editorId;
|
||||||
if (ids.hasNext()) // guard against old or weird settings
|
if (i < recentEditorIds.size()) // guard against old or weird settings
|
||||||
editorId = ids.next();
|
editorId = recentEditorIds.at(i);
|
||||||
if (QFileInfo(fileName).isFile())
|
if (QFileInfo(fileName).isFile())
|
||||||
d->m_recentFiles.append(DocumentManager::RecentFile(QDir::fromNativeSeparators(fileName), // from native to guard against old settings
|
d->m_recentFiles.append(DocumentManager::RecentFile(QDir::fromNativeSeparators(fileName), // from native to guard against old settings
|
||||||
Id::fromString(editorId)));
|
Id::fromString(editorId)));
|
||||||
|
@@ -98,11 +98,8 @@ ExternalToolManager::ExternalToolManager()
|
|||||||
true);
|
true);
|
||||||
|
|
||||||
QMap<QString, QList<ExternalTool *> > categoryMap;
|
QMap<QString, QList<ExternalTool *> > categoryMap;
|
||||||
QMapIterator<QString, QMultiMap<int, ExternalTool*> > it(categoryPriorityMap);
|
for (auto it = categoryPriorityMap.cbegin(), end = categoryPriorityMap.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
categoryMap.insert(it.key(), it.value().values());
|
categoryMap.insert(it.key(), it.value().values());
|
||||||
}
|
|
||||||
|
|
||||||
// read renamed categories and custom order
|
// read renamed categories and custom order
|
||||||
readSettings(tools, &categoryMap);
|
readSettings(tools, &categoryMap);
|
||||||
@@ -177,9 +174,7 @@ void ExternalToolManager::setToolsByCategory(const QMap<QString, QList<ExternalT
|
|||||||
// delete old tools and create list of new ones
|
// delete old tools and create list of new ones
|
||||||
QMap<QString, ExternalTool *> newTools;
|
QMap<QString, ExternalTool *> newTools;
|
||||||
QMap<QString, QAction *> newActions;
|
QMap<QString, QAction *> newActions;
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(tools);
|
for (auto it = tools.cbegin(), end = tools.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
foreach (ExternalTool *tool, it.value()) {
|
foreach (ExternalTool *tool, it.value()) {
|
||||||
const QString id = tool->id();
|
const QString id = tool->id();
|
||||||
if (d->m_tools.value(id) == tool) {
|
if (d->m_tools.value(id) == tool) {
|
||||||
@@ -192,10 +187,9 @@ void ExternalToolManager::setToolsByCategory(const QMap<QString, QList<ExternalT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDeleteAll(d->m_tools);
|
qDeleteAll(d->m_tools);
|
||||||
QMapIterator<QString, QAction *> remainingActions(d->m_actions);
|
|
||||||
const Id externalToolsPrefix = "Tools.External.";
|
const Id externalToolsPrefix = "Tools.External.";
|
||||||
while (remainingActions.hasNext()) {
|
for (auto remainingActions = d->m_actions.cbegin(), end = d->m_actions.cend();
|
||||||
remainingActions.next();
|
remainingActions != end; ++remainingActions) {
|
||||||
ActionManager::unregisterAction(remainingActions.value(),
|
ActionManager::unregisterAction(remainingActions.value(),
|
||||||
externalToolsPrefix.withSuffix(remainingActions.key()));
|
externalToolsPrefix.withSuffix(remainingActions.key()));
|
||||||
delete remainingActions.value();
|
delete remainingActions.value();
|
||||||
@@ -208,9 +202,7 @@ void ExternalToolManager::setToolsByCategory(const QMap<QString, QList<ExternalT
|
|||||||
// create menu structure and remove no-longer used containers
|
// create menu structure and remove no-longer used containers
|
||||||
// add all the category menus, QMap is nicely sorted
|
// add all the category menus, QMap is nicely sorted
|
||||||
QMap<QString, ActionContainer *> newContainers;
|
QMap<QString, ActionContainer *> newContainers;
|
||||||
it.toFront();
|
for (auto it = tools.cbegin(), end = tools.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
ActionContainer *container = nullptr;
|
ActionContainer *container = nullptr;
|
||||||
const QString &containerName = it.key();
|
const QString &containerName = it.key();
|
||||||
if (containerName.isEmpty()) { // no displayCategory, so put into external tools menu directly
|
if (containerName.isEmpty()) { // no displayCategory, so put into external tools menu directly
|
||||||
@@ -302,9 +294,7 @@ static void writeSettings()
|
|||||||
settings->remove(QLatin1String(""));
|
settings->remove(QLatin1String(""));
|
||||||
|
|
||||||
settings->beginGroup(QLatin1String("OverrideCategories"));
|
settings->beginGroup(QLatin1String("OverrideCategories"));
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(d->m_categoryMap);
|
for (auto it = d->m_categoryMap.cbegin(), end = d->m_categoryMap.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QString category = it.key();
|
QString category = it.key();
|
||||||
if (category.isEmpty())
|
if (category.isEmpty())
|
||||||
category = QLatin1String(kSpecialUncategorizedSetting);
|
category = QLatin1String(kSpecialUncategorizedSetting);
|
||||||
|
@@ -222,12 +222,9 @@ const HelpItem::Links &HelpItem::links() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QMapIterator<QString, QUrl> it(helpLinks);
|
for (auto it = helpLinks.cbegin(), end = helpLinks.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
m_helpLinks->emplace_back(it.key(), it.value());
|
m_helpLinks->emplace_back(it.key(), it.value());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Utils::sort(*m_helpLinks, linkLessThan);
|
Utils::sort(*m_helpLinks, linkLessThan);
|
||||||
}
|
}
|
||||||
return *m_helpLinks;
|
return *m_helpLinks;
|
||||||
|
@@ -508,11 +508,9 @@ void ProgressManagerPrivate::updateSummaryProgressBar()
|
|||||||
stopFadeOfSummaryProgress();
|
stopFadeOfSummaryProgress();
|
||||||
|
|
||||||
m_summaryProgressBar->setFinished(false);
|
m_summaryProgressBar->setFinished(false);
|
||||||
QMapIterator<QFutureWatcher<void> *, Id> it(m_runningTasks);
|
|
||||||
static const int TASK_RANGE = 100;
|
static const int TASK_RANGE = 100;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
while (it.hasNext()) {
|
for (auto it = m_runningTasks.cbegin(), end = m_runningTasks.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
QFutureWatcher<void> *watcher = it.key();
|
QFutureWatcher<void> *watcher = it.key();
|
||||||
int min = watcher->progressMinimum();
|
int min = watcher->progressMinimum();
|
||||||
int range = watcher->progressMaximum() - min;
|
int range = watcher->progressMaximum() - min;
|
||||||
|
@@ -241,9 +241,8 @@ QStringList SettingsDatabase::childKeys() const
|
|||||||
QStringList children;
|
QStringList children;
|
||||||
|
|
||||||
const QString g = group();
|
const QString g = group();
|
||||||
QMapIterator<QString, QVariant> i(d->m_settings);
|
for (auto i = d->m_settings.cbegin(), end = d->m_settings.cend(); i != end; ++i) {
|
||||||
while (i.hasNext()) {
|
const QString &key = i.key();
|
||||||
const QString &key = i.next().key();
|
|
||||||
if (key.startsWith(g) && key.indexOf(QLatin1Char('/'), g.length() + 1) == -1)
|
if (key.startsWith(g) && key.indexOf(QLatin1Char('/'), g.length() + 1) == -1)
|
||||||
children.append(key.mid(g.length() + 1));
|
children.append(key.mid(g.length() + 1));
|
||||||
}
|
}
|
||||||
|
@@ -108,9 +108,7 @@ SideBar::~SideBar()
|
|||||||
|
|
||||||
QString SideBar::idForTitle(const QString &title) const
|
QString SideBar::idForTitle(const QString &title) const
|
||||||
{
|
{
|
||||||
QMapIterator<QString, QPointer<SideBarItem> > iter(d->m_itemMap);
|
for (auto iter = d->m_itemMap.cbegin(), end = d->m_itemMap.cend(); iter != end; ++iter) {
|
||||||
while (iter.hasNext()) {
|
|
||||||
iter.next();
|
|
||||||
if (iter.value().data()->title() == title)
|
if (iter.value().data()->title() == title)
|
||||||
return iter.key();
|
return iter.key();
|
||||||
}
|
}
|
||||||
@@ -266,11 +264,8 @@ void SideBar::saveSettings(QSettings *settings, const QString &name)
|
|||||||
if (!currentItemId.isEmpty())
|
if (!currentItemId.isEmpty())
|
||||||
views.append(currentItemId);
|
views.append(currentItemId);
|
||||||
}
|
}
|
||||||
if (views.isEmpty() && d->m_itemMap.size()) {
|
if (views.isEmpty() && !d->m_itemMap.isEmpty())
|
||||||
QMapIterator<QString, QPointer<SideBarItem> > iter(d->m_itemMap);
|
views.append(d->m_itemMap.cbegin().key());
|
||||||
iter.next();
|
|
||||||
views.append(iter.key());
|
|
||||||
}
|
|
||||||
|
|
||||||
settings->setValue(prefix + QLatin1String("Views"), views);
|
settings->setValue(prefix + QLatin1String("Views"), views);
|
||||||
settings->setValue(prefix + QLatin1String("Visible"),
|
settings->setValue(prefix + QLatin1String("Visible"),
|
||||||
|
@@ -103,9 +103,7 @@ static QString findUnusedId(const QString &proposal, const QMap<QString, QList<E
|
|||||||
result = proposal + (number > 0 ? QString::number(number) : QString::fromLatin1(""));
|
result = proposal + (number > 0 ? QString::number(number) : QString::fromLatin1(""));
|
||||||
++number;
|
++number;
|
||||||
found = false;
|
found = false;
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(tools);
|
for (auto it = tools.cbegin(), end = tools.cend(); it != end; ++it) {
|
||||||
while (!found && it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
foreach (ExternalTool *tool, it.value()) {
|
foreach (ExternalTool *tool, it.value()) {
|
||||||
if (tool->id() == result) {
|
if (tool->id() == result) {
|
||||||
found = true;
|
found = true;
|
||||||
@@ -125,9 +123,7 @@ void ToolSettings::apply()
|
|||||||
QMap<QString, ExternalTool *> originalTools = ExternalToolManager::toolsById();
|
QMap<QString, ExternalTool *> originalTools = ExternalToolManager::toolsById();
|
||||||
QMap<QString, QList<ExternalTool *> > newToolsMap = m_widget->tools();
|
QMap<QString, QList<ExternalTool *> > newToolsMap = m_widget->tools();
|
||||||
QMap<QString, QList<ExternalTool *> > resultMap;
|
QMap<QString, QList<ExternalTool *> > resultMap;
|
||||||
QMapIterator<QString, QList<ExternalTool *> > it(newToolsMap);
|
for (auto it = newToolsMap.cbegin(), end = newToolsMap.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QList<ExternalTool *> items;
|
QList<ExternalTool *> items;
|
||||||
foreach (ExternalTool *tool, it.value()) {
|
foreach (ExternalTool *tool, it.value()) {
|
||||||
ExternalTool *toolToAdd = nullptr;
|
ExternalTool *toolToAdd = nullptr;
|
||||||
|
@@ -1254,9 +1254,8 @@ void WorkingCopyModel::configure(const WorkingCopy &workingCopy)
|
|||||||
{
|
{
|
||||||
emit layoutAboutToBeChanged();
|
emit layoutAboutToBeChanged();
|
||||||
m_workingCopyList.clear();
|
m_workingCopyList.clear();
|
||||||
QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
|
const WorkingCopy::Table &elements = workingCopy.elements();
|
||||||
while (it.hasNext()) {
|
for (auto it = elements.cbegin(), end = elements.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
m_workingCopyList << WorkingCopyEntry(it.key().toString(), it.value().first,
|
m_workingCopyList << WorkingCopyEntry(it.key().toString(), it.value().first,
|
||||||
it.value().second);
|
it.value().second);
|
||||||
}
|
}
|
||||||
|
@@ -878,9 +878,8 @@ ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targetOffse
|
|||||||
const LocalSymbols localSymbols(targetFile->cppDocument(), targetDefinition);
|
const LocalSymbols localSymbols(targetFile->cppDocument(), targetDefinition);
|
||||||
const int endOfArguments = targetFile->endOf(targetFunctionDeclarator->rparen_token);
|
const int endOfArguments = targetFile->endOf(targetFunctionDeclarator->rparen_token);
|
||||||
|
|
||||||
QHashIterator<Symbol *, QString> it(renamedTargetParameters);
|
for (auto it = renamedTargetParameters.cbegin(), end = renamedTargetParameters.cend();
|
||||||
while (it.hasNext()) {
|
it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const QList<SemanticInfo::Use> &uses = localSymbols.uses.value(it.key());
|
const QList<SemanticInfo::Use> &uses = localSymbols.uses.value(it.key());
|
||||||
foreach (const SemanticInfo::Use &use, uses) {
|
foreach (const SemanticInfo::Use &use, uses) {
|
||||||
if (use.isInvalid())
|
if (use.isInvalid())
|
||||||
|
@@ -3729,10 +3729,8 @@ void ExtractFunction::match(const CppQuickFixInterface &interface, QuickFixOpera
|
|||||||
// Identify what would be parameters for the new function and its return value, if any.
|
// Identify what would be parameters for the new function and its return value, if any.
|
||||||
Symbol *funcReturn = nullptr;
|
Symbol *funcReturn = nullptr;
|
||||||
QList<QPair<QString, QString> > relevantDecls;
|
QList<QPair<QString, QString> > relevantDecls;
|
||||||
SemanticInfo::LocalUseIterator it(interface.semanticInfo().localUses);
|
const SemanticInfo::LocalUseMap &localUses = interface.semanticInfo().localUses;
|
||||||
while (it.hasNext()) {
|
for (auto it = localUses.cbegin(), end = localUses.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
|
|
||||||
bool usedBeforeExtraction = false;
|
bool usedBeforeExtraction = false;
|
||||||
bool usedAfterExtraction = false;
|
bool usedAfterExtraction = false;
|
||||||
bool usedInsideExtraction = false;
|
bool usedInsideExtraction = false;
|
||||||
|
@@ -205,9 +205,7 @@ private:
|
|||||||
|
|
||||||
LookupContext context(m_document, m_snapshot);
|
LookupContext context(m_document, m_snapshot);
|
||||||
|
|
||||||
CppTools::SemanticInfo::LocalUseIterator it(uses);
|
for (auto it = uses.cbegin(), end = uses.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const SemanticUses &uses = it.value();
|
const SemanticUses &uses = it.value();
|
||||||
|
|
||||||
bool good = false;
|
bool good = false;
|
||||||
|
@@ -618,9 +618,8 @@ void Dumper::dumpWorkingCopy(const WorkingCopy &workingCopy)
|
|||||||
m_out << "Working Copy contains " << workingCopy.size() << " entries{{{1\n";
|
m_out << "Working Copy contains " << workingCopy.size() << " entries{{{1\n";
|
||||||
|
|
||||||
const QByteArray i1 = indent(1);
|
const QByteArray i1 = indent(1);
|
||||||
QHashIterator< ::Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
|
const WorkingCopy::Table &elements = workingCopy.elements();
|
||||||
while (it.hasNext()) {
|
for (auto it = elements.cbegin(), end = elements.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const ::Utils::FilePath &filePath = it.key();
|
const ::Utils::FilePath &filePath = it.key();
|
||||||
unsigned sourcRevision = it.value().second;
|
unsigned sourcRevision = it.value().second;
|
||||||
m_out << i1 << "rev=" << sourcRevision << ", " << filePath << "\n";
|
m_out << i1 << "rev=" << sourcRevision << ", " << filePath << "\n";
|
||||||
|
@@ -93,9 +93,7 @@ struct Result
|
|||||||
{
|
{
|
||||||
QList<Result> result;
|
QList<Result> result;
|
||||||
|
|
||||||
CppTools::SemanticInfo::LocalUseIterator it(localUses);
|
for (auto it = localUses.cbegin(), end = localUses.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const CPlusPlus::Symbol *symbol = it.key();
|
const CPlusPlus::Symbol *symbol = it.key();
|
||||||
const QList<CppTools::SemanticInfo::Use> &uses = it.value();
|
const QList<CppTools::SemanticInfo::Use> &uses = it.value();
|
||||||
foreach (const CppTools::SemanticInfo::Use &use, uses)
|
foreach (const CppTools::SemanticInfo::Use &use, uses)
|
||||||
|
@@ -103,10 +103,7 @@ QList<IndexItem::Ptr> CppLocatorData::allIndexItems(
|
|||||||
const QHash<QString, QList<IndexItem::Ptr>> &items) const
|
const QHash<QString, QList<IndexItem::Ptr>> &items) const
|
||||||
{
|
{
|
||||||
QList<IndexItem::Ptr> result;
|
QList<IndexItem::Ptr> result;
|
||||||
QHashIterator<QString, QList<IndexItem::Ptr> > it(items);
|
for (const QList<IndexItem::Ptr> &subItems : items)
|
||||||
while (it.hasNext()) {
|
result.append(subItems);
|
||||||
it.next();
|
|
||||||
result.append(it.value());
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -608,10 +608,7 @@ void CppModelManager::ensureUpdated()
|
|||||||
QStringList CppModelManager::internalProjectFiles() const
|
QStringList CppModelManager::internalProjectFiles() const
|
||||||
{
|
{
|
||||||
QStringList files;
|
QStringList files;
|
||||||
QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
|
for (const ProjectInfo &pinfo : d->m_projectToProjectsInfo) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const ProjectInfo pinfo = it.value();
|
|
||||||
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
||||||
foreach (const ProjectFile &file, part->files)
|
foreach (const ProjectFile &file, part->files)
|
||||||
files += file.path;
|
files += file.path;
|
||||||
@@ -624,10 +621,7 @@ QStringList CppModelManager::internalProjectFiles() const
|
|||||||
ProjectExplorer::HeaderPaths CppModelManager::internalHeaderPaths() const
|
ProjectExplorer::HeaderPaths CppModelManager::internalHeaderPaths() const
|
||||||
{
|
{
|
||||||
ProjectExplorer::HeaderPaths headerPaths;
|
ProjectExplorer::HeaderPaths headerPaths;
|
||||||
QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
|
for (const ProjectInfo &pinfo : d->m_projectToProjectsInfo) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const ProjectInfo pinfo = it.value();
|
|
||||||
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
|
||||||
foreach (const ProjectExplorer::HeaderPath &path, part->headerPaths) {
|
foreach (const ProjectExplorer::HeaderPath &path, part->headerPaths) {
|
||||||
ProjectExplorer::HeaderPath hp(QDir::cleanPath(path.path), path.type);
|
ProjectExplorer::HeaderPath hp(QDir::cleanPath(path.path), path.type);
|
||||||
@@ -655,10 +649,7 @@ ProjectExplorer::Macros CppModelManager::internalDefinedMacros() const
|
|||||||
{
|
{
|
||||||
ProjectExplorer::Macros macros;
|
ProjectExplorer::Macros macros;
|
||||||
QSet<ProjectExplorer::Macro> alreadyIn;
|
QSet<ProjectExplorer::Macro> alreadyIn;
|
||||||
QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
|
for (const ProjectInfo &pinfo : d->m_projectToProjectsInfo) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const ProjectInfo pinfo = it.value();
|
|
||||||
for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
|
for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
|
||||||
addUnique(part->toolChainMacros, macros, alreadyIn);
|
addUnique(part->toolChainMacros, macros, alreadyIn);
|
||||||
addUnique(part->projectMacros, macros, alreadyIn);
|
addUnique(part->projectMacros, macros, alreadyIn);
|
||||||
@@ -783,11 +774,8 @@ WorkingCopy CppModelManager::buildWorkingCopyList()
|
|||||||
cppEditorDocument->revision());
|
cppEditorDocument->revision());
|
||||||
}
|
}
|
||||||
|
|
||||||
QSetIterator<AbstractEditorSupport *> it(d->m_extraEditorSupports);
|
for (AbstractEditorSupport *es : qAsConst(d->m_extraEditorSupports))
|
||||||
while (it.hasNext()) {
|
|
||||||
AbstractEditorSupport *es = it.next();
|
|
||||||
workingCopy.insert(es->fileName(), es->contents(), es->revision());
|
workingCopy.insert(es->fileName(), es->contents(), es->revision());
|
||||||
}
|
|
||||||
|
|
||||||
// Add the project configuration file
|
// Add the project configuration file
|
||||||
QByteArray conf = codeModelConfiguration();
|
QByteArray conf = codeModelConfiguration();
|
||||||
@@ -815,9 +803,7 @@ static QSet<QString> tooBigFilesRemoved(const QSet<QString> &files, int fileSize
|
|||||||
QSet<QString> result;
|
QSet<QString> result;
|
||||||
QFileInfo fileInfo;
|
QFileInfo fileInfo;
|
||||||
|
|
||||||
QSetIterator<QString> i(files);
|
for (const QString &filePath : files) {
|
||||||
while (i.hasNext()) {
|
|
||||||
const QString filePath = i.next();
|
|
||||||
fileInfo.setFile(filePath);
|
fileInfo.setFile(filePath);
|
||||||
if (fileSizeExceedsLimit(fileInfo, fileSizeLimitInMb))
|
if (fileSizeExceedsLimit(fileInfo, fileSizeLimitInMb))
|
||||||
continue;
|
continue;
|
||||||
@@ -887,9 +873,8 @@ QList<CppEditorDocumentHandle *> CppModelManager::cppEditorDocuments() const
|
|||||||
void CppModelManager::removeFilesFromSnapshot(const QSet<QString> &filesToRemove)
|
void CppModelManager::removeFilesFromSnapshot(const QSet<QString> &filesToRemove)
|
||||||
{
|
{
|
||||||
QMutexLocker snapshotLocker(&d->m_snapshotMutex);
|
QMutexLocker snapshotLocker(&d->m_snapshotMutex);
|
||||||
QSetIterator<QString> i(filesToRemove);
|
for (const QString &file : filesToRemove)
|
||||||
while (i.hasNext())
|
d->m_snapshot.remove(file);
|
||||||
d->m_snapshot.remove(i.next());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProjectInfoComparer
|
class ProjectInfoComparer
|
||||||
@@ -935,9 +920,7 @@ public:
|
|||||||
commonSourceFiles.intersect(m_oldSourceFiles);
|
commonSourceFiles.intersect(m_oldSourceFiles);
|
||||||
|
|
||||||
QList<Document::Ptr> documentsToCheck;
|
QList<Document::Ptr> documentsToCheck;
|
||||||
QSetIterator<QString> i(commonSourceFiles);
|
for (const QString &file : commonSourceFiles) {
|
||||||
while (i.hasNext()) {
|
|
||||||
const QString file = i.next();
|
|
||||||
if (Document::Ptr document = snapshot.document(file))
|
if (Document::Ptr document = snapshot.document(file))
|
||||||
documentsToCheck << document;
|
documentsToCheck << document;
|
||||||
}
|
}
|
||||||
|
@@ -618,11 +618,10 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
|
|||||||
QCOMPARE(workingCopy.size(), 2); // mm->configurationFileName() and "ui_*.h"
|
QCOMPARE(workingCopy.size(), 2); // mm->configurationFileName() and "ui_*.h"
|
||||||
|
|
||||||
QStringList fileNamesInWorkinCopy;
|
QStringList fileNamesInWorkinCopy;
|
||||||
QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
|
const WorkingCopy::Table &elements = workingCopy.elements();
|
||||||
while (it.hasNext()) {
|
for (auto it = elements.cbegin(), end = elements.cend(); it != end; ++it)
|
||||||
it.next();
|
|
||||||
fileNamesInWorkinCopy << Utils::FilePath::fromString(it.key().toString()).fileName();
|
fileNamesInWorkinCopy << Utils::FilePath::fromString(it.key().toString()).fileName();
|
||||||
}
|
|
||||||
fileNamesInWorkinCopy.sort();
|
fileNamesInWorkinCopy.sort();
|
||||||
const QString expectedUiHeaderFileName = _("ui_mainwindow.h");
|
const QString expectedUiHeaderFileName = _("ui_mainwindow.h");
|
||||||
QCOMPARE(fileNamesInWorkinCopy.at(0), mm->configurationFileName());
|
QCOMPARE(fileNamesInWorkinCopy.at(0), mm->configurationFileName());
|
||||||
|
@@ -62,7 +62,6 @@ public:
|
|||||||
public:
|
public:
|
||||||
using Use = TextEditor::HighlightingResult;
|
using Use = TextEditor::HighlightingResult;
|
||||||
using LocalUseMap = QHash<CPlusPlus::Symbol *, QList<Use>>;
|
using LocalUseMap = QHash<CPlusPlus::Symbol *, QList<Use>>;
|
||||||
using LocalUseIterator = QHashIterator<CPlusPlus::Symbol *, QList<Use>>;
|
|
||||||
|
|
||||||
// Document specific
|
// Document specific
|
||||||
unsigned revision = 0;
|
unsigned revision = 0;
|
||||||
|
@@ -70,14 +70,14 @@ public:
|
|||||||
QPair<QByteArray, unsigned> get(const Utils::FilePath &fileName) const
|
QPair<QByteArray, unsigned> get(const Utils::FilePath &fileName) const
|
||||||
{ return _elements.value(fileName); }
|
{ return _elements.value(fileName); }
|
||||||
|
|
||||||
QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > iterator() const
|
using Table = QHash<Utils::FilePath, QPair<QByteArray, unsigned> >;
|
||||||
{ return QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> >(_elements); }
|
const Table &elements() const
|
||||||
|
{ return _elements; }
|
||||||
|
|
||||||
int size() const
|
int size() const
|
||||||
{ return _elements.size(); }
|
{ return _elements.size(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using Table = QHash<Utils::FilePath, QPair<QByteArray, unsigned> >;
|
|
||||||
Table _elements;
|
Table _elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -2048,9 +2048,7 @@ void GdbEngine::setTokenBarrier()
|
|||||||
{
|
{
|
||||||
//QTC_ASSERT(m_nonDiscardableCount == 0, /**/);
|
//QTC_ASSERT(m_nonDiscardableCount == 0, /**/);
|
||||||
bool good = true;
|
bool good = true;
|
||||||
QHashIterator<int, DebuggerCommand> it(m_commandForToken);
|
for (auto it = m_commandForToken.cbegin(), end = m_commandForToken.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (!(m_flagsForToken.value(it.key()) & Discardable)) {
|
if (!(m_flagsForToken.value(it.key()) & Discardable)) {
|
||||||
qDebug() << "TOKEN: " << it.key() << "CMD:" << it.value().function;
|
qDebug() << "TOKEN: " << it.key() << "CMD:" << it.value().function;
|
||||||
good = false;
|
good = false;
|
||||||
|
@@ -886,12 +886,10 @@ static ConsoleItem *constructLogItemTree(const QVariant &result,
|
|||||||
else
|
else
|
||||||
text = key + " : Object";
|
text = key + " : Object";
|
||||||
|
|
||||||
QMap<QString, QVariant> resultMap = result.toMap();
|
const QMap<QString, QVariant> resultMap = result.toMap();
|
||||||
QVarLengthArray<ConsoleItem *> children(resultMap.size());
|
QVarLengthArray<ConsoleItem *> children(resultMap.size());
|
||||||
QMapIterator<QString, QVariant> i(result.toMap());
|
|
||||||
auto it = children.begin();
|
auto it = children.begin();
|
||||||
while (i.hasNext()) {
|
for (auto i = resultMap.cbegin(), end = resultMap.cend(); i != end; ++i) {
|
||||||
i.next();
|
|
||||||
*(it++) = constructLogItemTree(i.value(), i.key());
|
*(it++) = constructLogItemTree(i.value(), i.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -220,18 +220,14 @@ static void saveWatchers()
|
|||||||
|
|
||||||
static void loadFormats()
|
static void loadFormats()
|
||||||
{
|
{
|
||||||
QVariant value = SessionManager::value("DefaultFormats");
|
QMap<QString, QVariant> value = SessionManager::value("DefaultFormats").toMap();
|
||||||
QMapIterator<QString, QVariant> it(value.toMap());
|
for (auto it = value.cbegin(), end = value.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (!it.key().isEmpty())
|
if (!it.key().isEmpty())
|
||||||
theTypeFormats.insert(it.key(), it.value().toInt());
|
theTypeFormats.insert(it.key(), it.value().toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
value = SessionManager::value("IndividualFormats");
|
value = SessionManager::value("IndividualFormats").toMap();
|
||||||
it = QMapIterator<QString, QVariant>(value.toMap());
|
for (auto it = value.cbegin(), end = value.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (!it.key().isEmpty())
|
if (!it.key().isEmpty())
|
||||||
theIndividualFormats.insert(it.key(), it.value().toInt());
|
theIndividualFormats.insert(it.key(), it.value().toInt());
|
||||||
}
|
}
|
||||||
@@ -240,9 +236,7 @@ static void loadFormats()
|
|||||||
static void saveFormats()
|
static void saveFormats()
|
||||||
{
|
{
|
||||||
QMap<QString, QVariant> formats;
|
QMap<QString, QVariant> formats;
|
||||||
QHashIterator<QString, int> it(theTypeFormats);
|
for (auto it = theTypeFormats.cbegin(), end = theTypeFormats.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const int format = it.value();
|
const int format = it.value();
|
||||||
if (format != AutomaticFormat) {
|
if (format != AutomaticFormat) {
|
||||||
const QString key = it.key().trimmed();
|
const QString key = it.key().trimmed();
|
||||||
@@ -253,9 +247,7 @@ static void saveFormats()
|
|||||||
SessionManager::setValue("DefaultFormats", formats);
|
SessionManager::setValue("DefaultFormats", formats);
|
||||||
|
|
||||||
formats.clear();
|
formats.clear();
|
||||||
it = QHashIterator<QString, int>(theIndividualFormats);
|
for (auto it = theIndividualFormats.cbegin(), end = theIndividualFormats.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const int format = it.value();
|
const int format = it.value();
|
||||||
const QString key = it.key().trimmed();
|
const QString key = it.key().trimmed();
|
||||||
if (!key.isEmpty())
|
if (!key.isEmpty())
|
||||||
@@ -2395,9 +2387,7 @@ QStringList WatchHandler::watchedExpressions()
|
|||||||
{
|
{
|
||||||
// Filter out invalid watchers.
|
// Filter out invalid watchers.
|
||||||
QStringList watcherNames;
|
QStringList watcherNames;
|
||||||
QMapIterator<QString, int> it(theWatcherNames);
|
for (auto it = theWatcherNames.cbegin(), end = theWatcherNames.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const QString &watcherName = it.key();
|
const QString &watcherName = it.key();
|
||||||
if (!watcherName.isEmpty())
|
if (!watcherName.isEmpty())
|
||||||
watcherNames.push_back(watcherName);
|
watcherNames.push_back(watcherName);
|
||||||
@@ -2512,9 +2502,7 @@ QString WatchHandler::typeFormatRequests() const
|
|||||||
{
|
{
|
||||||
QString ba;
|
QString ba;
|
||||||
if (!theTypeFormats.isEmpty()) {
|
if (!theTypeFormats.isEmpty()) {
|
||||||
QHashIterator<QString, int> it(theTypeFormats);
|
for (auto it = theTypeFormats.cbegin(), end = theTypeFormats.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const int format = it.value();
|
const int format = it.value();
|
||||||
if (format != AutomaticFormat) {
|
if (format != AutomaticFormat) {
|
||||||
ba.append(toHex(it.key()));
|
ba.append(toHex(it.key()));
|
||||||
@@ -2532,9 +2520,7 @@ QString WatchHandler::individualFormatRequests() const
|
|||||||
{
|
{
|
||||||
QString res;
|
QString res;
|
||||||
if (!theIndividualFormats.isEmpty()) {
|
if (!theIndividualFormats.isEmpty()) {
|
||||||
QHashIterator<QString, int> it(theIndividualFormats);
|
for (auto it = theIndividualFormats.cbegin(), end = theIndividualFormats.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const int format = it.value();
|
const int format = it.value();
|
||||||
if (format != AutomaticFormat) {
|
if (format != AutomaticFormat) {
|
||||||
res.append(it.key());
|
res.append(it.key());
|
||||||
@@ -2548,19 +2534,16 @@ QString WatchHandler::individualFormatRequests() const
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::appendFormatRequests(DebuggerCommand *cmd)
|
void WatchHandler::appendFormatRequests(DebuggerCommand *cmd) const
|
||||||
{
|
{
|
||||||
QJsonArray expanded;
|
QJsonArray expanded;
|
||||||
QSetIterator<QString> jt(m_model->m_expandedINames);
|
for (const QString &name : qAsConst(m_model->m_expandedINames))
|
||||||
while (jt.hasNext())
|
expanded.append(name);
|
||||||
expanded.append(jt.next());
|
|
||||||
|
|
||||||
cmd->arg("expanded", expanded);
|
cmd->arg("expanded", expanded);
|
||||||
|
|
||||||
QJsonObject typeformats;
|
QJsonObject typeformats;
|
||||||
QHashIterator<QString, int> it(theTypeFormats);
|
for (auto it = theTypeFormats.cbegin(), end = theTypeFormats.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const int format = it.value();
|
const int format = it.value();
|
||||||
if (format != AutomaticFormat)
|
if (format != AutomaticFormat)
|
||||||
typeformats.insert(it.key(), format);
|
typeformats.insert(it.key(), format);
|
||||||
@@ -2568,12 +2551,10 @@ void WatchHandler::appendFormatRequests(DebuggerCommand *cmd)
|
|||||||
cmd->arg("typeformats", typeformats);
|
cmd->arg("typeformats", typeformats);
|
||||||
|
|
||||||
QJsonObject formats;
|
QJsonObject formats;
|
||||||
QHashIterator<QString, int> it2(theIndividualFormats);
|
for (auto it = theIndividualFormats.cbegin(), end = theIndividualFormats.cend(); it != end; ++it) {
|
||||||
while (it2.hasNext()) {
|
const int format = it.value();
|
||||||
it2.next();
|
|
||||||
const int format = it2.value();
|
|
||||||
if (format != AutomaticFormat)
|
if (format != AutomaticFormat)
|
||||||
formats.insert(it2.key(), format);
|
formats.insert(it.key(), format);
|
||||||
}
|
}
|
||||||
cmd->arg("formats", formats);
|
cmd->arg("formats", formats);
|
||||||
}
|
}
|
||||||
@@ -2586,18 +2567,16 @@ static inline QJsonObject watcher(const QString &iname, const QString &exp)
|
|||||||
return watcher;
|
return watcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::appendWatchersAndTooltipRequests(DebuggerCommand *cmd)
|
void WatchHandler::appendWatchersAndTooltipRequests(DebuggerCommand *cmd) const
|
||||||
{
|
{
|
||||||
QJsonArray watchers;
|
QJsonArray watchers;
|
||||||
const DebuggerToolTipContexts toolTips = m_engine->toolTipManager()->pendingTooltips();
|
const DebuggerToolTipContexts toolTips = m_engine->toolTipManager()->pendingTooltips();
|
||||||
for (const DebuggerToolTipContext &p : toolTips)
|
for (const DebuggerToolTipContext &p : toolTips)
|
||||||
watchers.append(watcher(p.iname, p.expression));
|
watchers.append(watcher(p.iname, p.expression));
|
||||||
|
|
||||||
QMapIterator<QString, int> it(WatchHandler::watcherNames());
|
for (auto it = theWatcherNames.cbegin(), end = theWatcherNames.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
watchers.append(watcher("watch." + QString::number(it.value()), it.key()));
|
watchers.append(watcher("watch." + QString::number(it.value()), it.key()));
|
||||||
}
|
|
||||||
cmd->arg("watchers", watchers);
|
cmd->arg("watchers", watchers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,8 +86,8 @@ public:
|
|||||||
static QStringList watchedExpressions();
|
static QStringList watchedExpressions();
|
||||||
static QMap<QString, int> watcherNames();
|
static QMap<QString, int> watcherNames();
|
||||||
|
|
||||||
void appendFormatRequests(DebuggerCommand *cmd);
|
void appendFormatRequests(DebuggerCommand *cmd) const;
|
||||||
void appendWatchersAndTooltipRequests(DebuggerCommand *cmd);
|
void appendWatchersAndTooltipRequests(DebuggerCommand *cmd) const;
|
||||||
|
|
||||||
QString typeFormatRequests() const;
|
QString typeFormatRequests() const;
|
||||||
QString individualFormatRequests() const;
|
QString individualFormatRequests() const;
|
||||||
|
@@ -516,13 +516,11 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName,
|
|||||||
newDocTable.insert(i.value());
|
newDocTable.insert(i.value());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const CppTools::WorkingCopy workingCopy =
|
|
||||||
CppTools::CppModelManager::instance()->workingCopy();
|
|
||||||
const Utils::FilePath configFileName =
|
const Utils::FilePath configFileName =
|
||||||
Utils::FilePath::fromString(CppTools::CppModelManager::configurationFileName());
|
Utils::FilePath::fromString(CppTools::CppModelManager::configurationFileName());
|
||||||
QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator();
|
const CppTools::WorkingCopy::Table &elements =
|
||||||
while (it.hasNext()) {
|
CppTools::CppModelManager::instance()->workingCopy().elements();
|
||||||
it.next();
|
for (auto it = elements.cbegin(), end = elements.cend(); it != end; ++it) {
|
||||||
const Utils::FilePath &fileName = it.key();
|
const Utils::FilePath &fileName = it.key();
|
||||||
if (fileName != configFileName)
|
if (fileName != configFileName)
|
||||||
newDocTable.insert(docTable.document(fileName));
|
newDocTable.insert(docTable.document(fileName));
|
||||||
|
@@ -321,7 +321,6 @@ private:
|
|||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
};
|
};
|
||||||
using Marks = QHash<QChar, Mark>;
|
using Marks = QHash<QChar, Mark>;
|
||||||
using MarksIterator = QHashIterator<QChar, Mark>;
|
|
||||||
|
|
||||||
struct State
|
struct State
|
||||||
{
|
{
|
||||||
@@ -3605,8 +3604,7 @@ void FakeVimHandler::Private::updateSelection()
|
|||||||
{
|
{
|
||||||
QList<QTextEdit::ExtraSelection> selections = m_extraSelections;
|
QList<QTextEdit::ExtraSelection> selections = m_extraSelections;
|
||||||
if (hasConfig(ConfigShowMarks)) {
|
if (hasConfig(ConfigShowMarks)) {
|
||||||
for (MarksIterator it(m_buffer->marks); it.hasNext(); ) {
|
for (auto it = m_buffer->marks.cbegin(), end = m_buffer->marks.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
QTextEdit::ExtraSelection sel;
|
QTextEdit::ExtraSelection sel;
|
||||||
sel.cursor = m_cursor;
|
sel.cursor = m_cursor;
|
||||||
setCursorPosition(&sel.cursor, it.value().position(document()));
|
setCursorPosition(&sel.cursor, it.value().position(document()));
|
||||||
@@ -5724,9 +5722,7 @@ bool FakeVimHandler::Private::handleExRegisterCommand(const ExCommand &cmd)
|
|||||||
QByteArray regs = cmd.args.toLatin1();
|
QByteArray regs = cmd.args.toLatin1();
|
||||||
if (regs.isEmpty()) {
|
if (regs.isEmpty()) {
|
||||||
regs = "\"0123456789";
|
regs = "\"0123456789";
|
||||||
QHashIterator<int, Register> it(g.registers);
|
for (auto it = g.registers.cbegin(), end = g.registers.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (it.key() > '9')
|
if (it.key() > '9')
|
||||||
regs += char(it.key());
|
regs += char(it.key());
|
||||||
}
|
}
|
||||||
@@ -8535,10 +8531,8 @@ bool FakeVimHandler::Private::jumpToMark(QChar mark, bool backTickMode)
|
|||||||
|
|
||||||
void FakeVimHandler::Private::updateMarks(const Marks &newMarks)
|
void FakeVimHandler::Private::updateMarks(const Marks &newMarks)
|
||||||
{
|
{
|
||||||
for (MarksIterator it(newMarks); it.hasNext(); ) {
|
for (auto it = newMarks.cbegin(), end = newMarks.cend(); it != end; ++it)
|
||||||
it.next();
|
|
||||||
m_buffer->marks[it.key()] = it.value();
|
m_buffer->marks[it.key()] = it.value();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RangeMode FakeVimHandler::Private::registerRangeMode(int reg) const
|
RangeMode FakeVimHandler::Private::registerRangeMode(int reg) const
|
||||||
|
@@ -103,11 +103,9 @@ bool GerritRemoteChooser::updateRemotes(bool forceReload)
|
|||||||
m_remoteComboBox->clear();
|
m_remoteComboBox->clear();
|
||||||
m_remotes.clear();
|
m_remotes.clear();
|
||||||
QString errorMessage; // Mute errors. We'll just fallback to the defaults
|
QString errorMessage; // Mute errors. We'll just fallback to the defaults
|
||||||
QMap<QString, QString> remotesList =
|
const QMap<QString, QString> remotesList =
|
||||||
Git::Internal::GitPlugin::client()->synchronousRemotesList(m_repository, &errorMessage);
|
Git::Internal::GitPlugin::client()->synchronousRemotesList(m_repository, &errorMessage);
|
||||||
QMapIterator<QString, QString> mapIt(remotesList);
|
for (auto mapIt = remotesList.cbegin(), end = remotesList.cend(); mapIt != end; ++mapIt) {
|
||||||
while (mapIt.hasNext()) {
|
|
||||||
mapIt.next();
|
|
||||||
GerritServer server;
|
GerritServer server;
|
||||||
if (!server.fillFromRemote(mapIt.value(), *m_parameters, forceReload))
|
if (!server.fillFromRemote(mapIt.value(), *m_parameters, forceReload))
|
||||||
continue;
|
continue;
|
||||||
|
@@ -474,9 +474,8 @@ void IosConfigurations::loadProvisioningData(bool notify)
|
|||||||
const QSettings xcodeSettings(xcodePlistPath, QSettings::NativeFormat);
|
const QSettings xcodeSettings(xcodePlistPath, QSettings::NativeFormat);
|
||||||
const QVariantMap teamMap = xcodeSettings.value(provisioningTeamsTag).toMap();
|
const QVariantMap teamMap = xcodeSettings.value(provisioningTeamsTag).toMap();
|
||||||
QList<QVariantMap> teams;
|
QList<QVariantMap> teams;
|
||||||
QMapIterator<QString, QVariant> accountiterator(teamMap);
|
for (auto accountiterator = teamMap.cbegin(), end = teamMap.cend();
|
||||||
while (accountiterator.hasNext()) {
|
accountiterator != end; ++accountiterator) {
|
||||||
accountiterator.next();
|
|
||||||
QVariantMap teamInfo = accountiterator.value().toMap();
|
QVariantMap teamInfo = accountiterator.value().toMap();
|
||||||
int provisioningTeamIsFree = teamInfo.value(freeTeamTag).toBool() ? 1 : 0;
|
int provisioningTeamIsFree = teamInfo.value(freeTeamTag).toBool() ? 1 : 0;
|
||||||
teamInfo[freeTeamTag] = provisioningTeamIsFree;
|
teamInfo[freeTeamTag] = provisioningTeamIsFree;
|
||||||
|
@@ -108,9 +108,7 @@ IosDevice::IosDevice(const QString &uid)
|
|||||||
IDevice::DeviceInfo IosDevice::deviceInformation() const
|
IDevice::DeviceInfo IosDevice::deviceInformation() const
|
||||||
{
|
{
|
||||||
IDevice::DeviceInfo res;
|
IDevice::DeviceInfo res;
|
||||||
QMapIterator<QString, QString> i(m_extraInfo);
|
for (auto i = m_extraInfo.cbegin(), end = m_extraInfo.cend(); i != end; ++i) {
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
IosDeviceManager::TranslationMap tMap = IosDeviceManager::translationMap();
|
IosDeviceManager::TranslationMap tMap = IosDeviceManager::translationMap();
|
||||||
if (tMap.contains(i.key()))
|
if (tMap.contains(i.key()))
|
||||||
res.append(DeviceInfoItem(tMap.value(i.key()), tMap.value(i.value(), i.value())));
|
res.append(DeviceInfoItem(tMap.value(i.key()), tMap.value(i.value(), i.value())));
|
||||||
@@ -131,24 +129,19 @@ DeviceProcessSignalOperation::Ptr IosDevice::signalOperation() const
|
|||||||
void IosDevice::fromMap(const QVariantMap &map)
|
void IosDevice::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
IDevice::fromMap(map);
|
IDevice::fromMap(map);
|
||||||
QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap();
|
|
||||||
QMapIterator<QString, QVariant> i(vMap);
|
|
||||||
m_extraInfo.clear();
|
m_extraInfo.clear();
|
||||||
while (i.hasNext()) {
|
const QVariantMap vMap = map.value(QLatin1String(Constants::EXTRA_INFO_KEY)).toMap();
|
||||||
i.next();
|
for (auto i = vMap.cbegin(), end = vMap.cend(); i != end; ++i)
|
||||||
m_extraInfo.insert(i.key(), i.value().toString());
|
m_extraInfo.insert(i.key(), i.value().toString());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap IosDevice::toMap() const
|
QVariantMap IosDevice::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap res = IDevice::toMap();
|
QVariantMap res = IDevice::toMap();
|
||||||
QVariantMap vMap;
|
QVariantMap vMap;
|
||||||
QMapIterator<QString, QString> i(m_extraInfo);
|
for (auto i = m_extraInfo.cbegin(), end = m_extraInfo.cend(); i != end; ++i)
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
vMap.insert(i.key(), i.value());
|
vMap.insert(i.key(), i.value());
|
||||||
}
|
|
||||||
res.insert(QLatin1String(Constants::EXTRA_INFO_KEY), vMap);
|
res.insert(QLatin1String(Constants::EXTRA_INFO_KEY), vMap);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -76,11 +76,8 @@ void MacroEvent::save(QDataStream &stream) const
|
|||||||
{
|
{
|
||||||
stream << m_id.name();
|
stream << m_id.name();
|
||||||
stream << m_values.count();
|
stream << m_values.count();
|
||||||
QMapIterator<quint8, QVariant> i(m_values);
|
for (auto i = m_values.cbegin(), end = m_values.cend(); i != end; ++i)
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
stream << i.key() << i.value();
|
stream << i.key() << i.value();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Id MacroEvent::id() const
|
Core::Id MacroEvent::id() const
|
||||||
|
@@ -56,10 +56,8 @@ QList<Core::LocatorFilterEntry> MacroLocatorFilter::matchesFor(QFutureInterface<
|
|||||||
const Qt::CaseSensitivity entryCaseSensitivity = caseSensitivity(entry);
|
const Qt::CaseSensitivity entryCaseSensitivity = caseSensitivity(entry);
|
||||||
|
|
||||||
const QMap<QString, Macro*> ¯os = MacroManager::macros();
|
const QMap<QString, Macro*> ¯os = MacroManager::macros();
|
||||||
QMapIterator<QString, Macro*> it(macros);
|
|
||||||
|
|
||||||
while (it.hasNext()) {
|
for (auto it = macros.cbegin(), end = macros.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const QString displayName = it.key();
|
const QString displayName = it.key();
|
||||||
const QString description = it.value()->description();
|
const QString description = it.value()->description();
|
||||||
|
|
||||||
|
@@ -88,10 +88,7 @@ void MacroOptionsWidget::createTable()
|
|||||||
{
|
{
|
||||||
QDir dir(MacroManager::macrosDirectory());
|
QDir dir(MacroManager::macrosDirectory());
|
||||||
const Core::Id base = Core::Id(Constants::PREFIX_MACRO);
|
const Core::Id base = Core::Id(Constants::PREFIX_MACRO);
|
||||||
QMapIterator<QString, Macro *> it(MacroManager::macros());
|
for (Macro *macro : MacroManager::macros()) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
Macro *macro = it.value();
|
|
||||||
QFileInfo fileInfo(macro->fileName());
|
QFileInfo fileInfo(macro->fileName());
|
||||||
if (fileInfo.absoluteDir() == dir.absolutePath()) {
|
if (fileInfo.absoluteDir() == dir.absolutePath()) {
|
||||||
auto macroItem = new QTreeWidgetItem(m_ui->treeWidget);
|
auto macroItem = new QTreeWidgetItem(m_ui->treeWidget);
|
||||||
@@ -140,11 +137,8 @@ void MacroOptionsWidget::apply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change macro
|
// Change macro
|
||||||
QMapIterator<QString, QString> it(m_macroToChange);
|
for (auto it = m_macroToChange.cbegin(), end = m_macroToChange.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
MacroManager::instance()->changeMacro(it.key(), it.value());
|
MacroManager::instance()->changeMacro(it.key(), it.value());
|
||||||
}
|
|
||||||
|
|
||||||
// Reinitialize the page
|
// Reinitialize the page
|
||||||
initialize();
|
initialize();
|
||||||
|
@@ -54,11 +54,8 @@ QByteArray PerforceSubmitEditor::fileContents() const
|
|||||||
const_cast<PerforceSubmitEditor*>(this)->updateEntries();
|
const_cast<PerforceSubmitEditor*>(this)->updateEntries();
|
||||||
QString text;
|
QString text;
|
||||||
QTextStream out(&text);
|
QTextStream out(&text);
|
||||||
QMapIterator<QString, QString> it(m_entries);
|
for (auto it = m_entries.cbegin(), end = m_entries.cend(); it != end; ++it)
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
out << it.key() << ":" << it.value();
|
out << it.key() << ":" << it.value();
|
||||||
}
|
|
||||||
return text.toLocal8Bit();
|
return text.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,12 +40,7 @@ CodeStyleSettingsWidget::CodeStyleSettingsWidget(Project *project) : QWidget(),
|
|||||||
|
|
||||||
const EditorConfiguration *config = m_project->editorConfiguration();
|
const EditorConfiguration *config = m_project->editorConfiguration();
|
||||||
|
|
||||||
QMap<Core::Id, ICodeStylePreferencesFactory *> factories
|
for (ICodeStylePreferencesFactory *factory : TextEditorSettings::codeStyleFactories()) {
|
||||||
= TextEditorSettings::codeStyleFactories();
|
|
||||||
QMapIterator<Core::Id, ICodeStylePreferencesFactory *> it(factories);
|
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
ICodeStylePreferencesFactory *factory = it.value();
|
|
||||||
Core::Id languageId = factory->languageId();
|
Core::Id languageId = factory->languageId();
|
||||||
ICodeStylePreferences *codeStylePreferences = config->codeStyle(languageId);
|
ICodeStylePreferences *codeStylePreferences = config->codeStyle(languageId);
|
||||||
|
|
||||||
|
@@ -86,9 +86,8 @@ struct EditorConfigurationPrivate
|
|||||||
EditorConfiguration::EditorConfiguration() : d(std::make_unique<EditorConfigurationPrivate>())
|
EditorConfiguration::EditorConfiguration() : d(std::make_unique<EditorConfigurationPrivate>())
|
||||||
{
|
{
|
||||||
const QMap<Core::Id, ICodeStylePreferences *> languageCodeStylePreferences = TextEditorSettings::codeStyles();
|
const QMap<Core::Id, ICodeStylePreferences *> languageCodeStylePreferences = TextEditorSettings::codeStyles();
|
||||||
QMapIterator<Core::Id, ICodeStylePreferences *> itCodeStyle(languageCodeStylePreferences);
|
for (auto itCodeStyle = languageCodeStylePreferences.cbegin(), end = languageCodeStylePreferences.cend();
|
||||||
while (itCodeStyle.hasNext()) {
|
itCodeStyle != end; ++itCodeStyle) {
|
||||||
itCodeStyle.next();
|
|
||||||
Core::Id languageId = itCodeStyle.key();
|
Core::Id languageId = itCodeStyle.key();
|
||||||
// global prefs for language
|
// global prefs for language
|
||||||
ICodeStylePreferences *originalPreferences = itCodeStyle.value();
|
ICodeStylePreferences *originalPreferences = itCodeStyle.value();
|
||||||
@@ -189,10 +188,11 @@ QVariantMap EditorConfiguration::toMap() const
|
|||||||
map.insert(kCodec, d->m_textCodec->name());
|
map.insert(kCodec, d->m_textCodec->name());
|
||||||
|
|
||||||
map.insert(kCodeStyleCount, d->m_languageCodeStylePreferences.count());
|
map.insert(kCodeStyleCount, d->m_languageCodeStylePreferences.count());
|
||||||
QMapIterator<Core::Id, ICodeStylePreferences *> itCodeStyle(d->m_languageCodeStylePreferences);
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (itCodeStyle.hasNext()) {
|
for (auto itCodeStyle = d->m_languageCodeStylePreferences.cbegin(),
|
||||||
itCodeStyle.next();
|
end = d->m_languageCodeStylePreferences.cend();
|
||||||
|
itCodeStyle != end; ++itCodeStyle) {
|
||||||
QVariantMap settingsIdMap;
|
QVariantMap settingsIdMap;
|
||||||
settingsIdMap.insert(QLatin1String("language"), itCodeStyle.key().toSetting());
|
settingsIdMap.insert(QLatin1String("language"), itCodeStyle.key().toSetting());
|
||||||
QVariantMap value;
|
QVariantMap value;
|
||||||
|
@@ -469,9 +469,7 @@ QVariantMap UserFileAccessor::prepareToWriteSettings(const QVariantMap &data) co
|
|||||||
QVariantMap UserFileVersion14Upgrader::upgrade(const QVariantMap &map)
|
QVariantMap UserFileVersion14Upgrader::upgrade(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
QVariantMap result;
|
QVariantMap result;
|
||||||
QMapIterator<QString, QVariant> it(map);
|
for (auto it = map.cbegin(), end = map.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (it.value().type() == QVariant::Map)
|
if (it.value().type() == QVariant::Map)
|
||||||
result.insert(it.key(), upgrade(it.value().toMap()));
|
result.insert(it.key(), upgrade(it.value().toMap()));
|
||||||
else if (it.key() == "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory"
|
else if (it.key() == "AutotoolsProjectManager.AutotoolsBuildConfiguration.BuildDirectory"
|
||||||
|
@@ -814,9 +814,8 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
|
|||||||
// update snapshot from workingCopy to make sure it's up to date
|
// update snapshot from workingCopy to make sure it's up to date
|
||||||
// ### remove?
|
// ### remove?
|
||||||
// ### this is a great candidate for map-reduce
|
// ### this is a great candidate for map-reduce
|
||||||
QHashIterator< QString, QPair<QString, int> > it(workingCopy.all());
|
const ModelManagerInterface::WorkingCopy::Table &all = workingCopy.all();
|
||||||
while (it.hasNext()) {
|
for (auto it = all.cbegin(), end = all.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const QString fileName = it.key();
|
const QString fileName = it.key();
|
||||||
Document::Ptr oldDoc = snapshot.document(fileName);
|
Document::Ptr oldDoc = snapshot.document(fileName);
|
||||||
if (oldDoc && oldDoc->editorRevision() == it.value().second)
|
if (oldDoc && oldDoc->editorRevision() == it.value().second)
|
||||||
|
@@ -139,9 +139,7 @@ public:
|
|||||||
|
|
||||||
// handle inner ids
|
// handle inner ids
|
||||||
QString innerIdForwarders;
|
QString innerIdForwarders;
|
||||||
QHashIterator<QString, SourceLocation> it(innerIds);
|
for (auto it = innerIds.cbegin(), end = innerIds.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const QString innerId = it.key();
|
const QString innerId = it.key();
|
||||||
comment += tr("// Rename all outer uses of the id \"%1\" to \"%2.item.%1\".\n").arg(
|
comment += tr("// Rename all outer uses of the id \"%1\" to \"%2.item.%1\".\n").arg(
|
||||||
innerId, loaderId);
|
innerId, loaderId);
|
||||||
|
@@ -65,14 +65,11 @@ QList<Core::LocatorFilterEntry> FunctionFilter::matchesFor(
|
|||||||
if (!regexp.isValid())
|
if (!regexp.isValid())
|
||||||
return goodEntries;
|
return goodEntries;
|
||||||
|
|
||||||
QHashIterator<QString, QList<LocatorData::Entry> > it(m_data->entries());
|
const QHash<QString, QList<LocatorData::Entry> > entries = m_data->entries();
|
||||||
while (it.hasNext()) {
|
for (const QList<LocatorData::Entry> &items : entries) {
|
||||||
if (future.isCanceled())
|
if (future.isCanceled())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
it.next();
|
|
||||||
|
|
||||||
const QList<LocatorData::Entry> items = it.value();
|
|
||||||
for (const LocatorData::Entry &info : items) {
|
for (const LocatorData::Entry &info : items) {
|
||||||
if (info.type != LocatorData::Function)
|
if (info.type != LocatorData::Function)
|
||||||
continue;
|
continue;
|
||||||
|
@@ -152,9 +152,7 @@ bool ScreenshotCropper::saveAreasOfInterest(const QString &areasXmlFile, QMap<QS
|
|||||||
writer.setAutoFormatting(true);
|
writer.setAutoFormatting(true);
|
||||||
writer.writeStartDocument();
|
writer.writeStartDocument();
|
||||||
writer.writeStartElement(xmlTagAreas);
|
writer.writeStartElement(xmlTagAreas);
|
||||||
QMapIterator<QString, QRect> i(areas);
|
for (auto i = areas.cbegin(), end = areas.cend(); i != end; ++i) {
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
writer.writeStartElement(xmlTagArea);
|
writer.writeStartElement(xmlTagArea);
|
||||||
writer.writeAttribute(xmlAttributeImage, i.key());
|
writer.writeAttribute(xmlAttributeImage, i.key());
|
||||||
writer.writeAttribute(xmlAttributeX, QString::number(i.value().x()));
|
writer.writeAttribute(xmlAttributeX, QString::number(i.value().x()));
|
||||||
|
@@ -133,17 +133,15 @@ void ScxmlDocument::addNamespace(ScxmlNamespace *ns)
|
|||||||
|
|
||||||
ScxmlTag *scxmlTag = scxmlRootTag();
|
ScxmlTag *scxmlTag = scxmlRootTag();
|
||||||
if (scxmlTag) {
|
if (scxmlTag) {
|
||||||
QMapIterator<QString, ScxmlNamespace*> i(m_namespaces);
|
for (ScxmlNamespace *ns : qAsConst(m_namespaces)) {
|
||||||
while (i.hasNext()) {
|
QString prefix = ns->prefix();
|
||||||
i.next();
|
|
||||||
QString prefix = i.value()->prefix();
|
|
||||||
if (prefix.isEmpty())
|
if (prefix.isEmpty())
|
||||||
prefix = "xmlns";
|
prefix = "xmlns";
|
||||||
|
|
||||||
if (prefix.startsWith("xmlns"))
|
if (prefix.startsWith("xmlns"))
|
||||||
scxmlTag->setAttribute(prefix, i.value()->name());
|
scxmlTag->setAttribute(prefix, ns->name());
|
||||||
else
|
else
|
||||||
scxmlTag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), i.value()->name());
|
scxmlTag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), ns->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,17 +170,15 @@ bool ScxmlDocument::generateSCXML(QIODevice *io, ScxmlTag *tag) const
|
|||||||
ScxmlTag *ScxmlDocument::createScxmlTag()
|
ScxmlTag *ScxmlDocument::createScxmlTag()
|
||||||
{
|
{
|
||||||
auto tag = new ScxmlTag(Scxml, this);
|
auto tag = new ScxmlTag(Scxml, this);
|
||||||
QMapIterator<QString, ScxmlNamespace*> i(m_namespaces);
|
for (ScxmlNamespace *ns : m_namespaces) {
|
||||||
while (i.hasNext()) {
|
QString prefix = ns->prefix();
|
||||||
i.next();
|
|
||||||
QString prefix = i.value()->prefix();
|
|
||||||
if (prefix.isEmpty())
|
if (prefix.isEmpty())
|
||||||
prefix = "xmlns";
|
prefix = "xmlns";
|
||||||
|
|
||||||
if (prefix.startsWith("xmlns"))
|
if (prefix.startsWith("xmlns"))
|
||||||
tag->setAttribute(prefix, i.value()->name());
|
tag->setAttribute(prefix, ns->name());
|
||||||
else
|
else
|
||||||
tag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), i.value()->name());
|
tag->setAttribute(QString::fromLatin1("xmlns:%1").arg(prefix), ns->name());
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
@@ -552,11 +552,8 @@ void ScxmlTag::writeXml(QXmlStreamWriter &xml)
|
|||||||
// Write editorinfo if necessary
|
// Write editorinfo if necessary
|
||||||
if (!m_editorInfo.isEmpty()) {
|
if (!m_editorInfo.isEmpty()) {
|
||||||
xml.writeStartElement("qt:editorinfo");
|
xml.writeStartElement("qt:editorinfo");
|
||||||
QHashIterator<QString, QString> i(m_editorInfo);
|
for (auto i = m_editorInfo.cbegin(), end = m_editorInfo.cend(); i != end; ++i)
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
xml.writeAttribute(i.key(), i.value());
|
xml.writeAttribute(i.key(), i.value());
|
||||||
}
|
|
||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -496,10 +496,8 @@ QStringList BaseFileFind::replaceAll(const QString &text,
|
|||||||
changes[QDir::fromNativeSeparators(item.path.first())].append(item);
|
changes[QDir::fromNativeSeparators(item.path.first())].append(item);
|
||||||
|
|
||||||
// Checking for files without write permissions
|
// Checking for files without write permissions
|
||||||
QHashIterator<QString, QList<SearchResultItem> > it(changes);
|
|
||||||
QSet<FilePath> roFiles;
|
QSet<FilePath> roFiles;
|
||||||
while (it.hasNext()) {
|
for (auto it = changes.cbegin(), end = changes.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const QFileInfo fileInfo(it.key());
|
const QFileInfo fileInfo(it.key());
|
||||||
if (!fileInfo.isWritable())
|
if (!fileInfo.isWritable())
|
||||||
roFiles.insert(FilePath::fromString(it.key()));
|
roFiles.insert(FilePath::fromString(it.key()));
|
||||||
@@ -513,9 +511,7 @@ QStringList BaseFileFind::replaceAll(const QString &text,
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
it.toFront();
|
for (auto it = changes.cbegin(), end = changes.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
const QString fileName = it.key();
|
const QString fileName = it.key();
|
||||||
const QList<SearchResultItem> changeItems = it.value();
|
const QList<SearchResultItem> changeItems = it.value();
|
||||||
|
|
||||||
|
@@ -251,9 +251,8 @@ bool ColorScheme::save(const QString &fileName, QWidget *parent) const
|
|||||||
if (!m_displayName.isEmpty())
|
if (!m_displayName.isEmpty())
|
||||||
w.writeAttribute(QLatin1String("name"), m_displayName);
|
w.writeAttribute(QLatin1String("name"), m_displayName);
|
||||||
|
|
||||||
QMapIterator<TextStyle, Format> i(m_formats);
|
for (auto i = m_formats.cbegin(), end = m_formats.cend(); i != end; ++i) {
|
||||||
while (i.hasNext()) {
|
const Format &format = i.value();
|
||||||
const Format &format = i.next().value();
|
|
||||||
w.writeStartElement(QLatin1String("style"));
|
w.writeStartElement(QLatin1String("style"));
|
||||||
w.writeAttribute(QLatin1String("name"), QString::fromLatin1(Constants::nameForStyle(i.key())));
|
w.writeAttribute(QLatin1String("name"), QString::fromLatin1(Constants::nameForStyle(i.key())));
|
||||||
if (format.foreground().isValid())
|
if (format.foreground().isValid())
|
||||||
|
@@ -473,7 +473,7 @@ void TextEditorSettings::unregisterCodeStyleFactory(Core::Id languageId)
|
|||||||
d->m_languageToFactory.remove(languageId);
|
d->m_languageToFactory.remove(languageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<Core::Id, ICodeStylePreferencesFactory *> TextEditorSettings::codeStyleFactories()
|
const QMap<Core::Id, ICodeStylePreferencesFactory *> &TextEditorSettings::codeStyleFactories()
|
||||||
{
|
{
|
||||||
return d->m_languageToFactory;
|
return d->m_languageToFactory;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public:
|
|||||||
static const CommentsSettings &commentsSettings();
|
static const CommentsSettings &commentsSettings();
|
||||||
|
|
||||||
static ICodeStylePreferencesFactory *codeStyleFactory(Core::Id languageId);
|
static ICodeStylePreferencesFactory *codeStyleFactory(Core::Id languageId);
|
||||||
static QMap<Core::Id, ICodeStylePreferencesFactory *> codeStyleFactories();
|
static const QMap<Core::Id, ICodeStylePreferencesFactory *> &codeStyleFactories();
|
||||||
static void registerCodeStyleFactory(ICodeStylePreferencesFactory *codeStyleFactory);
|
static void registerCodeStyleFactory(ICodeStylePreferencesFactory *codeStyleFactory);
|
||||||
static void unregisterCodeStyleFactory(Core::Id languageId);
|
static void unregisterCodeStyleFactory(Core::Id languageId);
|
||||||
|
|
||||||
|
@@ -122,13 +122,11 @@ void TodoItemsProvider::createScanners()
|
|||||||
|
|
||||||
void TodoItemsProvider::setItemsListWithinStartupProject()
|
void TodoItemsProvider::setItemsListWithinStartupProject()
|
||||||
{
|
{
|
||||||
QHashIterator<FilePath, QList<TodoItem> > it(m_itemsHash);
|
|
||||||
const auto filePaths = Utils::toSet(m_startupProject->files(Project::SourceFiles));
|
const auto filePaths = Utils::toSet(m_startupProject->files(Project::SourceFiles));
|
||||||
|
|
||||||
QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap();
|
QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap();
|
||||||
|
|
||||||
while (it.hasNext()) {
|
for (auto it = m_itemsHash.cbegin(), end = m_itemsHash.cend(); it != end; ++it) {
|
||||||
it.next();
|
|
||||||
const FilePath filePath = it.key();
|
const FilePath filePath = it.key();
|
||||||
if (filePaths.contains(filePath)) {
|
if (filePaths.contains(filePath)) {
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
@@ -160,9 +158,7 @@ void TodoItemsProvider::setItemsListWithinSubproject()
|
|||||||
|
|
||||||
// files must be both in the current subproject and the startup-project.
|
// files must be both in the current subproject and the startup-project.
|
||||||
const auto fileNames = Utils::toSet(m_startupProject->files(Project::SourceFiles));
|
const auto fileNames = Utils::toSet(m_startupProject->files(Project::SourceFiles));
|
||||||
QHashIterator<FilePath, QList<TodoItem> > it(m_itemsHash);
|
for (auto it = m_itemsHash.cbegin(), end = m_itemsHash.cend(); it != end; ++it) {
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
if (subprojectFileNames.contains(it.key()) && fileNames.contains(it.key()))
|
if (subprojectFileNames.contains(it.key()) && fileNames.contains(it.key()))
|
||||||
m_itemsList << it.value();
|
m_itemsList << it.value();
|
||||||
}
|
}
|
||||||
|
@@ -239,9 +239,8 @@ JobRequests JobQueue::takeJobRequestsToRunNow()
|
|||||||
using TranslationUnitIds = QSet<Utf8String>;
|
using TranslationUnitIds = QSet<Utf8String>;
|
||||||
TranslationUnitIds translationUnitsScheduledForThisRun;
|
TranslationUnitIds translationUnitsScheduledForThisRun;
|
||||||
|
|
||||||
QMutableVectorIterator<JobRequest> i(m_queue);
|
for (int pos = 0; pos < m_queue.size(); ++pos) {
|
||||||
while (i.hasNext()) {
|
const JobRequest &request = m_queue.at(pos);
|
||||||
const JobRequest &request = i.next();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const Document &document = m_documents.document(request.filePath);
|
const Document &document = m_documents.document(request.filePath);
|
||||||
@@ -258,7 +257,7 @@ JobRequests JobQueue::takeJobRequestsToRunNow()
|
|||||||
|
|
||||||
translationUnitsScheduledForThisRun.insert(id);
|
translationUnitsScheduledForThisRun.insert(id);
|
||||||
jobsToRun += request;
|
jobsToRun += request;
|
||||||
i.remove();
|
m_queue.removeAt(pos--);
|
||||||
} catch (const std::exception &exception) {
|
} catch (const std::exception &exception) {
|
||||||
qWarning() << "Error in Jobs::takeJobRequestsToRunNow for"
|
qWarning() << "Error in Jobs::takeJobRequestsToRunNow for"
|
||||||
<< request << ":" << exception.what();
|
<< request << ":" << exception.what();
|
||||||
|
Reference in New Issue
Block a user