mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Fix warning C4458 (declaration of 'data' hides class member)
This commit is contained in:
parent
4290751010
commit
19eed6f4c4
@ -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> mimeData = mime->getData();
|
||||
|
||||
emit recordDropped(data, event->proposedAction());
|
||||
emit recordDropped(mimeData, event->proposedAction());
|
||||
}
|
||||
|
||||
void CSVFilter::FilterBox::dragEnterEvent (QDragEnterEvent* event)
|
||||
|
@ -536,18 +536,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 >& dropData, DropType type)
|
||||
{
|
||||
if (WorldspaceWidget::handleDrop (data, type))
|
||||
if (WorldspaceWidget::handleDrop (dropData, 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 < 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)))
|
||||
{
|
||||
selectionChanged = true;
|
||||
|
@ -84,21 +84,21 @@ 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>& dropData, DropType type)
|
||||
{
|
||||
if (WorldspaceWidget::handleDrop (data, type))
|
||||
if (WorldspaceWidget::handleDrop (dropData, type))
|
||||
return true;
|
||||
|
||||
if (type!=Type_CellsInterior)
|
||||
return false;
|
||||
|
||||
mCellId = data.begin()->getId();
|
||||
mCellId = dropData.begin()->getId();
|
||||
Cell *cell = new Cell (getDocument(), getSceneManager(), mCellId, getDocument().getPhysics());
|
||||
connect (cell->getSignalHandler(), SIGNAL(flagAsModified()), this, SLOT(flagAsModSlot()));
|
||||
mCell.reset (cell);
|
||||
|
||||
update();
|
||||
emit cellChanged(*data.begin());
|
||||
emit cellChanged(*dropData.begin());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -233,15 +233,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>& dropData,
|
||||
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 (dropData.begin());
|
||||
iter!=dropData.end(); ++iter)
|
||||
mRun->addProfile (iter->getId());
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,8 @@ void CSVWorld::DragRecordTable::dropEvent(QDropEvent *event)
|
||||
CSMWorld::ColumnBase::Display display = getIndexDisplayType(index);
|
||||
if (CSVWorld::DragDropUtils::canAcceptData(*event, display))
|
||||
{
|
||||
const CSMWorld::TableMimeData *data = CSVWorld::DragDropUtils::getTableMimeData(*event);
|
||||
if (data->fromDocument(mDocument))
|
||||
const CSMWorld::TableMimeData *mimeData = CSVWorld::DragDropUtils::getTableMimeData(*event);
|
||||
if (mimeData->fromDocument(mDocument))
|
||||
{
|
||||
CSMWorld::UniversalId id = CSVWorld::DragDropUtils::getAcceptedData(*event, display);
|
||||
QVariant newIndexData = QString::fromUtf8(id.getId().c_str());
|
||||
|
@ -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 >& dropData)
|
||||
{
|
||||
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 (dropData);
|
||||
|
||||
switch (mScene->getDropRequirements (type))
|
||||
{
|
||||
case CSVRender::WorldspaceWidget::canHandle:
|
||||
mScene->handleDrop (data, type);
|
||||
mScene->handleDrop (dropData, 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 (dropData, type);
|
||||
break;
|
||||
|
||||
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);
|
||||
makeConnections(unPagedNewWidget);
|
||||
replaceToolbarAndWorldspace(unPagedNewWidget, toolbar);
|
||||
cellSelectionChanged(*(data.begin()));
|
||||
cellSelectionChanged(*(dropData.begin()));
|
||||
break;
|
||||
|
||||
case CSVRender::WorldspaceWidget::ignored:
|
||||
|
@ -203,14 +203,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* mimeData = dynamic_cast<const CSMWorld::TableMimeData*>(drop->mimeData());
|
||||
if (!mimeData) // 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 = mimeData->holdsType(CSMWorld::UniversalId::Type_Filter);
|
||||
if (handled)
|
||||
{
|
||||
mFilterBox->setRecordFilter(data->returnMatching(CSMWorld::UniversalId::Type_Filter).getId());
|
||||
mFilterBox->setRecordFilter(mimeData->returnMatching(CSMWorld::UniversalId::Type_Filter).getId());
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user