1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-28 14:53:58 +00:00

Fix warning C4458 (declaration of 'data' hides class member)

This commit is contained in:
cc9cii 2015-11-22 19:23:11 +11:00
parent 4290751010
commit 19eed6f4c4
7 changed files with 25 additions and 25 deletions

View File

@ -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 if (!mime) // May happen when non-records (e.g. plain text) are dragged and dropped
return; return;
std::vector<CSMWorld::UniversalId> data = mime->getData(); std::vector<CSMWorld::UniversalId> mimeData = mime->getData();
emit recordDropped(data, event->proposedAction()); emit recordDropped(mimeData, event->proposedAction());
} }
void CSVFilter::FilterBox::dragEnterEvent (QDragEnterEvent* event) void CSVFilter::FilterBox::dragEnterEvent (QDragEnterEvent* event)

View File

@ -536,18 +536,18 @@ std::pair< int, int > CSVRender::PagedWorldspaceWidget::getCoordinatesFromId (co
} }
bool CSVRender::PagedWorldspaceWidget::handleDrop ( bool CSVRender::PagedWorldspaceWidget::handleDrop (
const std::vector< CSMWorld::UniversalId >& data, DropType type) const std::vector< CSMWorld::UniversalId >& dropData, DropType type)
{ {
if (WorldspaceWidget::handleDrop (data, type)) if (WorldspaceWidget::handleDrop (dropData, type))
return true; return true;
if (type!=Type_CellsExterior) if (type!=Type_CellsExterior)
return false; return false;
bool selectionChanged = false; bool selectionChanged = false;
for (unsigned i = 0; i < data.size(); ++i) for (unsigned i = 0; i < dropData.size(); ++i)
{ {
std::pair<int, int> coordinates(getCoordinatesFromId(data[i].getId())); std::pair<int, int> coordinates(getCoordinatesFromId(dropData[i].getId()));
if (mSelection.add(CSMWorld::CellCoordinates(coordinates.first, coordinates.second))) if (mSelection.add(CSMWorld::CellCoordinates(coordinates.first, coordinates.second)))
{ {
selectionChanged = true; selectionChanged = true;

View File

@ -84,21 +84,21 @@ void CSVRender::UnpagedWorldspaceWidget::cellRowsAboutToBeRemoved (const QModelI
emit closeRequest(); emit closeRequest();
} }
bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& data, DropType type) bool CSVRender::UnpagedWorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& dropData, DropType type)
{ {
if (WorldspaceWidget::handleDrop (data, type)) if (WorldspaceWidget::handleDrop (dropData, type))
return true; return true;
if (type!=Type_CellsInterior) if (type!=Type_CellsInterior)
return false; return false;
mCellId = data.begin()->getId(); mCellId = dropData.begin()->getId();
Cell *cell = new Cell (getDocument(), getSceneManager(), mCellId, getDocument().getPhysics()); Cell *cell = new Cell (getDocument(), getSceneManager(), mCellId, getDocument().getPhysics());
connect (cell->getSignalHandler(), SIGNAL(flagAsModified()), this, SLOT(flagAsModSlot())); connect (cell->getSignalHandler(), SIGNAL(flagAsModified()), this, SLOT(flagAsModSlot()));
mCell.reset (cell); mCell.reset (cell);
update(); update();
emit cellChanged(*data.begin()); emit cellChanged(*dropData.begin());
return true; return true;
} }

View File

@ -233,15 +233,15 @@ CSVRender::WorldspaceWidget::dropRequirments
return ignored; return ignored;
} }
bool CSVRender::WorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& data, bool CSVRender::WorldspaceWidget::handleDrop (const std::vector<CSMWorld::UniversalId>& dropData,
DropType type) DropType type)
{ {
if (type==Type_DebugProfile) if (type==Type_DebugProfile)
{ {
if (mRun) if (mRun)
{ {
for (std::vector<CSMWorld::UniversalId>::const_iterator iter (data.begin()); for (std::vector<CSMWorld::UniversalId>::const_iterator iter (dropData.begin());
iter!=data.end(); ++iter) iter!=dropData.end(); ++iter)
mRun->addProfile (iter->getId()); mRun->addProfile (iter->getId());
} }

View File

@ -67,8 +67,8 @@ void CSVWorld::DragRecordTable::dropEvent(QDropEvent *event)
CSMWorld::ColumnBase::Display display = getIndexDisplayType(index); CSMWorld::ColumnBase::Display display = getIndexDisplayType(index);
if (CSVWorld::DragDropUtils::canAcceptData(*event, display)) if (CSVWorld::DragDropUtils::canAcceptData(*event, display))
{ {
const CSMWorld::TableMimeData *data = CSVWorld::DragDropUtils::getTableMimeData(*event); const CSMWorld::TableMimeData *mimeData = CSVWorld::DragDropUtils::getTableMimeData(*event);
if (data->fromDocument(mDocument)) if (mimeData->fromDocument(mDocument))
{ {
CSMWorld::UniversalId id = CSVWorld::DragDropUtils::getAcceptedData(*event, display); CSMWorld::UniversalId id = CSVWorld::DragDropUtils::getAcceptedData(*event, display);
QVariant newIndexData = QString::fromUtf8(id.getId().c_str()); QVariant newIndexData = QString::fromUtf8(id.getId().c_str());

View File

@ -187,18 +187,18 @@ void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::CellSelection
emit updateTitle(); emit updateTitle();
} }
void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalId >& data) void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalId >& dropData)
{ {
CSVRender::PagedWorldspaceWidget* pagedNewWidget = NULL; CSVRender::PagedWorldspaceWidget* pagedNewWidget = NULL;
CSVRender::UnpagedWorldspaceWidget* unPagedNewWidget = NULL; CSVRender::UnpagedWorldspaceWidget* unPagedNewWidget = NULL;
CSVWidget::SceneToolbar* toolbar = NULL; CSVWidget::SceneToolbar* toolbar = NULL;
CSVRender::WorldspaceWidget::DropType type = CSVRender::WorldspaceWidget::getDropType (data); CSVRender::WorldspaceWidget::DropType type = CSVRender::WorldspaceWidget::getDropType (dropData);
switch (mScene->getDropRequirements (type)) switch (mScene->getDropRequirements (type))
{ {
case CSVRender::WorldspaceWidget::canHandle: case CSVRender::WorldspaceWidget::canHandle:
mScene->handleDrop (data, type); mScene->handleDrop (dropData, type);
break; break;
case CSVRender::WorldspaceWidget::needPaged: case CSVRender::WorldspaceWidget::needPaged:
@ -206,15 +206,15 @@ void CSVWorld::SceneSubView::handleDrop (const std::vector< CSMWorld::UniversalI
toolbar = makeToolbar(pagedNewWidget, widget_Paged); toolbar = makeToolbar(pagedNewWidget, widget_Paged);
makeConnections(pagedNewWidget); makeConnections(pagedNewWidget);
replaceToolbarAndWorldspace(pagedNewWidget, toolbar); replaceToolbarAndWorldspace(pagedNewWidget, toolbar);
mScene->handleDrop (data, type); mScene->handleDrop (dropData, type);
break; break;
case CSVRender::WorldspaceWidget::needUnpaged: case CSVRender::WorldspaceWidget::needUnpaged:
unPagedNewWidget = new CSVRender::UnpagedWorldspaceWidget(data.begin()->getId(), mDocument, this); unPagedNewWidget = new CSVRender::UnpagedWorldspaceWidget(dropData.begin()->getId(), mDocument, this);
toolbar = makeToolbar(unPagedNewWidget, widget_Unpaged); toolbar = makeToolbar(unPagedNewWidget, widget_Unpaged);
makeConnections(unPagedNewWidget); makeConnections(unPagedNewWidget);
replaceToolbarAndWorldspace(unPagedNewWidget, toolbar); replaceToolbarAndWorldspace(unPagedNewWidget, toolbar);
cellSelectionChanged(*(data.begin())); cellSelectionChanged(*(dropData.begin()));
break; break;
case CSVRender::WorldspaceWidget::ignored: case CSVRender::WorldspaceWidget::ignored:

View File

@ -203,14 +203,14 @@ bool CSVWorld::TableSubView::eventFilter (QObject* object, QEvent* event)
{ {
if (QDropEvent* drop = dynamic_cast<QDropEvent*>(event)) if (QDropEvent* drop = dynamic_cast<QDropEvent*>(event))
{ {
const CSMWorld::TableMimeData* data = dynamic_cast<const CSMWorld::TableMimeData*>(drop->mimeData()); const CSMWorld::TableMimeData* mimeData = dynamic_cast<const CSMWorld::TableMimeData*>(drop->mimeData());
if (!data) // May happen when non-records (e.g. plain text) are dragged and dropped if (!mimeData) // May happen when non-records (e.g. plain text) are dragged and dropped
return false; return false;
bool handled = data->holdsType(CSMWorld::UniversalId::Type_Filter); bool handled = mimeData->holdsType(CSMWorld::UniversalId::Type_Filter);
if (handled) if (handled)
{ {
mFilterBox->setRecordFilter(data->returnMatching(CSMWorld::UniversalId::Type_Filter).getId()); mFilterBox->setRecordFilter(mimeData->returnMatching(CSMWorld::UniversalId::Type_Filter).getId());
} }
return handled; return handled;
} }