Use Unix name and architecture in identification string
This results in a better string on BSD systems which up to now always identified as 'Linux'.
This commit is contained in:
parent
ccd6b3c201
commit
0ae4b19165
1 changed files with 23 additions and 6 deletions
|
@ -20,6 +20,10 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (G_OS_UNIX)
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _MidoriWebSettings
|
struct _MidoriWebSettings
|
||||||
{
|
{
|
||||||
WebKitWebSettings parent_instance;
|
WebKitWebSettings parent_instance;
|
||||||
|
@ -1029,6 +1033,24 @@ midori_web_settings_finalize (GObject* object)
|
||||||
G_OBJECT_CLASS (midori_web_settings_parent_class)->finalize (object);
|
G_OBJECT_CLASS (midori_web_settings_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (G_OS_UNIX)
|
||||||
|
static gchar*
|
||||||
|
get_sys_name (void)
|
||||||
|
{
|
||||||
|
static gchar* sys_name = NULL;
|
||||||
|
|
||||||
|
if (!sys_name)
|
||||||
|
{
|
||||||
|
struct utsname name;
|
||||||
|
if (uname (&name) != -1)
|
||||||
|
sys_name = g_strdup_printf ("%s %s", name.sysname, name.machine);
|
||||||
|
else
|
||||||
|
sys_name = "Unix";
|
||||||
|
}
|
||||||
|
return sys_name;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static gchar*
|
static gchar*
|
||||||
generate_ident_string (MidoriIdentity identify_as)
|
generate_ident_string (MidoriIdentity identify_as)
|
||||||
{
|
{
|
||||||
|
@ -1053,12 +1075,7 @@ generate_ident_string (MidoriIdentity identify_as)
|
||||||
"PPC Mac OS X";
|
"PPC Mac OS X";
|
||||||
#endif */
|
#endif */
|
||||||
#elif defined (G_OS_UNIX)
|
#elif defined (G_OS_UNIX)
|
||||||
/* struct utsname name;
|
get_sys_name ();
|
||||||
if (uname (&name) != -1)
|
|
||||||
String::format ("%s %s", name.sysname, name.machine);
|
|
||||||
else
|
|
||||||
"Unknown";*/
|
|
||||||
"Linux";
|
|
||||||
#elif defined (G_OS_WIN32)
|
#elif defined (G_OS_WIN32)
|
||||||
// FIXME: Windows NT version
|
// FIXME: Windows NT version
|
||||||
"Windows";
|
"Windows";
|
||||||
|
|
Loading…
Reference in a new issue