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