From: Richard L. <rl...@us...> - 2006-01-25 02:59:34
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21910/src Modified Files: gtkdebug.c gtkpounce.c util.c util.h Log Message: 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. Index: gtkdebug.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkdebug.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -p -r1.66 -r1.67 --- gtkdebug.c 11 Jan 2006 04:32:12 -0000 1.66 +++ gtkdebug.c 25 Jan 2006 02:58:54 -0000 1.67 @@ -212,6 +212,8 @@ save_writefile_cb(void *user_data, const 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 @@ save_writefile_cb(void *user_data, const } 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); Index: gtkpounce.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkpounce.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -p -r1.90 -r1.91 --- gtkpounce.c 19 Jan 2006 02:44:07 -0000 1.90 +++ gtkpounce.c 25 Jan 2006 02:58:54 -0000 1.91 @@ -1432,6 +1432,8 @@ pounce_cb(GaimPounce *pounce, GaimPounce 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 @@ pounce_cb(GaimPounce *pounce, GaimPounce 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); } Index: util.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/util.c,v retrieving revision 1.383 retrieving revision 1.384 diff -u -d -p -r1.383 -r1.384 --- util.c 17 Jan 2006 23:22:18 -0000 1.383 +++ util.c 25 Jan 2006 02:58:54 -0000 1.384 @@ -475,30 +475,6 @@ gaim_mime_decode_field(const char *str) /************************************************************************** * 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) Index: util.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/util.h,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -p -r1.90 -r1.91 --- util.h 17 Jan 2006 23:22:18 -0000 1.90 +++ util.h 25 Jan 2006 02:58:54 -0000 1.91 @@ -201,30 +201,6 @@ char *gaim_mime_decode_field(const char /*@{*/ /** - * 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. |