diff options
author | Ted Gould <ted@canonical.com> | 2009-09-29 16:43:06 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-29 16:43:06 -0500 |
commit | cf185b650bc83909d1e93c2c613e9c9982ac8da9 (patch) | |
tree | 63198f7c03dbc46cbeabbf788166112c99b931c1 | |
parent | 82f05a0cb11648cafaed130c12ef1db630299377 (diff) | |
download | ayatana-indicator-messages-cf185b650bc83909d1e93c2c613e9c9982ac8da9.tar.gz ayatana-indicator-messages-cf185b650bc83909d1e93c2c613e9c9982ac8da9.tar.bz2 ayatana-indicator-messages-cf185b650bc83909d1e93c2c613e9c9982ac8da9.zip |
Adding in a creation seconds and returning that if seconds isn't set.
-rw-r--r-- | src/im-menu-item.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/im-menu-item.c b/src/im-menu-item.c index c2b3d12..4357dee 100644 --- a/src/im-menu-item.c +++ b/src/im-menu-item.c @@ -47,6 +47,7 @@ struct _ImMenuItemPrivate IndicateListenerServer * server; IndicateListenerIndicator * indicator; + glong creation_seconds; glong seconds; gchar * count; gulong indicator_changed; @@ -132,13 +133,14 @@ im_menu_item_init (ImMenuItem *self) priv->indicator = NULL; /* A sane default, but look below */ + priv->creation_seconds = 0; priv->seconds = 0; /* Set the seconds to be the time when the item was created incase we're not given a better time. */ GTimeVal current_time; g_get_current_time(¤t_time); - priv->seconds = current_time.tv_sec; + priv->creation_seconds = current_time.tv_sec; return; } @@ -449,7 +451,12 @@ im_menu_item_get_seconds (ImMenuItem * menuitem) g_return_val_if_fail(IS_IM_MENU_ITEM(menuitem), 0); ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(menuitem); - return priv->seconds; + + if (priv->seconds == 0) { + return priv->creation_seconds; + } else { + return priv->seconds; + } } /* Gets whether or not this indicator item is |