aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/arch/linux/common/os.h
diff options
context:
space:
mode:
authorlastik <lastik@lastik.(none)>2009-04-04 03:33:14 +0800
committerLeandro A. F. Pereira <leandro@hardinfo.org>2009-04-05 00:55:02 +0800
commit8084eb25797b5c69445cecc05921825e49ab9644 (patch)
tree0861c34e3e0b11d7aad7d627c0203833125aa742 /hardinfo2/arch/linux/common/os.h
parent8efe26e8d80b234c7d1083e6adbb8229a9e4d12d (diff)
- 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 <leandro@hardinfo.org>
Diffstat (limited to 'hardinfo2/arch/linux/common/os.h')
-rw-r--r--hardinfo2/arch/linux/common/os.h14
1 files changed, 11 insertions, 3 deletions
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];