mirror of
https://github.com/transmission/transmission
synced 2025-03-04 02:28:03 +00:00
(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:
parent
e46d0a72ba
commit
a891136602
3 changed files with 14 additions and 17 deletions
14
gtk/msgwin.c
14
gtk/msgwin.c
|
@ -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 )
|
||||
{
|
||||
|
|
13
gtk/util.c
13
gtk/util.c
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue