If inotify is available it will use that I think. Checking time is an option for the sugar cache (file content) but not for the gtk one (file path).<div><br></div><div>Perhaps it's fine if the change is picked up on activity restart? It will probably not auto apply anyway, only newly created icons will change even if the caches are invalidated.<span></span><br>
<br>On Wednesday, 19 June 2013, Gonzalo Odiard wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hmm, that will be a file monitor for every activity running too,<div>
if I am not wrong, that is implemented polling,</div><div>may be is better check datetime modification when one icon is needed.</div>
<div><br></div><div>Gonzalo</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 12:05 PM, Daniel Narvaez <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'dwnarvaez@gmail.com');" target="_blank">dwnarvaez@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh yes, you will need to invalidate both caches. I guess the shell can keep a file monitor on the icons dir and invalidate when it changes.<div>
<div><span></span><br><br>On Wednesday, 19 June 2013, Walter Bender wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Jun 19, 2013 at 10:53 AM, Daniel Narvaez <<a>dwnarvaez@gmail.com</a>> wrote:<br>
> About the cache, did you try<br>
><br>
> <a href="https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-rescan-if-needed" target="_blank">https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-rescan-if-needed</a><br>
<br>
Tried that. Sugar seems to cache its icons separately from GTK. There<br>
used to be a cache file, but now I think it is all in memory. I need<br>
to dig deeper.<br>
<br>
-walter<br>
><br>
><br>
> On Wednesday, 19 June 2013, Walter Bender wrote:<br>
>><br>
>> Here are some thoughts about the custom icon patch:<br>
>><br>
>> (1) if we prepend ~/.sugar/icons to the theme icon path, then anything<br>
>> in that path will be used (as long as we flush the cache) as per<br>
>> dnarvaez's comment on the patch<br>
>> (2) if we have a sugar activity for selecting svg files (from the<br>
>> journal and some samples) and loading the selected file as<br>
>> computer-xo.svg into ~/.sugar/icons then we are done.<br>
>><br>
>> #1 is a two-line addition to jarabe/main.py<br>
>><br>
>> icons_path = os.path.join(os.path.expanduser('~'), '.sugar', 'icons')<br>
>> Gtk.IconTheme.get_default().prepend_search_path(icons_path)<br>
>><br>
>> #2 is similar to what you already did for the cpsection, only it is a<br>
>> stand-alone activity similar to xo-colors<br>
>><br>
>> We can use Turtle Art and other activities to generate SVGs. (The old<br>
>> version of xo-colors let you edit the XO icon... with revisiting in<br>
>> this context.)<br>
>><br>
>> We need to figure out how to flush the icon cache.<br>
>><br>
>> regards.<br>
>><br>
>> -walter<br>
>><br>
>><br>
>> --<br>
>> Walter Bender<br>
>> Sugar Labs<br>
>> <a href="http://www.sugarlabs.org" target="_blank">http://www.sugarlabs.org</a><br>
><br>
><br>
><br>
> --<br>
> Daniel Narvaez<br>
><br>
<br>
<br>
<br>
--<br>
Walter Bender<br>
Sugar Labs<br>
<a href="http://www.sugarlabs.org" target="_blank">http://www.sugarlabs.org</a><br>
</blockquote><br><br></div></div><span><font color="#888888">-- <br>Daniel Narvaez<br><br>
</font></span><br>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="javascript:_e({}, 'cvml', 'Sugar-devel@lists.sugarlabs.org');" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br>-- <br>Daniel Narvaez<br><br>