diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-10-21 13:30:47 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-10-22 06:00:16 +0200 |
commit | f129107e472c179e47b37d8fdaff120d1eccc7f8 (patch) | |
tree | 16f69650f8223ac6a6d15edf4d8581d9575f83a1 /src/plugins/canbus/vectorcan | |
parent | 80144b89ca1adede0db9d6e485037f5e431216c3 (diff) |
Avoid conflicting class names if the plugins are linked statically
QtSerialBus is already using QtSerialPort which has a WriteNotifier and
ReadNotifier class in place. Therefore it is possible that if these were
linked in together into one application that there would be multiple
instances of the same class name which caused problems as it would think
that the WriteNotifier in QtSerialPort was a QTimer and not a
QSocketNotifier. So keep the names unique to be on the safe side.
Change-Id: I8667e3d4230b316d47e266ad1b4319cf5e74444b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/canbus/vectorcan')
-rw-r--r-- | src/plugins/canbus/vectorcan/vectorcanbackend.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp index 40ba0ac..0e6d3ae 100644 --- a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp +++ b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2017 Denis Shienkov <denis.shienkov@gmail.com> ** Contact: http://www.qt.io/licensing/ @@ -103,11 +103,11 @@ QList<QCanBusDeviceInfo> VectorCanBackend::interfaces() static int driverRefCount = 0; -class ReadNotifier : public QWinEventNotifier +class VectorCanReadNotifier : public QWinEventNotifier { // no Q_OBJECT macro! public: - explicit ReadNotifier(VectorCanBackendPrivate *d, QObject *parent) + explicit VectorCanReadNotifier(VectorCanBackendPrivate *d, QObject *parent) : QWinEventNotifier(parent) , dptr(d) { @@ -128,11 +128,11 @@ private: VectorCanBackendPrivate * const dptr; }; -class WriteNotifier : public QTimer +class VectorCanWriteNotifier : public QTimer { // no Q_OBJECT macro! public: - WriteNotifier(VectorCanBackendPrivate *d, QObject *parent) + VectorCanWriteNotifier(VectorCanBackendPrivate *d, QObject *parent) : QTimer(parent) , dptr(d) { @@ -202,10 +202,10 @@ bool VectorCanBackendPrivate::open() } } - readNotifier = new ReadNotifier(this, q); + readNotifier = new VectorCanReadNotifier(this, q); readNotifier->setEnabled(true); - writeNotifier = new WriteNotifier(this, q); + writeNotifier = new VectorCanWriteNotifier(this, q); return true; } |