<br><br><div class="gmail_quote">On Fri, Jun 11, 2010 at 9:04 PM, James Cameron <span dir="ltr">&lt;<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, Jun 11, 2010 at 01:25:06AM -0300, Gonzalo Odiard wrote:<br>
&gt; I think it works, but i don&#39;t know if the right thing to do.<br>
&gt;<br>
&gt; From 97fb2adb1ea97a472e020244ae7a2d22c7a94db3 Mon Sep 17 00:00:00 2001<br>
&gt; From: Gonzalo Odiard &lt;<a href="mailto:godiard@gmail.com">godiard@gmail.com</a>&gt;<br>
&gt; Date: Fri, 11 Jun 2010 01:22:36 -0300<br>
&gt; Subject: [PATCH] fix #1771 - paint overwrites file type instead of creating new file<br>
&gt;<br>
<br>
</div>Your patch was missing an explanation in the commit message, but during<br>
review I tried to make an explanation.  I&#39;ll put the explanation here<br>
and ask you to review it:<br>
<br>
&quot;Paint only writes type image/png.  It can load other types, but<br>
overwrites as image/png.  This patch detects reading a type that is not<br>
image/png, and forgets the association between the image being edited<br>
and the journal entry that was read, so that the original journal entry<br>
is not overwritten.&quot;<br>
<br>
Does that match your understanding?<br></blockquote><div><br>Yes, it&#39;s ok. <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
&gt; <a href="http://bugs.sugarlabs.org/ticket/1771" target="_blank">http://bugs.sugarlabs.org/ticket/1771</a><br>
&gt; ---<br>
&gt;  OficinaActivity.py |    5 ++++-<br>
&gt;  1 files changed, 4 insertions(+), 1 deletions(-)<br>
&gt;<br>
&gt; diff --git a/OficinaActivity.py b/OficinaActivity.py<br>
&gt; index c72576a..78bc8cf 100644<br>
&gt; --- a/OficinaActivity.py<br>
&gt; +++ b/OficinaActivity.py<br>
&gt; @@ -140,8 +140,8 @@ class OficinaActivity(activity.Activity):<br>
&gt;<br>
&gt;      def read_file(self, file_path):<br>
&gt;          &#39;&#39;&#39;Read file from Sugar Journal.&#39;&#39;&#39;<br>
&gt; +        print &#39;reading file&#39;, file_path, &quot;mime_type&quot;, self.metadata<br>
&gt; [&#39;mime_type&#39;]<br>
&gt;<br>
&gt; -        logging.debug(&#39;reading file %s&#39;, file_path)<br>
<br>
</div>Why did you change this to print?  If it was only temporary, change it<br>
back.  If it is of use, change the logging.debug line.<br>
<br>
Hint: since the logging level can&#39;t be changed once Sugar is started, I<br>
change &quot;debug&quot; to &quot;error&quot; while I am testing code, and then change it<br>
back to &quot;debug&quot; before committing the patch.<br>
<div class="im"><br></div></blockquote><div>Was temporary, but your idea is better for debugging. <br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
&gt;<br>
&gt;          pixbuf = gtk.gdk.pixbuf_new_from_file(file_path)<br>
&gt;<br>
&gt; @@ -155,6 +155,9 @@ class OficinaActivity(activity.Activity):<br>
&gt;          self._setup_handle = self.fixed.connect(&#39;size_allocate&#39;,<br>
&gt;                  size_allocate_cb)<br>
&gt;<br>
&gt; +        if self.metadata[&#39;mime_type&#39;] != &quot;image/png&quot;:<br>
&gt; +            self._jobject.object_id = None<br>
&gt; +<br>
<br>
</div>A comment would be useful here, because reading the code doesn&#39;t explain<br>
why it is happening.  Something like:<br>
<br>
# disassociate with journal entry to avoid overwrite (SL #1771)<br>
<div><div></div><div class="h5"><br>
&gt;      def write_file(self, file_path):<br>
&gt;          &#39;&#39;&#39;Save file on Sugar Journal. &#39;&#39;&#39;<br>
&gt;<br>
&gt; --<br>
&gt; 1.6.6.1<br>
<br></div></div></blockquote><div>I was thinking change the title also, because is unclear when you see two inputs in the journal with the same name but there are two different files.<br>May be changing the extension or setting the title empty. I don&#39;t know what it&#39;s better.<br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="h5">
--<br>
</div></div><font color="#888888">James Cameron<br>
<a href="http://quozl.linux.org.au/" target="_blank">http://quozl.linux.org.au/</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Gonzalo Odiard<br>Responsable de Desarrollo<br>Sistemas Australes<br><br>