From 0f29ab8cf998222a6a27b7c9c299ecf0c3ed7fd0 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 7 May 2013 14:19:02 +0200 Subject: [PATCH] fixed the interface of the adapter class --- apps/opencs/model/world/refidadapter.hpp | 7 ++++--- apps/opencs/model/world/refidcollection.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/opencs/model/world/refidadapter.hpp b/apps/opencs/model/world/refidadapter.hpp index fa56e28368..bb9005b275 100644 --- a/apps/opencs/model/world/refidadapter.hpp +++ b/apps/opencs/model/world/refidadapter.hpp @@ -23,10 +23,11 @@ namespace CSMWorld virtual ~RefIdAdapter(); - virtual QVariant getData (const RefIdColumn *column, const RefIdData& data) const = 0; - - virtual void setData (const RefIdColumn *column, RefIdData& data, const QVariant& value) + virtual QVariant getData (const RefIdColumn *column, const RefIdData& data, int idnex) const = 0; + + virtual void setData (const RefIdColumn *column, RefIdData& data, int index, + const QVariant& value) const = 0; ///< If the data type does not match an exception is thrown. virtual std::string getId (const RecordBase& record) const = 0; diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index 751d4e759c..013970b048 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -83,7 +83,7 @@ QVariant CSMWorld::RefIdCollection::getData (int index, int column) const const RefIdAdapter& adaptor = findAdaptor (localIndex.second); - return adaptor.getData (&mColumns.at (column), mData); + return adaptor.getData (&mColumns.at (column), mData, localIndex.first); } void CSMWorld::RefIdCollection::setData (int index, int column, const QVariant& data) @@ -92,7 +92,7 @@ void CSMWorld::RefIdCollection::setData (int index, int column, const QVariant& const RefIdAdapter& adaptor = findAdaptor (localIndex.second); - adaptor.setData (&mColumns.at (column), mData, data); + adaptor.setData (&mColumns.at (column), mData, localIndex.first, data); } void CSMWorld::RefIdCollection::removeRows (int index, int count)