Mercurial > pidgin.yaz
changeset 13033:69b3d5cbd2b1
[gaim-migrate @ 15389]
Kill gaim_date() and gaim_date_full(). The former isn't used and the latter is used only twice. This makes the buddy pounce pop-ups and debug log headers contain localized dates, fixing part of SF Bug #1325915. Thanks to Bleeter for discovering that gaim_date() isn't used.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 25 Jan 2006 02:58:54 +0000 |
parents | 4016a35bdd4d |
children | 615c84e94745 |
files | plugins/ChangeLog.API plugins/perl/common/Util.xs src/gtkdebug.c src/gtkpounce.c src/util.c src/util.h |
diffstat | 6 files changed, 11 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/ChangeLog.API Tue Jan 24 06:08:39 2006 +0000 +++ b/plugins/ChangeLog.API Wed Jan 25 02:58:54 2006 +0000 @@ -147,6 +147,8 @@ * gaim_gtk_privacy_is_showable(): We do fallback privacy in the core now, so this would always be TRUE now. * gaim_blist_node_action_new(); use gaim_menu_action_new() instead + * gaim_date() + * gaim_date_full() Added: * gaim_prefs_disconnect_by_handle()
--- a/plugins/perl/common/Util.xs Tue Jan 24 06:08:39 2006 +0000 +++ b/plugins/perl/common/Util.xs Wed Jan 25 02:58:54 2006 +0000 @@ -51,12 +51,6 @@ const char *path int mode -const char * -gaim_date() - -const char * -gaim_date_full() - gboolean gaim_email_is_valid(address) const char *address
--- a/src/gtkdebug.c Tue Jan 24 06:08:39 2006 +0000 +++ b/src/gtkdebug.c Wed Jan 25 02:58:54 2006 +0000 @@ -212,6 +212,8 @@ DebugWindow *win = (DebugWindow *)user_data; FILE *fp; char *tmp; + time_t now = time(NULL); + char date[64]; if ((fp = g_fopen(filename, "w+")) == NULL) { gaim_notify_error(win, NULL, _("Unable to open file."), NULL); @@ -219,7 +221,8 @@ } tmp = gtk_imhtml_get_text(GTK_IMHTML(win->text), NULL, NULL); - fprintf(fp, "Gaim Debug log : %s\n", gaim_date_full()); + strftime(date, sizeof(date), "%c", localtime(&now)); + fprintf(fp, "Gaim Debug Log : %s\n", date); fprintf(fp, "%s", tmp); g_free(tmp);
--- a/src/gtkpounce.c Tue Jan 24 06:08:39 2006 +0000 +++ b/src/gtkpounce.c Wed Jan 25 02:58:54 2006 +0000 @@ -1432,6 +1432,8 @@ if (gaim_pounce_action_is_enabled(pounce, "popup-notify")) { + time_t now = time(NULL); + char date[64]; char *tmp; const char *name_shown; const char *reason; @@ -1472,11 +1474,12 @@ if ((name_shown = gaim_account_get_alias(account)) == NULL) name_shown = gaim_account_get_username(account); + strftime(date, sizeof(date), "%c", localtime(&now)); if (reason == NULL) - gaim_notify_info(NULL, name_shown, tmp, gaim_date_full()); + gaim_notify_info(NULL, name_shown, tmp, date); else { - char *tmp2 = g_strdup_printf("%s\n\n%s", reason, gaim_date_full()); + char *tmp2 = g_strdup_printf("%s\n\n%s", reason, date); gaim_notify_info(NULL, name_shown, tmp, tmp2); g_free(tmp2); }
--- a/src/util.c Tue Jan 24 06:08:39 2006 +0000 +++ b/src/util.c Wed Jan 25 02:58:54 2006 +0000 @@ -475,30 +475,6 @@ /************************************************************************** * Date/Time Functions **************************************************************************/ -const char * -gaim_date(void) -{ - static char date[80]; - time_t tme; - - time(&tme); - strftime(date, sizeof(date), "%H:%M:%S", localtime(&tme)); - - return date; -} - -const char * -gaim_date_full(void) -{ - char *date; - time_t tme; - - time(&tme); - date = ctime(&tme); - date[strlen(date) - 1] = '\0'; - - return date; -} time_t gaim_time_build(int year, int month, int day, int hour, int min, int sec)
--- a/src/util.h Tue Jan 24 06:08:39 2006 +0000 +++ b/src/util.h Wed Jan 25 02:58:54 2006 +0000 @@ -201,30 +201,6 @@ /*@{*/ /** - * Returns the current local time in hour:minute:second form. - * - * The returned string is stored in a static buffer, so the result - * should be g_strdup()'d if it's intended to be used for long. - * - * @return The current local time. - * - * @see gaim_date_full() - */ -const char *gaim_date(void); - -/** - * Returns the date and time in human-readable form. - * - * The returned string is stored in a static buffer, so the result - * should be g_strdup()'d if it's intended to be used for long. - * - * @return The date and time in human-readable form. - * - * @see gaim_date() - */ -const char *gaim_date_full(void); - -/** * Builds a time_t from the supplied information. * * @param year The year.