(trunk gtk) gtr_localtime() is only used in one place, so make it a private function there instead of leaving it public in util.h

This commit is contained in:
Jordan Lee 2011-03-24 18:29:07 +00:00
parent e46d0a72ba
commit a891136602
3 changed files with 14 additions and 17 deletions

View File

@ -120,6 +120,20 @@ level_combo_changed_cb( GtkComboBox * combo_box, gpointer gdata )
scroll_to_bottom( data );
}
/* similar to asctime, but is utf8-clean */
static char*
gtr_localtime( time_t time )
{
char buf[256], *eoln;
const struct tm tm = *localtime( &time );
g_strlcpy( buf, asctime( &tm ), sizeof( buf ) );
if( ( eoln = strchr( buf, '\n' ) ) )
*eoln = '\0';
return g_locale_to_utf8( buf, -1, NULL, NULL, NULL );
}
static void
doSave( GtkWindow * parent, struct MsgData * data, const char * filename )
{

View File

@ -212,19 +212,6 @@ tr_strltime( char * buf, int seconds, size_t buflen )
return buf;
}
char *
gtr_localtime( time_t time )
{
char buf[256], *eoln;
const struct tm tm = *localtime( &time );
g_strlcpy( buf, asctime( &tm ), sizeof( buf ) );
if( ( eoln = strchr( buf, '\n' ) ) )
*eoln = '\0';
return g_locale_to_utf8( buf, -1, NULL, NULL, NULL );
}
int
gtr_mkdir_with_parents( const char * path, int mode )
{

View File

@ -63,10 +63,6 @@ char* tr_strlratio( char * buf, double ratio, size_t buflen );
/* return a human-readable string for the time given in seconds. */
char* tr_strltime( char * buf, int secs, size_t buflen );
/* similar to asctime, but is utf8-clean */
char* gtr_localtime( time_t time );
int gtr_compare_double( const double a, const double b, int decimal_places );