Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 28794: /trunk/gtk/ /trunk/gtk/: Make

From: Ulf Lamping <ulf.lamping@xxxxxxxxxxxxxx>
Date: Mon, 22 Jun 2009 08:53:48 +0200
Guy Harris schrieb:
On Jun 21, 2009, at 1:03 PM, Ulf Lamping wrote:

guy@xxxxxxxxxxxxx schrieb:
http://anonsvn.wireshark.org/viewvc/viewvc.cgi? view=rev&revision=28794

User: guy
Date: 2009/06/21 12:16 PM

Log:
"main_menu.[ch]" -> "menus.[ch]"; it handles not only the main menu, but
context menus.
Which menus that are not part of the main window does it contain then?

The menus in question might be part of the main *window*, but they're not the main (menu bar) menu. As such, if we want to emphasize that they're menus for the main window, perhaps "main_window_menu.[ch]" or "main_window_menus.[ch]" would be better.

There are a few hundred files in the gtk dir. I was giving "all the files" forming the main window the main_ prefix several months ago, as I was tired of trying to find any of them when I wanted to edit something.

I don't know if main_window_menus.[ch] or simply main_menus.[ch] might be better (although I would prefer main_menus). But giving up the main_ prefix just as you didn't notice it is, well, a step in the wrong direction IMHO.

Note, as long as we're talking about naming conventions, that, for example, add_byte_views() is called by code that draws windows other than the main window, even though it's in main_proto_draw.c. That also means some of the code in the "main window menu" file might end up being used in windows other than the main window - it's arguably a bug that there aren't pop-up menus for the packet detail pane in those windows.

You have to have a lot of knowledge to find the hex dump code in proto_draw.c - drawing the hex dump has *nothing* directly to do with the protocols in question :-)


But what are you trying to achieve?

There are a few hundred files in the gtk dir. There are some groups of files that have prefixes like capture_, conversations_, follow_, hostlist_, main_, prefs_ where you can quickly get an idea what might happen there without examine each file.


Before I introduced the main_ prefix, I remember several times seaching for the code displaying the hex dump - searching in a few hundred variously named files in the gtk dir (proto_draw isn't very intuitive here). If you guess that it might be somewhere in the main window, looking for main_ and getting the right file is a matter of seconds.


You wouldn't search menu helper code in files starting with capture_ I guess? So if we would have more such prefixes, you would probably find stuff easier than today - even if the prefix isn't 100% correct.

So IMO we would need more files with such prefixes, not less ...

Regards, ULFL