Skip to content

Commit

Permalink
Resolve duplicate symbols
Browse files Browse the repository at this point in the history
Turn some of the static variables into private static data members to
avoid symbol duplication during the unity build.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I9e3ee18f6e85a0f806de77f753d89a45ceaff7ac
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
amirmasoudabdol committed Apr 19, 2023
1 parent c2fd824 commit 22b0ed0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

QT_BEGIN_NAMESPACE

static const char *ppsPath = "/pps/system/buttons/status";
static const int ppsBufferSize = 256;
const char *QQnxButtonEventNotifier::ppsPath = "/pps/system/buttons/status";
const size_t QQnxButtonEventNotifier::ppsBufferSize = 256;

QQnxButtonEventNotifier::QQnxButtonEventNotifier(QObject *parent)
: QObject(parent),
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/platforms/qnx/qqnxbuttoneventnotifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ private Q_SLOTS:
QSocketNotifier *m_readNotifier;
ButtonState m_state[ButtonCount];
QList<QByteArray> m_buttonKeys;

static const char *ppsPath;
static const size_t ppsBufferSize;
};

QT_END_NAMESPACE
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#define qNavigatorEventNotifierDebug QT_NO_QDEBUG_MACRO
#endif

static const char *navigatorControlPath = "/pps/services/navigator/control";
static const int ppsBufferSize = 4096;

QT_BEGIN_NAMESPACE

const char *QQnxNavigatorEventNotifier::navigatorControlPath = "/pps/services/navigator/control";
const size_t QQnxNavigatorEventNotifier::ppsBufferSize = 4096;

QQnxNavigatorEventNotifier::QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent)
: QObject(parent),
m_fd(-1),
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ private Q_SLOTS:
int m_fd;
QSocketNotifier *m_readNotifier;
QQnxNavigatorEventHandler *m_eventHandler;

static const char *navigatorControlPath;
static const size_t ppsBufferSize;
};

QT_END_NAMESPACE
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/platforms/qnx/qqnxnavigatorpps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#define qNavigatorDebug QT_NO_QDEBUG_MACRO
#endif

static const char *navigatorControlPath = "/pps/services/navigator/control";
static const int ppsBufferSize = 4096;

QT_BEGIN_NAMESPACE

const char *QQnxNavigatorPps::navigatorControlPath = "/pps/services/navigator/control";
const size_t QQnxNavigatorPps::ppsBufferSize = 4096;

QQnxNavigatorPps::QQnxNavigatorPps(QObject *parent)
: QQnxAbstractNavigator(parent)
, m_fd(-1)
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/platforms/qnx/qqnxnavigatorpps.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class QQnxNavigatorPps : public QQnxAbstractNavigator
bool sendPpsMessage(const QByteArray &message, const QByteArray &data);
void parsePPS(const QByteArray &ppsData, QHash<QByteArray, QByteArray> &messageFields);

private:
int m_fd;
static const char *navigatorControlPath;
static const size_t ppsBufferSize;
};

QT_END_NAMESPACE
Expand Down

0 comments on commit 22b0ed0

Please sign in to comment.