mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:23:53 +00:00
Fix shadowing warnings
This commit is contained in:
parent
9e63c3ce63
commit
ccacad51be
11 changed files with 37 additions and 39 deletions
|
@ -73,11 +73,11 @@ void CSMDoc::Loader::load()
|
|||
CSMWorld::UniversalId log (CSMWorld::UniversalId::Type_LoadErrorLog, 0);
|
||||
|
||||
{ // silence a g++ warning
|
||||
for (CSMDoc::Messages::Iterator iter (messages.begin());
|
||||
iter!=messages.end(); ++iter)
|
||||
for (CSMDoc::Messages::Iterator messageIter (messages.begin());
|
||||
messageIter!=messages.end(); ++messageIter)
|
||||
{
|
||||
document->getReport (log)->add (*iter);
|
||||
emit loadMessage (document, iter->mMessage);
|
||||
document->getReport (log)->add (*messageIter);
|
||||
emit loadMessage (document, messageIter->mMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ void CSMWorld::InfoCollection::load (const Info& record, bool base)
|
|||
record2.mState = base ? RecordBase::State_BaseOnly : RecordBase::State_ModifiedOnly;
|
||||
(base ? record2.mBase : record2.mModified) = record;
|
||||
|
||||
int index = -1;
|
||||
|
||||
std::string topic = Misc::StringUtils::lowerCase (record2.get().mTopicId);
|
||||
|
||||
if (!record2.get().mPrev.empty())
|
||||
|
|
|
@ -25,12 +25,12 @@ CSMWorld::Resources::Resources (const VFS::Manager* vfs, const std::string& base
|
|||
|
||||
if (extensions)
|
||||
{
|
||||
std::string::size_type index = filepath.find_last_of ('.');
|
||||
std::string::size_type extensionIndex = filepath.find_last_of ('.');
|
||||
|
||||
if (index==std::string::npos)
|
||||
if (extensionIndex==std::string::npos)
|
||||
continue;
|
||||
|
||||
std::string extension = filepath.substr (index+1);
|
||||
std::string extension = filepath.substr (extensionIndex+1);
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ void CSVFilter::FilterBox::dropEvent (QDropEvent* event)
|
|||
if (!mime) // May happen when non-records (e.g. plain text) are dragged and dropped
|
||||
return;
|
||||
|
||||
std::vector<CSMWorld::UniversalId> data = mime->getData();
|
||||
std::vector<CSMWorld::UniversalId> universalIdData = mime->getData();
|
||||
|
||||
emit recordDropped(data, event->proposedAction());
|
||||
emit recordDropped(universalIdData, event->proposedAction());
|
||||
}
|
||||
|
||||
void CSVFilter::FilterBox::dragEnterEvent (QDragEnterEvent* event)
|
||||
|
|
|
@ -259,8 +259,8 @@ bool CSVRender::InstanceMode::primaryEditStartDrag (const QPoint& pos)
|
|||
mDragMode = DragMode_Scale;
|
||||
|
||||
// Calculate scale factor
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getEdited (Mask_Reference);
|
||||
osg::Vec3f center = getScreenCoords(getSelectionCenter(selection));
|
||||
std::vector<osg::ref_ptr<TagBase> > editedSelection = getWorldspaceWidget().getEdited (Mask_Reference);
|
||||
osg::Vec3f center = getScreenCoords(getSelectionCenter(editedSelection));
|
||||
|
||||
int widgetHeight = getWorldspaceWidget().height();
|
||||
|
||||
|
|
|
@ -558,18 +558,18 @@ std::pair< int, int > CSVRender::PagedWorldspaceWidget::getCoordinatesFromId (co
|
|||
}
|
||||
|
||||
bool CSVRender::PagedWorldspaceWidget::handleDrop (
|
||||
const std::vector< CSMWorld::UniversalId >& data, DropType type)
|
||||
const std::vector< CSMWorld::UniversalId >& universalIdData, DropType type)
|
||||
{
|
||||
if (WorldspaceWidget::handleDrop (data, type))
|
||||
if (WorldspaceWidget::handleDrop (universalIdData, type))
|
||||
return true;
|
||||
|
||||
if (type!=Type_CellsExterior)
|
||||
return false;
|
||||
|
||||
bool selectionChanged = false;
|
||||
for (unsigned i = 0; i < data.size(); ++i)
|
||||
for (unsigned i = 0; i < universalIdData.size(); ++i)
|
||||
{
|
||||
std::pair<int, int> coordinates(getCoordinatesFromId(data[i].getId()));
|
||||
std::pair<int, int> coordinates(getCoordinatesFromId(universalIdData[i].getId()));
|
||||
if (mSelection.add(CSMWorld::CellCoordinates(coordinates.first, coordinates.second)))
|
||||
{
|
||||
selectionChanged = true;
|
||||
|
|
|
@ -80,20 +80,20 @@ void CSVRender::UnpagedWorldspaceWidget::cellRowsAboutToBeRemoved (const QModelI
|
|||
emit closeRequest();
|
||||
}
|
||||
|
||||
bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& data, DropType type)
|
||||
bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& universalIdData, DropType type)
|
||||
{
|
||||
if (WorldspaceWidget::handleDrop (data, type))
|
||||
if (WorldspaceWidget::handleDrop (universalIdData, type))
|
||||
return true;
|
||||
|
||||
if (type!=Type_CellsInterior)
|
||||
return false;
|
||||
|
||||
mCellId = data.begin()->getId();
|
||||
mCellId = universalIdData.begin()->getId();
|
||||
|
||||
mCell.reset (new Cell (getDocument().getData(), mRootNode, mCellId));
|
||||
|
||||
update();
|
||||
emit cellChanged(*data.begin());
|
||||
emit cellChanged(*universalIdData.begin());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -303,15 +303,15 @@ CSVRender::WorldspaceWidget::dropRequirments
|
|||
return ignored;
|
||||
}
|
||||
|
||||
bool CSVRender::WorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& data,
|
||||
bool CSVRender::WorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& universalIdData,
|
||||
DropType type)
|
||||
{
|
||||
if (type==Type_DebugProfile)
|
||||
{
|
||||
if (mRun)
|
||||
{
|
||||
for (std::vector<CSMWorld::UniversalId>::const_iterator iter (data.begin());
|
||||
iter!=data.end(); ++iter)
|
||||
for (std::vector<CSMWorld::UniversalId>::const_iterator iter (universalIdData.begin());
|
||||
iter!=universalIdData.end(); ++iter)
|
||||
mRun->addProfile (iter->getId());
|
||||
}
|
||||
|
||||
|
@ -402,9 +402,9 @@ CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick (const QPo
|
|||
continue;
|
||||
}
|
||||
|
||||
for (std::vector<osg::Node*>::iterator it = intersection.nodePath.begin(); it != intersection.nodePath.end(); ++it)
|
||||
for (std::vector<osg::Node*>::iterator nodeIter = intersection.nodePath.begin(); nodeIter != intersection.nodePath.end(); ++nodeIter)
|
||||
{
|
||||
osg::Node* node = *it;
|
||||
osg::Node* node = *nodeIter;
|
||||
if (osg::ref_ptr<CSVRender::TagBase> tag = dynamic_cast<CSVRender::TagBase *>(node->getUserData()))
|
||||
{
|
||||
WorldspaceHitResult hit = { true, tag, 0, 0, 0, intersection.getWorldIntersectPoint() };
|
||||
|
|
|
@ -26,10 +26,10 @@ CSVWorld::ReferenceableCreator::ReferenceableCreator (CSMWorld::Data& data, QUnd
|
|||
for (std::vector<CSMWorld::UniversalId::Type>::const_iterator iter (types.begin());
|
||||
iter!=types.end(); ++iter)
|
||||
{
|
||||
CSMWorld::UniversalId id (*iter, "");
|
||||
CSMWorld::UniversalId id2 (*iter, "");
|
||||
|
||||
mType->addItem (QIcon (id.getIcon().c_str()), id.getTypeName().c_str(),
|
||||
static_cast<int> (id.getType()));
|
||||
mType->addItem (QIcon (id2.getIcon().c_str()), id2.getTypeName().c_str(),
|
||||
static_cast<int> (id2.getType()));
|
||||
}
|
||||
|
||||
insertBeforeButtons (mType, false);
|
||||
|
|
|
@ -187,18 +187,18 @@ void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::CellSelection
|
|||
emit updateTitle();
|
||||
}
|
||||
|
||||
void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalId >& data)
|
||||
void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalId >& universalIdData)
|
||||
{
|
||||
CSVRender::PagedWorldspaceWidget* pagedNewWidget = NULL;
|
||||
CSVRender::UnpagedWorldspaceWidget* unPagedNewWidget = NULL;
|
||||
CSVWidget::SceneToolbar* toolbar = NULL;
|
||||
|
||||
CSVRender::WorldspaceWidget::DropType type = CSVRender::WorldspaceWidget::getDropType (data);
|
||||
CSVRender::WorldspaceWidget::DropType type = CSVRender::WorldspaceWidget::getDropType (universalIdData);
|
||||
|
||||
switch (mScene->getDropRequirements (type))
|
||||
{
|
||||
case CSVRender::WorldspaceWidget::canHandle:
|
||||
mScene->handleDrop (data, type);
|
||||
mScene->handleDrop (universalIdData, type);
|
||||
break;
|
||||
|
||||
case CSVRender::WorldspaceWidget::needPaged:
|
||||
|
@ -206,15 +206,15 @@ void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalI
|
|||
toolbar = makeToolbar(pagedNewWidget, widget_Paged);
|
||||
makeConnections(pagedNewWidget);
|
||||
replaceToolbarAndWorldspace(pagedNewWidget, toolbar);
|
||||
mScene->handleDrop (data, type);
|
||||
mScene->handleDrop (universalIdData, type);
|
||||
break;
|
||||
|
||||
case CSVRender::WorldspaceWidget::needUnpaged:
|
||||
unPagedNewWidget = new CSVRender::UnpagedWorldspaceWidget(data.begin()->getId(), mDocument, this);
|
||||
unPagedNewWidget = new CSVRender::UnpagedWorldspaceWidget(universalIdData.begin()->getId(), mDocument, this);
|
||||
toolbar = makeToolbar(unPagedNewWidget, widget_Unpaged);
|
||||
makeConnections(unPagedNewWidget);
|
||||
replaceToolbarAndWorldspace(unPagedNewWidget, toolbar);
|
||||
cellSelectionChanged(*(data.begin()));
|
||||
cellSelectionChanged(*(universalIdData.begin()));
|
||||
break;
|
||||
|
||||
case CSVRender::WorldspaceWidget::ignored:
|
||||
|
|
|
@ -148,14 +148,14 @@ bool CSVWorld::TableSubView::eventFilter (QObject* object, QEvent* event)
|
|||
{
|
||||
if (QDropEvent* drop = dynamic_cast<QDropEvent*>(event))
|
||||
{
|
||||
const CSMWorld::TableMimeData* data = dynamic_cast<const CSMWorld::TableMimeData*>(drop->mimeData());
|
||||
if (!data) // May happen when non-records (e.g. plain text) are dragged and dropped
|
||||
const CSMWorld::TableMimeData* tableMimeData = dynamic_cast<const CSMWorld::TableMimeData*>(drop->mimeData());
|
||||
if (!tableMimeData) // May happen when non-records (e.g. plain text) are dragged and dropped
|
||||
return false;
|
||||
|
||||
bool handled = data->holdsType(CSMWorld::UniversalId::Type_Filter);
|
||||
bool handled = tableMimeData->holdsType(CSMWorld::UniversalId::Type_Filter);
|
||||
if (handled)
|
||||
{
|
||||
mFilterBox->setRecordFilter(data->returnMatching(CSMWorld::UniversalId::Type_Filter).getId());
|
||||
mFilterBox->setRecordFilter(tableMimeData->returnMatching(CSMWorld::UniversalId::Type_Filter).getId());
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue