Record Cloning

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

Re: Record Cloning

Post by sirherrbatka » 20 Jan 2014, 17:16

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: 5134
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini » 20 Jan 2014, 17:59

The IdTable class is sending the update signals.

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka » 20 Jan 2014, 18:05

ooops, i see. Silly me.

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka » 21 Jan 2014, 11:16

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: 5134
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini » 21 Jan 2014, 11:58

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: 2121
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka » 21 Jan 2014, 12:06

ah, this is actually usefull information. Thanks :)

User avatar
sirherrbatka
Posts: 2121
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka » 21 Jan 2014, 15:47

:?

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: 5134
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini » 21 Jan 2014, 19:08

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: 2121
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka » 21 Jan 2014, 19:53

Reference ID has to be unique only in the scope of a cell or I'm missunderstanding it?

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini » 21 Jan 2014, 20:23

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

Who is online

Users browsing this forum: No registered users and 2 guests