On Fri, 2010-08-27 at 17:05 +0200, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com
src/applet/CCApplet.cpp | 84 +++++++++++++++++++++++----------------------- src/applet/CCApplet.h | 16 ++++---- 2 files changed, 50 insertions(+), 50 deletions(-)
Looks ok to me.
diff --git a/src/applet/CCApplet.cpp b/src/applet/CCApplet.cpp index 587f568..4062bf7 100644 --- a/src/applet/CCApplet.cpp +++ b/src/applet/CCApplet.cpp @@ -129,31 +129,31 @@ static GtkWidget *create_menu(struct applet *applet) struct applet *applet_new(const char* app_name) { struct applet *applet = (struct applet*)xmalloc(sizeof(struct applet));
BTW, if you use x*z*alloc, you can drop some zero assignments below:
- applet->m_bDaemonRunning = true;
- applet->daemon_running = true; /* set-up icon buffers */
- applet->m_iAnimator = 0;
- applet->m_iAnimationStage = ICON_DEFAULT;
- applet->m_bIconsLoaded = load_icons(applet);
- applet->animator = 0; <========================= xzalloc would do it
- applet->animation_stage = ICON_DEFAULT; <========= ICON_DEFAULT is 0 too
Just commenting out the second like in unsafe - what if ICON_DEFAULT changes in the future? To drop ICON_DEFAULT assignment safely, you can write it as
if (ICON_DEFAULT != 0) applet->animation_stage = ICON_DEFAULT;
struct applet {
- GtkStatusIcon* m_pStatusIcon;
- GtkWidget *m_pMenu;
- GtkStatusIcon* status_icon;
- GtkWidget *menu;
Ever wondered why struct stat's members are all named "st_foo"? Or struct timeval members are named "tv_foo"?
It is done intentionally to make grepping for them easier: member names like "mode" or "sec" are too generic.
I am not saying we *must* name applet's members "ap_menu" etc. But in some other structure renames we might be better using this scheme.