refs #800 Fixed some declaration shadows variable in outer scope warnings.

This commit is contained in:
Mathew Sutcliffe
2016-11-10 00:39:09 +00:00
committed by Klaus Basan
parent 5791de6860
commit 6f972035ab
6 changed files with 15 additions and 15 deletions

View File

@@ -94,8 +94,8 @@ namespace BlackGui
if (volume > 100)
{
int v = volume - 100;
volume = 100 + v / 5;
int vol = volume - 100;
volume = 100 + vol / 5;
}
if (volume != ui->hs_Volume->value())

View File

@@ -113,9 +113,9 @@ namespace BlackGui
const QString sharedUrlHtml("<a href=\"%1\">%2</a>");
QString sharedUrlsHtml;
for (const CUrl &url : sharedUrls)
for (const CUrl &sharedUrl : sharedUrls)
{
sharedUrlsHtml += sharedUrlHtml.arg(url.getFullUrl(), url.getHost());
sharedUrlsHtml += sharedUrlHtml.arg(sharedUrl.getFullUrl(), sharedUrl.getHost());
sharedUrlsHtml += " ";
}
ui->lbl_SharedUrls->setText(sharedUrlsHtml.trimmed());

View File

@@ -103,13 +103,13 @@ namespace BlackGui
return;
}
QJsonParseError jsonError;
QJsonDocument json(QJsonDocument::fromJson(jsonParts.toUtf8(), &jsonError));
QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonParts.toUtf8(), &jsonError));
if (jsonError.error != QJsonParseError::NoError)
{
CLogMessage(this).validationError("Parse error: %1") << jsonError.errorString();
return;
}
parts.convertFromJson(json.object());
parts.convertFromJson(jsonDoc.object());
partsToGui(parts);
}
else

View File

@@ -98,7 +98,7 @@ namespace BlackGui
{
CDockWidget::initialFloating(); // initial floating to init position & size
QList<CEnableForDockWidgetInfoArea *> infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents();
foreach(CEnableForDockWidgetInfoArea * dwia, infoAreaDockWidgets)
for(CEnableForDockWidgetInfoArea *dwia : infoAreaDockWidgets)
{
Q_ASSERT_X(dwia, Q_FUNC_INFO, "Missing info area");
dwia->setParentDockWidgetInfoArea(this);
@@ -109,7 +109,7 @@ namespace BlackGui
{
QList<QWidget *> widgets = this->findChildren<QWidget *>();
QList<CEnableForDockWidgetInfoArea *> widgetsWithDockWidgetInfoAreaComponent;
foreach(QWidget * w, widgets)
for(QWidget *w : widgets)
{
Q_ASSERT(w);
CEnableForDockWidgetInfoArea *dwc = dynamic_cast<Components::CEnableForDockWidgetInfoArea *>(w);
@@ -122,11 +122,11 @@ namespace BlackGui
if (nestedInfoAreas.isEmpty()) return widgetsWithDockWidgetInfoAreaComponent;
// we have to exclude the nested embedded areas
foreach(CDockWidgetInfoArea * ia, nestedInfoAreas)
for(CDockWidgetInfoArea *ia : nestedInfoAreas)
{
QList<CEnableForDockWidgetInfoArea *> nestedInfoAreaComponents = ia->findEmbeddedDockWidgetInfoAreaComponents();
if (nestedInfoAreaComponents.isEmpty()) { continue; }
foreach(CEnableForDockWidgetInfoArea * iac, nestedInfoAreaComponents)
for(CEnableForDockWidgetInfoArea *iac : nestedInfoAreaComponents)
{
bool r = widgetsWithDockWidgetInfoAreaComponent.removeOne(iac);
Q_ASSERT(r); // why is the nested component not in the child list?

View File

@@ -60,8 +60,8 @@ namespace BlackMisc
{
if (static_cast<QMetaType::Type>(variant.type()) == QMetaType::Int)
{
CIcons::IconIndex index = variant.value<CIcons::IconIndex>();
this->m_icon = CIconList::iconByIndex(index);
CIcons::IconIndex iconIndex = variant.value<CIcons::IconIndex>();
this->m_icon = CIconList::iconByIndex(iconIndex);
}
else
{

View File

@@ -147,10 +147,10 @@ namespace BlackCoreTest
timer.start();
for (qint64 currentTime = ts - 2 * deltaT; currentTime < ts; currentTime += 250)
{
IInterpolator::PartsStatus status;
CAircraftPartsList pl(interpolator.getPartsBeforeTime(cs, ts, status));
IInterpolator::PartsStatus partsStatus;
CAircraftPartsList pl(interpolator.getPartsBeforeTime(cs, ts, partsStatus));
fetchedParts++;
QVERIFY2(status.isSupportingParts(), "Parts not supported");
QVERIFY2(partsStatus.isSupportingParts(), "Parts not supported");
QVERIFY2(!pl.isEmpty(), "Parts empty");
}
timeMs = timer.elapsed();