summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/systeminfo.cpp
blob: 6a1976c4afecfd9c3269ecc7a4710cacd22f179e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/**************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
**************************************************************************/

#include "systeminfo.h"
#include <QSysInfo>

namespace QInstaller {

/*!
    \inmodule QtInstallerFramework
    \class QInstaller::SystemInfo

    \brief Provides information about the operating system.
*/

/*!
    Creates a system info object with the parent \a parent.
*/
SystemInfo::SystemInfo(QObject *parent) : QObject(parent)
{
}


/*!
    \property SystemInfo::currentCpuArchitecture

    The architecture of the CPU that the application is running on, in text format.

    Possible values include:
    \list
        \li "i386"
        \li "x86_64"
    \endlist

    \note This function depends on what the OS will report and may not detect the actual CPU
    architecture if the OS hides that information or is unable to provide it. For example, a 32-bit
    OS running on a 64-bit CPU is usually unable to determine whether the CPU is actually capable
    of running 64-bit programs.

    \sa QSysInfo::currentCpuArchitecture()
*/
QString SystemInfo::currentCpuArchitecture() const
{
    return QSysInfo::currentCpuArchitecture();
}

/*!
    \property SystemInfo::kernelType

    The type of the operating system kernel the installer was compiled for. It is also the
    kernel the installer is running on, unless the host operating system is running a form of
    compatibility or virtualization layer.

    For Windows, Linux, and macOS this will return:
    \list
        \li "winnt"
        \li "linux"
        \li "darwin"
    \endlist

    On Unix systems, it returns the same as the output of \c {uname -s} (lowercased).

    \sa QSysInfo::kernelType()
*/
QString SystemInfo::kernelType() const
{
    return QSysInfo::kernelType();
}

/*!
    \property SystemInfo::kernelVersion

    The release version of the operating system kernel. On Windows, it returns the version of the
    NT or CE kernel. On Unix systems, including macOS, it returns the same as the \c {uname -r}
    command would return.

    Example values are:

    \list
        \li "6.1.7601" for Windows 7 with Service Pack 1
        \li "3.16.6-2-desktop" for openSUSE 13.2 kernel 3.16.6-2
        \li "12.5.0" last release of OS X "Mountain Lion"
    \endlist

    \sa QSysInfo::kernelVersion()
*/
QString SystemInfo::kernelVersion() const
{
    return QSysInfo::kernelVersion();
}

/*!
    \property SystemInfo::productType

    The product name of the operating system this application is running in.

    Example values are:

    \list
        \li "windows"
        \li "opensuse" (for the Linux openSUSE distribution)
        \li "osx"
    \endlist

    \sa QSysInfo::productType()
*/
QString SystemInfo::productType() const
{
    return QSysInfo::productType();
}

/*!
    \property SystemInfo::productVersion

    The product version of the operating system in string form. If the version could not be
    determined, this function returns "unknown".

    Example values are:

    \list
        \li "7" for Windows 7
        \li "13.2" for openSUSE 13.2
        \li "10.8" for OS X Mountain Lion
    \endlist

    \sa QSysInfo::productVersion()
*/
QString SystemInfo::productVersion() const
{
    return QSysInfo::productVersion();
}

/*!
    \property SystemInfo::prettyProductName

    A prettier form of SystemInfo::productType and SystemInfo::productVersion, containing other
    tokens like the operating system type, codenames and other information. The result of this
    function is suitable for displaying to the user.

    Example values are:

    \list
        \li "Windows 7"
        \li "openSUSE 13.2 (Harlequin) (x86_64)"
        \li "OS X Mountain Lion (10.8)"
    \endlist


    \sa QSysInfo::prettyProductName()
*/
QString SystemInfo::prettyProductName() const
{
    return QSysInfo::prettyProductName();
}

} // namespace QInstaller