annotate src/UiGuiSystemInfo.cpp @ 768:f3631db17328

Updated all date occurrences to the year 2011. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1045 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Thu, 21 Apr 2011 15:17:51 +0000
parents aae5a8d04f70
children fa7aa6f543f1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
1 /***************************************************************************
768
f3631db17328 Updated all date occurrences to the year 2011.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 727
diff changeset
2 * Copyright (C) 2006-2011 by Thomas Schweitzer *
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
3 * thomas-schweitzer(at)arcor.de *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
4 * *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
6 * it under the terms of the GNU General Public License version 2.0 as *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
7 * published by the Free Software Foundation. *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
8 * *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful, *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
12 * GNU General Public License for more details. *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
13 * *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
15 * along with this program in the file LICENSE.GPL; if not, write to the *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
16 * Free Software Foundation, Inc., *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
18 ***************************************************************************/
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
19
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
20 #include "UiGuiSystemInfo.h"
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
21
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
22 #include <QString>
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
23 #include <QSysInfo>
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
24 #include <QProcess>
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
25 #include <QFile>
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
26
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
27 UiGuiSystemInfo::UiGuiSystemInfo() {
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
28 }
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
29
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
30
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
31 /*!
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
32 \brief Returns the operating system UiGUI is currently running on as one string.
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
33
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
34 The String contains name and version of the os. E.g. Linux Ubuntu 9.04.
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
35 */
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
36 QString UiGuiSystemInfo::getOperatingSystem() {
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
37 QString operatingSystemString = "";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
38
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
39 #if defined(Q_WS_WIN)
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
40 switch ( QSysInfo::WindowsVersion ) {
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
41 case QSysInfo::WV_32s :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
42 operatingSystemString = "Windows 3.1 with Win 32s";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
43 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
44 case QSysInfo::WV_95 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
45 operatingSystemString = "Windows 95";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
46 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
47 case QSysInfo::WV_98 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
48 operatingSystemString = "Windows 98";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
49 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
50 case QSysInfo::WV_Me :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
51 operatingSystemString = "Windows Me";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
52 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
53 case QSysInfo::WV_NT :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
54 operatingSystemString = "Windows NT (operating system version 4.0)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
55 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
56 case QSysInfo::WV_2000 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
57 operatingSystemString = "Windows 2000 (operating system version 5.0)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
58 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
59 case QSysInfo::WV_XP :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
60 operatingSystemString = "Windows XP (operating system version 5.1)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
61 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
62 case QSysInfo::WV_2003 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
63 operatingSystemString = "Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
64 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
65 case QSysInfo::WV_VISTA :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
66 operatingSystemString = "Windows Vista, Windows Server 2008 (operating system version 6.0)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
67 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
68 case QSysInfo::WV_WINDOWS7 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
69 operatingSystemString = "Windows 7 (operating system version 6.1)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
70 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
71 case QSysInfo::WV_CE :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
72 operatingSystemString = "Windows CE";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
73 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
74 case QSysInfo::WV_CENET :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
75 operatingSystemString = "Windows CE .NET";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
76 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
77 case QSysInfo::WV_CE_5 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
78 operatingSystemString = "Windows CE 5.x";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
79 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
80 case QSysInfo::WV_CE_6 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
81 operatingSystemString = "Windows CE 6.x";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
82 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
83 default :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
84 operatingSystemString = "Unknown Windows operating system.";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
85 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
86 }
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
87 #elif defined(Q_WS_MAC)
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
88 switch ( QSysInfo::MacintoshVersion ) {
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
89 case QSysInfo::MV_9 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
90 operatingSystemString = "Mac OS 9 (unsupported)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
91 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
92 case QSysInfo::MV_10_0 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
93 operatingSystemString = "Mac OS X 10.0 Cheetah (unsupported)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
94 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
95 case QSysInfo::MV_10_1 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
96 operatingSystemString = "Mac OS X 10.1 Puma (unsupported)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
97 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
98 case QSysInfo::MV_10_2 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
99 operatingSystemString = "Mac OS X 10.2 Jaguar (unsupported)";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
100 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
101 case QSysInfo::MV_10_3 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
102 operatingSystemString = "Mac OS X 10.3 Panther";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
103 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
104 case QSysInfo::MV_10_4 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
105 operatingSystemString = "Mac OS X 10.4 Tiger";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
106 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
107 case QSysInfo::MV_10_5 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
108 operatingSystemString = "Mac OS X 10.5 Leopard";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
109 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
110 case QSysInfo::MV_10_6 :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
111 operatingSystemString = "Mac OS X 10.6 Snow Leopard";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
112 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
113 case QSysInfo::MV_Unknown :
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
114 operatingSystemString = "An unknown and currently unsupported platform";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
115 break;
714
3363b7bb0d41 Once more let Uncrustify reformat my code.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 697
diff changeset
116 default :
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
117 operatingSystemString = "Unknown Mac operating system.";
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
118 break;
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
119 }
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
120 #else
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
121 //TODO: Detect Unix, Linux etc. distro as described on http://www.novell.com/coolsolutions/feature/11251.html
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
122 operatingSystemString = "Linux";
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
123 QProcess process;
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
124
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
125 process.start("uname -s");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
126 bool result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
127 QString os = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
128
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
129 process.start("uname -r");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
130 result = process.waitForFinished(1000);
694
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
131 QString rev = process.readAllStandardOutput().trimmed();
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
132
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
133 process.start("uname -m");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
134 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
135 QString mach = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
136
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
137 if ( os == "SunOS" ) {
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
138 os = "Solaris";
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
139
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
140 process.start("uname -p");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
141 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
142 QString arch = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
143
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
144 process.start("uname -v");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
145 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
146 QString timestamp = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
147
694
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
148 operatingSystemString = os + " " + rev + " (" + arch + " " + timestamp + ")";
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
149 }
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
150 else if ( os == "AIX" ) {
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
151 process.start("oslevel -r");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
152 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
153 QString oslevel = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
154
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
155 operatingSystemString = os + "oslevel " + oslevel;
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
156 }
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
157 else if ( os == "Linux" ) {
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
158 QString dist;
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
159 QString pseudoname;
697
1f787d19e5c9 For Linux systems the kernel version wasn't included in the system info
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 695
diff changeset
160 QString kernel = rev;
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
161
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
162 if ( QFile::exists("/etc/redhat-release") ) {
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
163 dist = "RedHat";
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
164
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
165 process.start("sh -c \"cat /etc/redhat-release | sed s/.*\\(// | sed s/\\)//\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
166 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
167 pseudoname = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
168
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
169 process.start("sh -c \"cat /etc/redhat-release | sed s/.*release\\ // | sed s/\\ .*//\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
170 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
171 rev = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
172 }
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
173 else if ( QFile::exists("/etc/SUSE-release") ) {
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
174 process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' '| sed s/VERSION.*//\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
175 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
176 dist = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
177
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
178 process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' ' | sed s/.*=\\ //\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
179 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
180 rev = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
181 }
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
182 else if ( QFile::exists("/etc/mandrake-release") ) {
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
183 dist = "Mandrake";
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
184
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
185 process.start("sh -c \"cat /etc/mandrake-release | sed s/.*\\(// | sed s/\\)//\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
186 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
187 pseudoname = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
188
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
189 process.start("sh -c \"cat /etc/mandrake-release | sed s/.*release\\ // | sed s/\\ .*//\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
190 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
191 rev = process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
192 }
694
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
193 else if ( QFile::exists("/etc/lsb-release") ) {
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
194 dist = "Ubuntu";
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
195
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
196 QString processCall = "sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_RELEASE=// | sed s/\\ .*//\"";
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
197 process.start( processCall );
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
198 result = process.waitForFinished(1000);
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
199 rev = process.readAllStandardOutput().trimmed();
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
200 QString errorStr = process.readAllStandardError();
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
201
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
202 process.start("sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_CODENAME=// | sed s/\\ .*//\"");
694
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
203 result = process.waitForFinished(1000);
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
204 pseudoname = process.readAllStandardOutput().trimmed();
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
205 }
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
206 else if ( QFile::exists("/etc/debian_version") ) {
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
207 dist = "Debian";
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
208
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
209 process.start("cat /etc/debian_version");
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
210 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
211 dist += process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
212
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
213 rev = "";
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
214 }
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
215
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
216 if ( QFile::exists("/etc/UnitedLinux-release") ) {
695
82fb41ed0bfa Completed detection of Ubuntu distro.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 694
diff changeset
217 process.start("sh -c \"cat /etc/UnitedLinux-release | tr '\\n' ' ' | sed s/VERSION.*//\"");
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
218 result = process.waitForFinished(1000);
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
219 dist += process.readAllStandardOutput().trimmed();
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
220 }
694
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
221
3ddadbeaebf1 Added Ubuntu detection partly and corrected return value.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 693
diff changeset
222 operatingSystemString = os + " " + dist + " " + rev + " (" + pseudoname + " " + kernel + " " + mach + ")";
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
223 }
692
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
224 #endif
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
225
e3ff3c85d271 Added a class for retrieving info about the operating system and use this for logging info.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff changeset
226 return operatingSystemString;
693
84f5e9e9c297 In most parts implemented the distribution detection as described on the Novell web site.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents: 692
diff changeset
227 }