<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">>Thinking about this. There really
      isn't a reason to force item names/id to be unqiue . if I want to
      have three items named the same then that is really my choice.  If
      I have say three map windows that I >want to set all to the
      same extents then I could just call them all "maps" and just loop
      over all the items with that name.<br>
      <br>
      There is use for both unique names (or auto-incrementing numbers)
      and user-defined names. And both cases are already used:<br>
      <br>
      - auto-incrementing number in QgsComposerMap::mId. Needs to be
      unique within the composition because other elements may refer to
      it (north-arrow items or overview maps)<br>
      - user-defined names: QgsComposerItem::mId (unfortunately with the
      same attribute name as the composer map int id). <br>
      <br>
      Regards,<br>
      Marco<br>
      <br>
      On 19.02.2013 01:04, Nathan Woodrow wrote:<br>
    </div>
    <blockquote
cite="mid:CAAi8Yg_zP2042buWiJ_7HcbRoYFGn4rzaJTaXb5g=rZF=HWm2w@mail.gmail.com"
      type="cite">
      <p dir="ltr">Thinking about this. There really isn't a reason to
        force item names/id to be unqiue . if I want to have three items
        named the same then that is really my choice.  If I have say
        three map windows that I want to set all to the same extents
        then I could just call them all "maps" and just loop over all
        the items with that name.</p>
      <p dir="ltr">- sent from a tablet device that isn't an iPad </p>
      <div class="gmail_quote">On 19 Feb 2013 10:54, "Nathan Woodrow"
        <<a moz-do-not-send="true" href="mailto:madmanwoo@gmail.com">madmanwoo@gmail.com</a>>
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <p dir="ltr">Personally I'm not a fan of using a uuid unless
            the user doesn't need to enter them.</p>
          <p dir="ltr">For me a composer item only needs a id or name
            not both.  You can just store a counter on the composer the
            item belongs to as only has to be unique for that composer.
            I would just auto name them "composeritem_n" and have the
            composer assign the name/id when the item is added to the
            composer. If the user wants to change it later he can.</p>
          <p dir="ltr">- sent from a tablet device that isn't an iPad </p>
          <div class="gmail_quote">On 19 Feb 2013 10:38, "Olivier
            Dalang" <<a moz-do-not-send="true"
              href="mailto:olivier.dalang@gmail.com" target="_blank">olivier.dalang@gmail.com</a>>
            wrote:<br type="attribution">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              OK I've got something which seems to work well using
              QUuid.<br>
              It's easier with QUuid than an incremental id since
              there's no need to<br>
              store the last key.<br>
              <br>
              It already works more or less, I'll make a pull request
              soon.<br>
              <br>
              What do you think about the other attribute ? (which would
              be called<br>
              smthg like "Internal name", and would replace current id's
              behavior)<br>
              I'm not sure this is useful though. Maybe it will only be
              confusing to<br>
              the user...<br>
              <br>
              Should I add this attribute or not ?<br>
              <br>
              <br>
              <br>
              2013/2/18 Nathan Woodrow <<a moz-do-not-send="true"
                href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>>:<br>
              > Olivier,<br>
              ><br>
              > I added the item id for that reason. Feel free to
              rework then so they<br>
              > are auto generated and unique. That was my intention
              just never got<br>
              > around to it.<br>
              ><br>
              > - Nathan<br>
              ><br>
              > Sent from some fancy phone looking thingo<br>
              > From: Olivier Dalang<br>
              > Sent: 19/02/2013 3:27 AM<br>
              > To: <a moz-do-not-send="true"
                href="mailto:qgis-developer@lists.osgeo.org"
                target="_blank">qgis-developer@lists.osgeo.org</a><br>
              > Subject: [Qgis-developer] Composer item's IDs<br>
              > Hi !<br>
              ><br>
              > I'm developing a plugin which needs to attach some
              custom data to some<br>
              > Composer Item's instances.<br>
              > Thus, I need a way to identify the instances.<br>
              ><br>
              > I saw that there's an ID attribute in the
              ComposerItems, but don't<br>
              > really know how it's supposed to work. It seems for
              now it's only an<br>
              > user defined value, which remains empty when the user
              doesn't provide<br>
              > it and which also can be duplicated.<br>
              > So it seems I can't use this as an unique ID.<br>
              ><br>
              > What's the best way to do that ?<br>
              ><br>
              ><br>
              > More globally, what is this ID good for ? Is it's
              behavior not fully<br>
              > implemented yet ?<br>
              ><br>
              > I think it would be useful to auto-assign unique
              which the user<br>
              > couldn't change. If needed, another attribute ("name"
              or "tag") could<br>
              > be added to replace the current "ID" behaviour,
              allowing the user to<br>
              > define custom data.<br>
              ><br>
              > What do you think ?<br>
              ><br>
              > Thanks !!<br>
              ><br>
              > Olivier<br>
              > _______________________________________________<br>
              > Qgis-developer mailing list<br>
              > <a moz-do-not-send="true"
                href="mailto:Qgis-developer@lists.osgeo.org"
                target="_blank">Qgis-developer@lists.osgeo.org</a><br>
              > <a moz-do-not-send="true"
                href="http://lists.osgeo.org/mailman/listinfo/qgis-developer"
                target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
<a class="moz-txt-link-abbreviated" href="mailto:marco.hugentobler@sourcepole.ch">marco.hugentobler@sourcepole.ch</a> <a class="moz-txt-link-freetext" href="http://www.sourcepole.ch">http://www.sourcepole.ch</a>
Technical Advisor QGIS Project Steering Committee </pre>
  </body>
</html>