<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 23/01/2015 11:09, Dmitry Kazakov a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CAEkBSfUO+_15A5g2Ue_=6B-+NR68gftGrBxhWnWqF2gieWSrTQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">Hi!<br>
          </div>
          <div class="gmail_quote"><br>
          </div>
          <div class="gmail_quote">I'm afraid I don't understand the
            topic well enough, just a couple of thoughts that might
            help:<br>
            <br>
          </div>
          <div class="gmail_quote">1) MD5 must always be calculated on
            the static data. I don't know how we ended up to calculate
            it on derived/interpreted data, but it really sounds as a
            bug.<br>
          </div>
          <div class="gmail_quote">2) Dirty bits. Sometimes it is quite
            difficult to ensure consistency of such bits. If we solve
            problem 1), can we avoid that?<br>
          </div>
          <div class="gmail_quote">3) For only-memory resources like
            Bg/Fg gradients it might be enough to generate a default
            name for them and save real color values (current colors). I
            guess that is exactly what the user expects to do.<br>
          </div>
          <div class="gmail_quote"><br>
            <br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_extra">
                  <div class="gmail_quote"><span class=""></span>
                    <div>So i think that for problem 3 we have three
                      ways:</div>
                    <div><br>
                    </div>
                    <div>1) Either fix the classes to have only
                      deterministic parts (but this might not be always
                      possible given what the resource is and has to do)
                      or calculate md5 on something that we are sure
                      that it's not "interpreted" (but again this might
                      no be fully possible if those parts doesn't change
                      when the resource really change).</div>
                    <div><br>
                    </div>
                    <div>2) Implement a dirty bit in every resource and
                      when creating bundles, if a resource that the user
                      want to add to a bundle is modified, ask to the
                      user which version of the two (original file, or
                      the in memory modified version) he wants to add.</div>
                    <div>So if the resource is unmodified the original
                      file will be copied into the resource bundle
                      (right now is saved instead), if it's modified the
                      user will choose and the file will be saved into
                      the resource bundle only if the user chooses the
                      modified version.</div>
                    <div>This way the md5 should be always calculated on
                      the file, that is, afterall, the medium that can't
                      change when given to others.</div>
                    <div><br>
                    </div>
                    <div>3) This is like solution 2 but without having
                      to ask anything to the user. So for the case where
                      the file is modified we automatically choose to
                      use the modified version and to save it into the
                      bundle.<br>
                    </div>
                    <div><br>
                    </div>
                    <div>2-3 Though do no solve the problem that arise
                      when there's no original file, so when the
                      resource is only in memory and it's representation
                      can be different (when the resource is reloaded),
                      from user to user. I think it's not solvable if
                      not doing something like in point 1, or simply
                      being sure to have files for everything.</div>
                    <div><br>
                    </div>
                    <div>What do you all think?</div>
                  </div>
                </div>
              </div>
              <br>
            </blockquote>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    I don't think that's a good idea to save dirty presets in bundles,
    and even less without asking the user. Dirty presets are meant to be
    temporary only changes, so user always have to overwrite or save a
    new preset to keep their changes across sessions. Bundles should act
    the same way, or it will get very confusing.<br>
    <br>
    Timothée<br>
    <br>
    <blockquote
cite="mid:CAEkBSfUO+_15A5g2Ue_=6B-+NR68gftGrBxhWnWqF2gieWSrTQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
              Krita mailing list<br>
              <a moz-do-not-send="true" href="mailto:kimageshop@kde.org">kimageshop@kde.org</a><br>
              <a moz-do-not-send="true"
                href="https://mail.kde.org/mailman/listinfo/kimageshop"
                target="_blank">https://mail.kde.org/mailman/listinfo/kimageshop</a><br>
              <br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <br>
          -- <br>
          <div class="gmail_signature">Dmitry Kazakov</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Krita mailing list
<a class="moz-txt-link-abbreviated" href="mailto:kimageshop@kde.org">kimageshop@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/kimageshop">https://mail.kde.org/mailman/listinfo/kimageshop</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>