Hi
I put together a patch that adds icons in the symbol treeview. I had to change the way tag_list_add_groups works: now each group takes an additional parameter; this parameter is the name of the themable icon to use for the group or NULL to avoid setting an icon. Later when adding the members, they will use the icon of their parent iter.
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
Cheers
PS: i have attached the icons i used because diff does not support binary files. After applying the patch you have to copy them in the icons/16x16 directory.
On Thu, 19 Jul 2007 14:01:17 +0200, Jean-François Wauthy pollux@xfce.org wrote:
Hi
I put together a patch that adds icons in the symbol treeview. I had to change the way tag_list_add_groups works: now each group takes an additional parameter; this parameter is the name of the themable icon to use for the group or NULL to avoid setting an icon. Later when adding the members, they will use the icon of their parent iter.
Cool!
Looking forward to the merge!
-H-
On 07/19/2007 01:01:17 PM, Jean-François Wauthy wrote:
Hi
I put together a patch that adds icons in the symbol treeview. I had
Thanks for this, I've yet to test it but it looks good.
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
PS: i have attached the icons i used because diff does not support binary files. After applying the patch you have to copy them in the icons/16x16 directory.
The icons look great, did you draw them? Just to make sure - I assume these icons are GPL compatible?
Regards, Nick
Le jeudi 19 juillet 2007 à 16:47 +0100, Nick Treleaven a écrit :
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
Yeah me too but what i meant is the fact that the code of geany parses the string instead of simply directly retrieving the line number from the tree model, which is quicker. Of course, this requires some changes in the code but should be easy.
PS: i have attached the icons i used because diff does not support binary files. After applying the patch you have to copy them in the icons/16x16 directory.
The icons look great, did you draw them? Just to make sure - I assume these icons are GPL compatible?
They come from the kdevelop tarball actually, so i guess it's GPL compatible but i did not check.
On Thu, 19 Jul 2007 17:57:08 +0200, Jean-François Wauthy pollux@xfce.org wrote:
Le jeudi 19 juillet 2007 à 16:47 +0100, Nick Treleaven a écrit :
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
Yeah me too but what i meant is the fact that the code of geany parses the string instead of simply directly retrieving the line number from the tree model, which is quicker. Of course, this requires some changes in the code but should be easy.
Yes it is easy to change. I don't know why I didn't ntoiced this earlier but the code to parse the line number is very old and probably wasn't touched since it was written ;-). Will be changed.
Regards, Enrico
On 07/19/2007 05:06:58 PM, Enrico Tröger wrote:
On Thu, 19 Jul 2007 17:57:08 +0200, Jean-François Wauthy pollux@xfce.org wrote:
Le jeudi 19 juillet 2007 à 16:47 +0100, Nick Treleaven a écrit :
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
Yeah me too but what i meant is the fact that the code of geany
parses
the string instead of simply directly retrieving the line number
from
the tree model, which is quicker. Of course, this requires some changes in the code but should be easy.
Yes it is easy to change. I don't know why I didn't ntoiced this earlier but the code to parse the line number is very old and probably wasn't touched since it was written ;-). Will be changed.
Well, maybe it would make the code a bit neater, but it isn't really going to make a difference in terms of speed, and it saves memory if the line number is already stored in the string. The time it takes Gtk/Scintilla to scroll to the tag line dwarfs the time it takes to parse the string. But I don't mean to start an argument, just my thoughts ;-)
Regards, Nick
On Thu, 19 Jul 2007 17:45:02 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 07/19/2007 05:06:58 PM, Enrico Tröger wrote:
On Thu, 19 Jul 2007 17:57:08 +0200, Jean-François Wauthy pollux@xfce.org wrote:
Le jeudi 19 juillet 2007 à 16:47 +0100, Nick Treleaven a écrit :
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
Yeah me too but what i meant is the fact that the code of geany
parses
the string instead of simply directly retrieving the line number
from
the tree model, which is quicker. Of course, this requires some changes in the code but should be easy.
Yes it is easy to change. I don't know why I didn't ntoiced this earlier but the code to parse the line number is very old and probably wasn't touched since it was written ;-). Will be changed.
Well, maybe it would make the code a bit neater, but it isn't really going to make a difference in terms of speed, and it saves memory if the line number is already stored in the string. The time it takes Gtk/Scintilla to scroll to the tag line dwarfs the time it takes to parse the string. But I don't mean to start an argument, just my
Sure, the improvement in execution time probably won't be even measurable but I think it is at least cleaner and more readable if we store the line number in the tree store. But if the line number is read from the store and not parsed out of the tag name, tag names can also have '[' and ']' without getting Geany into trouble ;-). (no idea whether '[' and ']' are valid characters for symbols but maybe)
Regards, Enrico
On Fri, 20 Jul 2007 12:51:35 +0200, Enrico Tröger enrico.troeger@uvena.de wrote:
On Thu, 19 Jul 2007 17:45:02 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 07/19/2007 05:06:58 PM, Enrico Tröger wrote:
On Thu, 19 Jul 2007 17:57:08 +0200, Jean-François Wauthy pollux@xfce.org wrote:
Le jeudi 19 juillet 2007 à 16:47 +0100, Nick Treleaven a écrit :
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
Yeah me too but what i meant is the fact that the code of geany
parses
the string instead of simply directly retrieving the line number
from
the tree model, which is quicker. Of course, this requires some changes in the code but should be easy.
Yes it is easy to change. I don't know why I didn't ntoiced this earlier but the code to parse the line number is very old and probably wasn't touched since it was written ;-). Will be changed.
Well, maybe it would make the code a bit neater, but it isn't really going to make a difference in terms of speed, and it saves memory if the line number is already stored in the string. The time it takes Gtk/Scintilla to scroll to the tag line dwarfs the time it takes to parse the string. But I don't mean to start an argument, just my
Sure, the improvement in execution time probably won't be even measurable but I think it is at least cleaner and more readable if we store the line number in the tree store.
Done in SVN r1731.
Regards, Enrico
On 07/19/2007 04:57:08 PM, Jean-François Wauthy wrote:
Le jeudi 19 juillet 2007 à 16:47 +0100, Nick Treleaven a écrit :
PS: i have attached the icons i used because diff does not support binary files. After applying the patch you have to copy them in
the
icons/16x16 directory.
The icons look great, did you draw them? Just to make sure - I
assume
these icons are GPL compatible?
They come from the kdevelop tarball actually, so i guess it's GPL compatible but i did not check.
OK, great :)
Regards, Nick
On Thu, 19 Jul 2007 16:47:15 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 07/19/2007 01:01:17 PM, Jean-François Wauthy wrote:
Hi
I put together a patch that adds icons in the symbol treeview. I had
Thank you very much Jean-François. Great.
As a side question, why do you parse the string stored in the treeview instead of simply adding a column storing the line number (as an integer) associated with the symbol in the model and not showing in tree ?
I find it's sometimes useful to see the line number of tags.
I also don't want to remove the line number from the shown tag name. But we really could store the line number as an integer in the tree store and ust read it in the selection changed callback instead of parsing the line number out of the name. Should be faster and in any case safer. I will change the code after Nick applied the patch.
Regards, Enrico
On Fri, 20 Jul 2007 17:38:15 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 07/19/2007 01:01:17 PM, Jean-François Wauthy wrote:
Hi
I put together a patch that adds icons in the symbol treeview.
Thanks for the patch, looks great! Just added in SVN.
I'm not sure whether it is a problem on my installation or it is a general bug: when Geany is installed in a non-standard prefix (here: --prefix=/home/enrico/apps) then Geany won't find the icons because /home/enrico/apps/share/icons is not in the icon search path of the GTK default theme. So, to work around it I just committed a fix which adds PACKAGE_DATA_DIR "/icons" (where PACKAGE_DATA_DIR is e.g. /home/enrico/apps/share) to the icon search path. This works for me. But maybe there is a cleaner way to get it working? Some GTK settings?
Anyway, I moved the code to query the GTK default icon theme so that it is ran only once to improve the startup speed of Geany because I noticed a significant slowdown while starting Geany ;-(. It seems to be much better now. So, Jean-François why did you use the GTK icon theme API to load the icons? Is there any big advantage? Maybe when we just load the images manually and set them to the tree store it might be faster.
Regards, Enrico