forked from qt-creator/qt-creator
Fix parameters hidden by local variables.
This commit is contained in:
@@ -500,10 +500,10 @@ int BinEditor::posAt(const QPoint &pos) const
|
||||
if (x > 16 * m_columnWidth + m_charWidth/2) {
|
||||
x -= 16 * m_columnWidth + m_charWidth;
|
||||
for (column = 0; column < 15; ++column) {
|
||||
int pos = (topLine + line) * 16 + column;
|
||||
if (pos < 0 || pos >= m_size)
|
||||
int dataPos = (topLine + line) * 16 + column;
|
||||
if (dataPos < 0 || dataPos >= m_size)
|
||||
break;
|
||||
QChar qc(QLatin1Char(dataAt(pos)));
|
||||
QChar qc(QLatin1Char(dataAt(dataPos)));
|
||||
if (!qc.isPrint())
|
||||
qc = 0xB7;
|
||||
x -= fontMetrics().width(qc);
|
||||
|
@@ -109,8 +109,8 @@ QString ProcessListFilterModel::processIdAt(const QModelIndex &index) const
|
||||
{
|
||||
if (index.isValid()) {
|
||||
const QModelIndex index0 = mapToSource(index);
|
||||
QModelIndex index = index0.sibling(index0.row(), 0);
|
||||
if (const QStandardItem *item = m_model->itemFromIndex(index))
|
||||
QModelIndex siblingIndex = index0.sibling(index0.row(), 0);
|
||||
if (const QStandardItem *item = m_model->itemFromIndex(siblingIndex))
|
||||
return item->text();
|
||||
}
|
||||
return QString();
|
||||
|
@@ -1785,8 +1785,8 @@ void GitClient::setSettings(const GitSettings &s)
|
||||
{
|
||||
if (s != m_settings) {
|
||||
m_settings = s;
|
||||
if (QSettings *s = m_core->settings())
|
||||
m_settings.toSettings(s);
|
||||
if (QSettings *coreSettings = m_core->settings())
|
||||
m_settings.toSettings(coreSettings);
|
||||
m_binaryPath = m_settings.gitBinaryPath();
|
||||
m_cachedGitVersion = 0u;
|
||||
m_hasCachedGitVersion = false;
|
||||
|
@@ -76,17 +76,17 @@ QList<FilterEntry> FileSystemFilter::matchesFor(const QString &entry)
|
||||
QDir::Name|QDir::IgnoreCase|QDir::LocaleAware);
|
||||
foreach (const QString &dir, dirs) {
|
||||
if (dir != QLatin1String(".") && (name.isEmpty() || dir.startsWith(name, Qt::CaseInsensitive))) {
|
||||
FilterEntry entry(this, dir, dirInfo.filePath(dir));
|
||||
entry.resolveFileIcon = true;
|
||||
value.append(entry);
|
||||
FilterEntry filterEntry(this, dir, dirInfo.filePath(dir));
|
||||
filterEntry.resolveFileIcon = true;
|
||||
value.append(filterEntry);
|
||||
}
|
||||
}
|
||||
foreach (const QString &file, files) {
|
||||
if (name.isEmpty() || file.startsWith(name, Qt::CaseInsensitive)) {
|
||||
const QString fullPath = dirInfo.filePath(file);
|
||||
FilterEntry entry(this, file, fullPath);
|
||||
entry.resolveFileIcon = true;
|
||||
value.append(entry);
|
||||
FilterEntry filterEntry(this, file, fullPath);
|
||||
filterEntry.resolveFileIcon = true;
|
||||
value.append(filterEntry);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
|
@@ -69,12 +69,12 @@ QList<FilterEntry> LocatorFiltersFilter::matchesFor(const QString &entry)
|
||||
if (entry.isEmpty()) {
|
||||
foreach (ILocatorFilter *filter, m_plugin->filters()) {
|
||||
if (!filter->shortcutString().isEmpty() && !filter->isHidden()) {
|
||||
FilterEntry entry(this,
|
||||
FilterEntry filterEntry(this,
|
||||
filter->shortcutString(),
|
||||
QVariant::fromValue(filter),
|
||||
m_icon);
|
||||
entry.extraInfo = filter->displayName();
|
||||
entries.append(entry);
|
||||
filterEntry.extraInfo = filter->displayName();
|
||||
entries.append(filterEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -59,19 +59,19 @@ QList<FilterEntry> OpenDocumentsFilter::matchesFor(const QString &entry)
|
||||
const QRegExp regexp(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
|
||||
if (!regexp.isValid())
|
||||
return value;
|
||||
foreach (const OpenEditorsModel::Entry &entry, m_editors) {
|
||||
QString fileName = entry.fileName();
|
||||
QString displayName = entry.displayName();
|
||||
foreach (const OpenEditorsModel::Entry &editorEntry, m_editors) {
|
||||
QString fileName = editorEntry.fileName();
|
||||
QString displayName = editorEntry.displayName();
|
||||
if (regexp.exactMatch(displayName)) {
|
||||
if (fileName.isEmpty()) {
|
||||
if (entry.editor)
|
||||
value.append(FilterEntry(this, displayName, qVariantFromValue(entry.editor)));
|
||||
if (editorEntry.editor)
|
||||
value.append(FilterEntry(this, displayName, qVariantFromValue(editorEntry.editor)));
|
||||
} else {
|
||||
QFileInfo fi(fileName);
|
||||
FilterEntry entry(this, fi.fileName(), fileName);
|
||||
entry.extraInfo = QDir::toNativeSeparators(fi.path());
|
||||
entry.resolveFileIcon = true;
|
||||
value.append(entry);
|
||||
FilterEntry fiEntry(this, fi.fileName(), fileName);
|
||||
fiEntry.extraInfo = QDir::toNativeSeparators(fi.path());
|
||||
fiEntry.resolveFileIcon = true;
|
||||
value.append(fiEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1624,8 +1624,8 @@ void ProjectExplorerPlugin::runProjectContextMenu()
|
||||
bool ProjectExplorerPlugin::hasBuildSettings(Project *pro)
|
||||
{
|
||||
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
||||
foreach(Project *pro, projects)
|
||||
if (pro->activeTarget()->activeBuildConfiguration())
|
||||
foreach(Project *project, projects)
|
||||
if (project->activeTarget()->activeBuildConfiguration())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1646,9 +1646,9 @@ void ProjectExplorerPlugin::runProjectImpl(Project *pro, QString mode)
|
||||
|
||||
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
||||
QList<BuildConfiguration *> configurations;
|
||||
foreach(Project *pro, projects)
|
||||
if (pro->activeTarget()->activeBuildConfiguration())
|
||||
configurations << pro->activeTarget()->activeBuildConfiguration();
|
||||
foreach(Project *project, projects)
|
||||
if (project->activeTarget()->activeBuildConfiguration())
|
||||
configurations << project->activeTarget()->activeBuildConfiguration();
|
||||
d->m_buildManager->buildProjects(configurations);
|
||||
|
||||
updateRunActions();
|
||||
|
@@ -328,10 +328,10 @@ bool ProjectFileWizardExtension::processProject(const QList<Core::GeneratedFile>
|
||||
typeFileMap.insert(typeForFileName(mdb, path), path);
|
||||
}
|
||||
foreach (FileType type, typeFileMap.uniqueKeys()) {
|
||||
const QStringList files = typeFileMap.values(type);
|
||||
if (!project->addFiles(type, files)) {
|
||||
const QStringList typeFiles = typeFileMap.values(type);
|
||||
if (!project->addFiles(type, typeFiles)) {
|
||||
*errorMessage = tr("Failed to add one or more files to project\n'%1' (%2).").
|
||||
arg(project->path(), files.join(QString(QLatin1Char(','))));
|
||||
arg(project->path(), typeFiles.join(QString(QLatin1Char(','))));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -421,8 +421,8 @@ void NavigatorTreeModel::removeSubTree(const ModelNode &node)
|
||||
rowList = itemRow.idItem->parent()->takeRow(itemRow.idItem->row());
|
||||
}
|
||||
|
||||
foreach (const ModelNode &node, modelNodeChildren(node)) {
|
||||
removeSubTree(node);
|
||||
foreach (const ModelNode &childNode, modelNodeChildren(node)) {
|
||||
removeSubTree(childNode);
|
||||
}
|
||||
|
||||
qDeleteAll(rowList);
|
||||
|
@@ -327,7 +327,7 @@ QStringList BaseFileFind::replaceAll(const QString &text,
|
||||
it.next();
|
||||
|
||||
const QString fileName = it.key();
|
||||
const QList<Find::SearchResultItem> items = it.value();
|
||||
const QList<Find::SearchResultItem> changeItems = it.value();
|
||||
|
||||
const QList<Core::IEditor *> editors = editorManager->editorsForFileName(fileName);
|
||||
TextEditor::BaseTextEditor *textEditor = 0;
|
||||
@@ -340,7 +340,7 @@ QStringList BaseFileFind::replaceAll(const QString &text,
|
||||
if (textEditor != 0) {
|
||||
QTextCursor tc = textEditor->textCursor();
|
||||
tc.beginEditBlock();
|
||||
applyChanges(textEditor->document(), text, items);
|
||||
applyChanges(textEditor->document(), text, changeItems);
|
||||
tc.endEditBlock();
|
||||
} else {
|
||||
QFile file(fileName);
|
||||
@@ -354,7 +354,7 @@ QStringList BaseFileFind::replaceAll(const QString &text,
|
||||
QTextDocument doc;
|
||||
doc.setPlainText(plainText);
|
||||
|
||||
applyChanges(&doc, text, items);
|
||||
applyChanges(&doc, text, changeItems);
|
||||
|
||||
QFile newFile(fileName);
|
||||
if (newFile.open(QFile::WriteOnly)) {
|
||||
|
@@ -190,22 +190,22 @@ FontSettingsPagePrivate::FontSettingsPagePrivate(const TextEditor::FormatDescrip
|
||||
|
||||
if (!settingsFound) { // Apply defaults
|
||||
foreach (const FormatDescription &f, m_descriptions) {
|
||||
const QString id = f.id();
|
||||
const QString fid = f.id();
|
||||
|
||||
m_value.formatFor(id).setForeground(f.foreground());
|
||||
m_value.formatFor(id).setBackground(f.background());
|
||||
m_value.formatFor(id).setBold(f.format().bold());
|
||||
m_value.formatFor(id).setItalic(f.format().italic());
|
||||
m_value.formatFor(fid).setForeground(f.foreground());
|
||||
m_value.formatFor(fid).setBackground(f.background());
|
||||
m_value.formatFor(fid).setBold(f.format().bold());
|
||||
m_value.formatFor(fid).setItalic(f.format().italic());
|
||||
}
|
||||
} else if (m_value.colorSchemeFileName().isEmpty()) {
|
||||
// No color scheme was loaded, but one might be imported from the ini file
|
||||
ColorScheme defaultScheme;
|
||||
foreach (const FormatDescription &f, m_descriptions) {
|
||||
const QString id = f.id();
|
||||
defaultScheme.formatFor(id).setForeground(f.foreground());
|
||||
defaultScheme.formatFor(id).setBackground(f.background());
|
||||
defaultScheme.formatFor(id).setBold(f.format().bold());
|
||||
defaultScheme.formatFor(id).setItalic(f.format().italic());
|
||||
const QString fid = f.id();
|
||||
defaultScheme.formatFor(fid).setForeground(f.foreground());
|
||||
defaultScheme.formatFor(fid).setBackground(f.background());
|
||||
defaultScheme.formatFor(fid).setBold(f.format().bold());
|
||||
defaultScheme.formatFor(fid).setItalic(f.format().italic());
|
||||
}
|
||||
if (m_value.colorScheme() != defaultScheme) {
|
||||
// Save it as a color scheme file
|
||||
|
@@ -3351,8 +3351,8 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit
|
||||
int parens = 0;
|
||||
QString test;
|
||||
test.reserve(20);
|
||||
QString args;
|
||||
args.reserve(50);
|
||||
QString argsString;
|
||||
argsString.reserve(50);
|
||||
const QChar *d = cond.constData();
|
||||
const QChar *ed = d + cond.size();
|
||||
while (d < ed) {
|
||||
@@ -3368,12 +3368,12 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit
|
||||
} else if (c == '(') {
|
||||
isFunc = true;
|
||||
if (parens)
|
||||
args += c;
|
||||
argsString += c;
|
||||
++parens;
|
||||
} else if (c == ')') {
|
||||
--parens;
|
||||
if (parens)
|
||||
args += c;
|
||||
argsString += c;
|
||||
} else if (!parens) {
|
||||
if (c == '"')
|
||||
quoted = true;
|
||||
@@ -3384,12 +3384,12 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit
|
||||
else
|
||||
test += c;
|
||||
} else {
|
||||
args += c;
|
||||
argsString += c;
|
||||
}
|
||||
if (!quoted && !parens && (isOp || d == ed)) {
|
||||
if (m_cumulative || (orOp != ret)) {
|
||||
if (isFunc)
|
||||
ret = evaluateConditionalFunction(ProString(test), ProString(args, NoHash));
|
||||
ret = evaluateConditionalFunction(ProString(test), ProString(argsString, NoHash));
|
||||
else
|
||||
ret = isActiveConfig(test, true);
|
||||
ret ^= invert;
|
||||
@@ -3398,7 +3398,7 @@ ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateCondit
|
||||
invert = false;
|
||||
isFunc = false;
|
||||
test.clear();
|
||||
args.clear();
|
||||
argsString.clear();
|
||||
}
|
||||
}
|
||||
return returnBool(ret);
|
||||
|
Reference in New Issue
Block a user