Commit Graph

57 Commits

Author SHA1 Message Date
Robert Adam
59ae429972 MAINT: Update copyright notice to 2021
This was done by running scripts/updateLicenseHeaders.py and then
manually editing the LICENSE file.
2021-03-02 10:15:01 +01:00
Davide Beatrici
82bbdc86e9 REFAC(shared): Remove leftover Windows code from OSInfo::getOSDisplayableVersion()
4fc7df5dde removed the code that needed "_SYSTEM_INFO".
2021-02-23 21:15:07 +01:00
Davide Beatrici
1a74205eb4 FIX(shared): Fix "osverbose" in OSInfo not being verbose on macOS
Below are example values generated by the current code.

osver: 11.2.1 20D74
osverbose: macOS 11.2

Below are example values generated with this commit applied.

osver: 11.2.1 20D74
osverbose: macOS 11.2.1 20D74
2021-02-23 21:15:07 +01:00
Davide Beatrici
06f9c279b2 FIX(server): Don't pass unneeded values to OSInfo, rely on the ones it provides
4fc7df5dde greatly improved OSInfo, but didn't take into account that the server passes its own values to OSInfo::fillXml().

As a result, "osver" was set to the same value as "osverbose" with the architecture appended to it.

Since the function is not called often (it's for the public list registration), this commit simply removes the arguments from it.
2021-02-23 21:15:07 +01:00
Davide Beatrici
4fc7df5dde FEAT: Improve OSInfo so that architecture and OS are properly reported
This originally started as a Linux-only improvement (support for "/etc/os-release"), but it became pretty clear that OSInfo was not in a pretty state.

Please note that the auto-update system is not affected, because it doesn't rely on OSInfo.

The most important change involves the OS name.
Before this commit we had "Win32", "WinX64", "OSX" and "X11". The latter was particularly misleading now that Wayland is a thing.
We now have "Windows", "Linux", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "BSD", "UNIX" and "Unknown".

The second most important change is the way we retrieve the version on OSes other than Windows and macOS.
OSInfo had several methods, but none was aware of "/etc/os-release". We initially wanted to implement a new method, to be used as primary, that gathers info from that file.
However, we later realized we can just use QSysInfo because it does exactly what we planned to do on our own.
The reason why we're retaining our own methods for Windows and macOS is because they're MUCH more descriptive. For example, the build number is not in the strings returned by QSysInfo.
In order to make the code easier to read, the parts that handled versions of Windows we no longer support is removed.

The final change is about the info that is sent to our server.
"is64bit" was set to the correct value on all platforms except for Windows, because IsWow64Process() returns true only when the process is 32 bit and running on a 64 bit OS.
"arch" and "osarch" are introduced and represent the architecture of the program and the OS, respectively. "is64bit" is removed as it's now redundant.
"osverbose" is also introduced and represents the full operating system version.
2021-02-12 08:27:15 +01:00
Davide Beatrici
7a96dc46e6 FIX(client, server): Fix protocol version not being set correctly
27471118b5 introduced support for the 4th part (build/tweak) of the version, however:

1. It didn't replace all instances of MUMBLE_VERSION_STRING with MUMBLE_VERSION.
2. It accidentally replaced MUMBLE_VERSION_STRING with MUMBLE_RELEASE_ID in MumbleVersion::get()'s signature.
3. It didn't update the regex expression in MumbleVersion::get() to support 4 digits.

This commit fixes all issues listed above.
2021-01-13 06:18:10 +01:00
Robert
af7dac72f4 FORMAT: Run clang-format 10 on all C/CXX source-files 2020-09-11 18:29:33 +02:00
Popkornium18
f966b3ef37 REFAC(shared): replace NULL with nullptr
This changes all occurances of NULL in the src source
dir to nullptr. Additionally explicit comparisons with NULL were
removed.
2020-07-02 12:19:16 +02:00
Robert Adam
af6f24ef43 src: Fix for b263b91340
In b263b91340 I exchanged QString::sprintf
with QString::asprintf as the former was declared deprecated from Qt 5.5
onwards. I forgot to check the docs though. If I had, I would have
noticed that in contrast to sprintf, asprintf is a static function which
returns the assembled String (sprintf wrote it to the object it was
being called on). Thus I also have to assign the return value of
asprintf to a variable in order to have it have an effect.
2020-04-04 20:19:47 +02:00
Robert Adam
b263b91340 Qt: Replaced deprecated sprintf() by asprintf() for Qt 5.5 and higher
See https://stackoverflow.com/questions/12746885/why-use-asprintf-instead-of-sprintf
for a reason why sprintf() has been deprecated in favor of asprintf()
2020-02-27 15:27:45 +01:00
Davide Beatrici
4e67a2fafb Auto-update LICENSE.header in source files 2020-01-07 03:09:22 +01:00
Davide Beatrici
15831dbca8 Add missing includes for "no-pch" build
This commit adds all the missing includes when the PCH header is not used.

Also, some includes are reordered and/or made consistent (e.g. "#include <QtEndian>" -> "#include <QtCore/QtEndian>").
2019-09-12 22:08:39 +02:00
Davide Beatrici
5a07244a44 Don't include PCH headers directly
According to Qt's documentation the PCH header doesn't need to be included.

From https://doc.qt.io/qt-5/qmake-precompiledheaders.html:

"To make your project use precompiled headers, you only need to define the PRECOMPILED_HEADER variable in your project file."

"qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to include the precompiled header file in HEADERS, as qmake will do this if the configuration supports precompiled headers."
2019-09-12 00:13:35 +02:00
Davide Beatrici
b427333257 Auto-update LICENSE.header in source files 2019-01-25 04:56:19 +01:00
Mikkel Krautz
f6ba3a52bf Auto-update LICENSE.header in source files. 2018-01-01 23:05:37 +01:00
Mikkel Krautz
7ed03e686f OSInfo: ignore deprecation warnings for Gestalt.
Since we now build with a macOS target of 10.8 when
building against Qt 5.10, we get deprecation warnings
when calling gestalt.

The fix, for now, is to ignore deprecation warnings in
OSInfo on macOS.

This should be addressed in a better way in the future.
For that, mumble-voip/mumble#3290 has been filed.
2017-12-31 11:43:57 +01:00
Maxwell Cody
fef7252d1c OSInfo: Documented Solaris uname() fix. 2017-03-16 10:08:08 -05:00
Maxwell Cody
41e06528ed Fixed uname() query on Solaris. 2017-03-15 09:51:58 -05:00
Davide Beatrici
625d1ceef5 OSInfo.cpp: Fix MinGW compilation warnings
../OSInfo.cpp:74:113: warning: passing NULL to non-pointer argument 3 of 'LONG RegOpenKeyExW(HKEY, LPCWSTR, DWORD, REGSAM, PHKEY)' [-Wconversion-null]
  err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", NULL, KEY_READ, &key);
                                                                                                                 ^
../OSInfo.cpp: In static member function 'static QString OSInfo::getOSVersion()':
../OSInfo.cpp:197:135: warning: format '%d' expects argument of type 'int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
  os.sprintf("%d.%d.%d.%d", ovi.dwMajorVersion, ovi.dwMinorVersion, ovi.dwBuildNumber, (ovi.wProductType == VER_NT_WORKSTATION) ? 1 : 0);
                                                                                                                                       ^
../OSInfo.cpp:197:135: warning: format '%d' expects argument of type 'int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
../OSInfo.cpp:197:135: warning: format '%d' expects argument of type 'int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
../OSInfo.cpp: In static member function 'static QString OSInfo::getOSDisplayableVersion()':
../OSInfo.cpp:466:86: warning: format '%d' expects argument of type 'int', but argument 3 has type 'DWORD {aka long unsigned int}' [-Wformat=]
  osv.sprintf(" - %d.%d.%d", ovi.dwMajorVersion, ovi.dwMinorVersion, ovi.dwBuildNumber);
                                                                                      ^
../OSInfo.cpp:466:86: warning: format '%d' expects argument of type 'int', but argument 4 has type 'DWORD {aka long unsigned int}' [-Wformat=]
../OSInfo.cpp:466:86: warning: format '%d' expects argument of type 'int', but argument 5 has type 'DWORD {aka long unsigned int}' [-Wformat=]
2017-02-03 16:35:45 +01:00
Mikkel Krautz
91ebb8b0b5 Update tree copyrights to 2017. 2017-01-08 21:05:57 +01:00
Mikkel Krautz
d7ac6f747d OSInfo: fix implicit size_t conversion. 2016-08-24 23:52:04 +02:00
Mikkel Krautz
2df5f2f77b OSInfo: fix new Windows 10 OSInfo to not include NUL values in the displayable version string.
These strings from the registry are NUL terminated, but in practice, this
isn't guaranteed.

This means that the displayable version string for Windows 10 currently
contains NUL values.

The Mumble client doesn't care, but it isn't very nice. It breaks things
like CVP providers that don't sanitize Murmur's output.

To fix the problem, this change introduces a regString function that
converts a wchar_t string to QString. Any NUL value in the input
string will terminate the string.

Fixes mumble-voip/mumble#2469
2016-08-06 17:34:41 +02:00
Mikkel Krautz
88e664710d OSInfo: add Windows 10 displayable version string.
Fixes mumble-voip/mumble#1916
2016-07-20 23:37:08 +02:00
Mikkel Krautz
395c084b7a src: update to use LICENSE.header. 2016-05-10 22:42:02 +02:00
Mikkel Krautz
0502fa67b0 Drop OS X specific '64-bit' check.
QSysInfo::WordSize == 64 seems good enough for us.
2016-04-17 23:00:09 +02:00
Mikkel Krautz
72ef9026fa Add build number to OS X OSInfo.
This change also removes the architecture
from the OSInfo string, since it is noisy.

The old code would always emit "i386", seemingly
since that's the "lowest" fatch arch that the current
OS X x86_64 kernels will run binaries from.

I tried to update the code, but instead of x86_64, I
got "x86_64h", which is Apple's arch string for
Haswell chips.

I don't think it makes sense anymore to have the
architecture string in the OSInfo on OS X. All
Macs running the modern OSes are x86_64 anyway.

Fixes mumble-voip/mumble#1341
2016-04-17 22:59:52 +02:00
Mikkel Krautz
9dba18fcca OSInfo: fix OS X version string formatting build error.
Cast the version components to unsigned long and print
them as %lu.
2015-11-15 19:21:04 +01:00
Joël Troch
122ed92620 OSInfo: update Windows 10 detection due to kernel version change. 2015-03-18 19:39:38 +01:00
Joël Troch
236e987482 Added Windows 10 in OS detection and manifest file.
The official name for the server version of Windows 10
is "Windows 10 Server Technical Preview" but since
"Technical Preview" is a detail, I haven't included it.

Closes #1435
2014-10-30 22:15:41 +01:00
Mikkel Krautz
6d962818a2 OSInfo: use 'WinX64' as the OS identifier for Windows/amd64 builds.
The OS string from OSInfo is used in places such as log files, and
in the Server Info and User Info dialogs.

I think it'll be beneficial in the long run to be able to
distinguish an x86 build from an amd64 on in these places.

Technically, the full OSInfo dump has an is64bit flag, but it's not
visible in the aforementioned places - only the OS string is. The
isb64bit flag is only used when submitting usage stats.
2014-07-15 23:30:57 +02:00
Mikkel Krautz
1d0b1c86d4 OSInfo: fix display of Windows service packs in getOSDisplayableVersion.
I botched this when I did a few fix-ups while merging.
2014-01-11 11:39:39 +01:00
Zuko
8f0ae691cc OSInfo: use full Windows version when version string is user-facing.
This adds a new method, OSInfo::getOSDisplayableVersion(),
which returns a version string that is suitable for displaying
to regular users.

Furthermore, Mumble's User Information dialog and Murmur have been
modified to use this new method when displaying OS version strings
to users.

On Windows, the new method returns the full product version of the
OS, such as "Windows 8 Pro" (as opposed to 6.2.9200, which is the
equivalent result of the getOSVersion() method).

There are places in Mumble where the original "simple" version
string is required for compatibility or aesthetic reasons, such
as statistics and Mumble's HTTP user agent. Those places keep
the older version (by keeping their calls to the original
getOSVersion() instead of switching to the "displayable" variant).

It might seem overkill to jump through hoops to be able to show the
full product version, but it can be helpful for, say, server admins
to have access to the full product version if they need to
troubleshoot issues with their users.
2014-01-11 03:11:19 +01:00
Stefan Hacker
2c892feecf Fix various compiler warnings with VS2010 2013-10-23 19:32:07 +02:00
Mikkel Krautz
5cb337049b mumble, murmur: Qt 5 support for Linux. 2013-06-29 16:56:41 +02:00
Benjamin Jemlich
07737a314c Fix include guards and PCH includes 2011-11-09 00:12:10 +01:00
Thorvald Natvig
f3437a6ba7 Update copyright year ranges of dev team. 2011-03-18 05:52:51 +01:00
Benjamin Jemlich
079f1ad219 Remove local variable in getOSVersion 2010-12-04 20:02:57 +01:00
Mikkel Krautz
f1a0740459 Report bIs64 for OSX. The arch info stuff returns the arch of the kernel, which is almost always i386. 2010-08-30 10:39:41 +02:00
Stefan Hacker
cb8ddcf0d2 Fix compile errors 2010-08-21 18:06:39 +02:00
Thorvald Natvig
39b5228ce3 Indent, changelog, submodule and language update 2010-08-17 22:28:56 +02:00
Thorvald Natvig
f6a3e82cc7 Add cpu type and SSE2 state to usage stats 2010-08-17 22:16:46 +02:00
Thorvald Natvig
1c79299230 Indent, changelog, submodule and language update 2010-02-23 16:16:44 +01:00
Thorvald Natvig
58cbf0ec8f Hopefully fix a compilebug I introduced on OSX 2010-02-11 16:05:37 +01:00
Thorvald Natvig
91cf6c76ad Pipeline http fetch and set user-agent 2010-02-11 15:26:48 +01:00
Thorvald Natvig
16339bfc91 Update license to 2010 2010-01-05 08:49:22 +01:00
Thorvald Natvig
3976433cc7 Multibind for nix 2009-06-22 20:01:44 +02:00
Mikkel Krautz
dbb0eb26cd Fix header mess on Mac OS X. 2009-03-13 13:02:17 +01:00
Thorvald Natvig
e68d92085c Be kinder to systems without working lsb_release
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1530 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-02-14 01:10:00 +00:00
Thorvald Natvig
a0c96713dc Indenting fixes
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1482 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-28 17:51:09 +00:00
Thorvald Natvig
9ccba72bee More consistently pick the same interface
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1470 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-22 22:17:18 +00:00