summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/peakcan/peakcanbackend.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-10-21 13:30:47 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-11-05 09:58:30 +0000
commitd61a13e675917349677115c920709686c62c7657 (patch)
tree26fb57832df6b5390513414007ef223db0f4c492 /src/plugins/canbus/peakcan/peakcanbackend.cpp
parentb0970e495f77e43bda85dbe267cf5c7cb7bfdf75 (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> (cherry picked from commit f129107e472c179e47b37d8fdaff120d1eccc7f8) Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/canbus/peakcan/peakcanbackend.cpp')
-rw-r--r--src/plugins/canbus/peakcan/peakcanbackend.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/canbus/peakcan/peakcanbackend.cpp b/src/plugins/canbus/peakcan/peakcanbackend.cpp
index 411223a..172de14 100644
--- a/src/plugins/canbus/peakcan/peakcanbackend.cpp
+++ b/src/plugins/canbus/peakcan/peakcanbackend.cpp
@@ -1,4 +1,4 @@
-/****************************************************************************
+/****************************************************************************
**
** Copyright (C) 2017 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2017 The Qt Company Ltd.
@@ -151,11 +151,11 @@ QList<QCanBusDeviceInfo> PeakCanBackend::interfaces()
}
#if defined(Q_OS_WIN32)
-class ReadNotifier : public QWinEventNotifier
+class PeakCanReadNotifier : public QWinEventNotifier
{
// no Q_OBJECT macro!
public:
- explicit ReadNotifier(PeakCanBackendPrivate *d, QObject *parent)
+ explicit PeakCanReadNotifier(PeakCanBackendPrivate *d, QObject *parent)
: QWinEventNotifier(parent)
, dptr(d)
{
@@ -176,11 +176,11 @@ private:
PeakCanBackendPrivate * const dptr;
};
#else
-class ReadNotifier : public QSocketNotifier
+class PeakCanReadNotifier : public QSocketNotifier
{
// no Q_OBJECT macro!
public:
- explicit ReadNotifier(PeakCanBackendPrivate *d, QObject *parent)
+ explicit PeakCanReadNotifier(PeakCanBackendPrivate *d, QObject *parent)
: QSocketNotifier(d->readHandle, QSocketNotifier::Read, parent)
, dptr(d)
{
@@ -201,11 +201,11 @@ private:
};
#endif
-class WriteNotifier : public QTimer
+class PeakCanWriteNotifier : public QTimer
{
// no Q_OBJECT macro!
public:
- WriteNotifier(PeakCanBackendPrivate *d, QObject *parent)
+ PeakCanWriteNotifier(PeakCanBackendPrivate *d, QObject *parent)
: QTimer(parent)
, dptr(d)
{
@@ -358,10 +358,10 @@ bool PeakCanBackendPrivate::open()
}
#endif
- writeNotifier = new WriteNotifier(this, q);
+ writeNotifier = new PeakCanWriteNotifier(this, q);
writeNotifier->setInterval(0);
- readNotifier = new ReadNotifier(this, q);
+ readNotifier = new PeakCanReadNotifier(this, q);
readNotifier->setEnabled(true);
isOpen = true;