QmlJSEditor: Modernize

modernize-*

Change-Id: I4dceb82c3904069a0d9848b2af61122d9282cb36
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2018-11-24 02:45:30 +01:00
parent 00ec6dfb5d
commit 5242f58173
36 changed files with 298 additions and 333 deletions

View File

@@ -52,7 +52,7 @@ namespace {
class FindIds : protected Visitor
{
public:
typedef QHash<QString, SourceLocation> Result;
using Result = QHash<QString, SourceLocation>;
Result operator()(Node *node)
{
@@ -87,7 +87,7 @@ public:
: QmlJSQuickFixOperation(interface, 0)
, m_objDef(objDef)
{
Q_ASSERT(m_objDef != 0);
Q_ASSERT(m_objDef);
setDescription(tr("Wrap Component in Loader"));
}
@@ -96,7 +96,7 @@ public:
{
QString tryName = base;
int extraNumber = 1;
const ObjectValue *found = 0;
const ObjectValue *found = nullptr;
const ScopeChain &scope = assistInterface()->semanticInfo().scopeChain();
forever {
scope.lookup(tryName, &found);
@@ -181,7 +181,7 @@ void matchWrapInLoaderQuickFix(const QmlJSQuickFixInterface &interface, QuickFix
QList<Node *> path = interface->semanticInfo().rangePath(pos);
for (int i = path.size() - 1; i >= 0; --i) {
Node *node = path.at(i);
if (UiObjectDefinition *objDef = cast<UiObjectDefinition *>(node)) {
if (auto objDef = cast<UiObjectDefinition *>(node)) {
if (!interface->currentFile()->isCursorOn(objDef->qualifiedTypeNameId))
return;
// check that the node is not the root node
@@ -189,7 +189,7 @@ void matchWrapInLoaderQuickFix(const QmlJSQuickFixInterface &interface, QuickFix
result << new Operation<UiObjectDefinition>(interface, objDef);
return;
}
} else if (UiObjectBinding *objBinding = cast<UiObjectBinding *>(node)) {
} else if (auto objBinding = cast<UiObjectBinding *>(node)) {
if (!interface->currentFile()->isCursorOn(objBinding->qualifiedTypeNameId))
return;
result << new Operation<UiObjectBinding>(interface, objBinding);