<br><br><div class="gmail_quote">On Thu, Feb 10, 2011 at 11:30 AM, Erik Blankinship <span dir="ltr"><<a href="mailto:erikb@mediamods.com">erikb@mediamods.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
> How can I determine if a file loaded with a sugar object chooser was<br>
> selected from the datastore or from an external storage device?<br>
<br>
</div>On Sugar 0.84+, there is no difference. Objects on external storage get<br>
copied to the data store first.<br>
<br></blockquote><div><br></div></div><div>But the objects don't get copied to the Journal (or at least I don't see them there). </div><div><br></div><div>Maybe I should rephrase my question: how can I know if the selected object was loaded from the Journal?</div>
<div><br></div><div>What I am trying to do:</div><div>If an object is loaded from an external device, I want to add a copy of that object to the user's journal.</div></div></blockquote><div><br></div><div><br></div><div>
How does this idea look to the community? Seems hackish to me, but might work?</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">errything = datastore.find( {} )[0]</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">...</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace">dsobject = chooser.get_selected_object( )</font></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace"><br></font></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace">from_journal = False</font></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace">for <meta charset="utf-8">errything_ds in errything:</font></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace"> if </font></span><span class="Apple-style-span" style="border-collapse: collapse; font-family: 'courier new', monospace; ">errything_</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: 'courier new', monospace; ">ds.object_id == dsobject.object_id:</span></div>
<meta charset="utf-8"><div><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace"> from_journal = True</font></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace"> break</font></span></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div></div>