We already log to Windows's debug log, but this is a little more
accessible for regular users and developers alike. (Sometimes, you don't
have DebugView handy...)
This commit removes MumbleHWNDForQWidget -- the only user of
private Qt API in Mumble on Windows.
It is replaced with a variable, mumble_hw_hwnd, which gets
filled out in main.cpp just after creating MainWindow.
Most MumbleHWNDForQWidget() uses were for g.mw, so the change
makes sense. The ones that weren't have been changed to use it,
or removed. Most of the removed instances are g.ocIntercept-related,
which is already broken beyond repair in Qt 5.
Qt 5.3 introduced a feature where it'll automatically fill out QTPLUGIN
with appropriate auto-detected plugins for TEMPLATE=app.
This commit avoids adding entries to QTPLUGIN if we detect we're on a
Qt version that automatically fills out QTPLUGIN.
For Windows static builds, we don't use TEMPLATE=app, so for that
platform, we have to fill out QTPLUGIN in any case.
This introduces a new variable, QT_VERSION_INT, which allows
qmake files to more easily do Qt version checks.
Previosly, code would chain greaterThan/equals/lessThan with
logical ands for QT_MAJOR_VERSION and QT_MINOR_VERSION.
That worked OK, but was a little verbose, and is inconvenient
if you want to use a QT_VERSION check alongside other conditions
in a conditional.
The QT_VERSION_INT is a string variable is of the form:
Qt 5.0.0: 50000
Qt 5.6.1: 50601
it is base 10, and can be used with qmake's comparison operators
like so:
greaterThan(QT_VERSION_INT, 50600) {
// Do stuff for Qt > 5.6
}
This commit also removes our own copies of QT_MAJOR_VERSION
and QT_MINOR_VERSION. These are provided by mkspecs/qconfig.pri,
and have been since (at least) Qt 4. So they're already available.
We don't need to provide them. Our method of fetching them was also
buggy due to Qt 4 compatibility - so that's fixed now.
Qt expects to be able to write NUL bytes in strings
serialized via QSettings. macOS Sierra broke this.
We've since backported a fix from Qt master into
our buildenv, and the bug is fixed.
This commit adds a workaround for users whose clients
have already written 'bad' config files on macOS.
If a bad config value is detected, it is skipped and
the default is used instead.
QSharedPointer is thread-safe and atomic, while boost::shared_ptr isn't.
For some audio systems, this is necessary for proper implementation (for
example, an audio system where AudioOutput runs the show, and AudioInput
is simply 'fed' data from AudioOutput -- like my upcoming 'sndio' backend).
Most of this commit is straight-forward. Most of the change is simply
renaming the types and fixing up uses of boost::shared_ptr::get() to
use QSharedPointer::data() instead. Some places also use operator bool()
now. For Qt 4 compatibility, we also no longer use the restet method of
the shared pointer, instead preferring clear() which is available in both
Qt 4 and Qt 5.
In Audio.cpp, in stop(), stopInput() and stopOutput(), the
boost::shared_ptr-based code used the unique() method on
boost::shared_ptr. That doesn't exist for QSharedPointer,
so we emulate the old behavior by keeping a QWeakPointer to
the object around. Once the weak pointer is no longer valid,
we know the AudioInput/AudioOutput object has been fully
destroyed.