From 8084eb25797b5c69445cecc05921825e49ab9644 Mon Sep 17 00:00:00 2001 From: lastik Date: Sat, 4 Apr 2009 03:33:14 +0800 Subject: - If we have localized version of gcc, we can't to know gcc version - Adding possibility of defining KDE4 in desktop environment Signed-off-by: Leandro A. F. Pereira --- hardinfo2/arch/linux/common/os.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'hardinfo2') diff --git a/hardinfo2/arch/linux/common/os.h b/hardinfo2/arch/linux/common/os.h index cb90ea12..f3c2c2d8 100644 --- a/hardinfo2/arch/linux/common/os.h +++ b/hardinfo2/arch/linux/common/os.h @@ -28,11 +28,13 @@ get_default_gcc_version(void) NULL)) { char *return_value; - if (!(return_value = strstr(buf, "gcc version "))) { + if (!(return_value = strstr(buf, "gcc "))) { goto err; } - return_value += sizeof("gcc version"); + return_value = strstr(return_value, " ") + 1; + return_value = strstr(return_value, " ") + 1; + return_value = g_strdup_printf("GNU C Compiler version %s", return_value); g_free(buf); @@ -112,7 +114,13 @@ detect_desktop_environment(OperatingSystem * os) os->desktop = g_strdup_printf("GNOME %s", vers); } else if (g_getenv("KDE_FULL_SESSION")) { - version = popen("kcontrol --version", "r"); + + if (g_getenv("KDE_SESSION_VERSION") && strstr(g_getenv("KDE_SESSION_VERSION"),(gchar *)"4")) { + version = popen("kwin --version", "r"); + } else { + version = popen("kcontrol --version", "r"); + } + if (version) { char buf[32]; -- cgit v1.2.3