diff options
author | Berke Viktor <bviktor@hexchat.org> | 2012-10-28 00:05:40 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2012-10-28 00:05:40 +0200 |
commit | fe1d958838cce03179870397f372e723881f2c89 (patch) | |
tree | 12a1e7d3d8adb719e08be108e93aa283e38addcf /src/common | |
parent | d892b3346eace3e8fa5530c9d710c1ce2c9fe34d (diff) |
More polishing for the About dialog
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/ctcp.c | 4 | ||||
-rw-r--r-- | src/common/outbound.c | 2 | ||||
-rw-r--r-- | src/common/util.c | 8 | ||||
-rw-r--r-- | src/common/util.h | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/common/ctcp.c b/src/common/ctcp.c index f950a901..bbe4e1e5 100644 --- a/src/common/ctcp.c +++ b/src/common/ctcp.c @@ -139,10 +139,10 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip, { #ifdef WIN32 snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" [x%d] / %s", - get_cpu_arch (), get_cpu_str ()); + get_cpu_arch (), get_sys_str (1)); #else snprintf (outbuf, sizeof (outbuf), "VERSION HexChat "PACKAGE_VERSION" / %s", - get_cpu_str ()); + get_sys_str (1)); #endif serv->p_nctcp (serv, nick, outbuf); } diff --git a/src/common/outbound.c b/src/common/outbound.c index ed97886e..a587d499 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -3885,7 +3885,7 @@ auto_insert (char *dest, int destlen, unsigned char *src, char *word[], case 'h': utf = h; break; case 'm': - utf = get_cpu_str (); break; + utf = get_sys_str (1); break; case 'n': utf = n; break; case 's': diff --git a/src/common/util.c b/src/common/util.c index 8f76cfc6..dcd4021f 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -674,7 +674,7 @@ get_cpu_arch (void) } char * -get_cpu_str (void) +get_sys_str (int with_cpu) { static char verbuf[64]; static char winver[20]; @@ -749,7 +749,7 @@ get_cpu_str (void) } mhz = get_mhz (); - if (mhz) + if (mhz && with_cpu) { double cpuspeed = ( mhz > 1000 ) ? mhz / 1000 : mhz; const char *cpuspeedstr = ( mhz > 1000 ) ? "GHz" : "MHz"; @@ -766,7 +766,7 @@ get_cpu_str (void) #else char * -get_cpu_str (void) +get_sys_str (int with_cpu) { #if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) double mhz; @@ -784,7 +784,7 @@ get_cpu_str (void) #if defined (USING_LINUX) || defined (USING_FREEBSD) || defined (__APPLE__) get_cpu_info (&mhz, &cpus); - if (mhz) + if (mhz && with_cpu) { double cpuspeed = ( mhz > 1000 ) ? mhz / 1000 : mhz; const char *cpuspeedstr = ( mhz > 1000 ) ? "GHz" : "MHz"; diff --git a/src/common/util.h b/src/common/util.h index d2e8e84e..b4185676 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -31,7 +31,7 @@ int buf_get_line (char *, char **, int *, int len); char *nocasestrstr (const char *text, const char *tofind); char *country (char *); void country_search (char *pattern, void *ud, void (*print)(void *, char *, ...)); -char *get_cpu_str (void); +char *get_sys_str (int with_cpu); int util_exec (const char *cmd); int util_execv (char * const argv[]); #define STRIP_COLOR 1 |