Record Cloning

Involved development of the OpenMW construction set.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

I can't figure out when and how table view is refreshed. Create Command is not doing anything other than my clone command, and collections itself do not send any signals as far as I can see. What I am missing?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini »

The IdTable class is sending the update signals.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

ooops, i see. Silly me.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

Ok, Cloning works for all id-tables. However It does not work for non-id tables, for instance topics. I get exception throwed from from the following ctor.

Code: Select all

CSMWorld::UniversalId::UniversalId (Type type, const std::string& id)
: mArgumentType (ArgumentType_Id), mType (type), mId (id), mIndex (0)
{
    for (int i=0; sIdArg[i].mName; ++i)
        if (type==sIdArg[i].mType)
        {
            mClass = sIdArg[i].mClass;
            return;
        }

    throw std::logic_error ("invalid ID argument UniversalId type");
}
Which comes with no surprise, though. I don't quite understand how non-id records are handled yet.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini »

We don't have non-id records anymore. Internally OpenCS translates all record indices into string IDs. The index type is only used for subviews that do not contain record tables.

btw. topics were never indexed in the first place. They always had IDs, even in vanilla MW.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

ah, this is actually usefull information. Thanks :)
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

:?

My guess is that sRecordId is for the autogenerating ids. However, when it is increased? How references are handled, since they appear to miss the sRecordId? Sorry for being annoying, I just must know it in order to progress any further.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini »

sRecordId has nothing to do with record IDs. Its the header ID for the specific record type (see components/esm/defs.hpp).

RefCollection has a getNewId function.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

Reference ID has to be unique only in the scope of a cell or I'm missunderstanding it?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini »

With Reference ID you mean the OpenCS assigned string ID for a reference? This ID is unique within a project (i.e. the content file worked on and its dependencies).
Post Reply