Rename AT-SPI specific DBusConnection type to fix clang warnings
DBusConnection is forward declared as a class, and after c9e62c24440e99ace02dcceffea2ae6542f49224 we include a header that forward declares it as a struct. This triggers a warning, and also indicates that we have an ODR violation. Rename the offending type in Qt. Fixes: QTBUG-125623 Change-Id: I13ffdceec82b86910a60083aebc2afc47f9f3a4e Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
parent
f09f70fcdf
commit
fc96d9d27d
@ -49,7 +49,7 @@ using namespace Qt::StringLiterals;
|
|||||||
Q_LOGGING_CATEGORY(lcAccessibilityAtspi, "qt.accessibility.atspi")
|
Q_LOGGING_CATEGORY(lcAccessibilityAtspi, "qt.accessibility.atspi")
|
||||||
Q_LOGGING_CATEGORY(lcAccessibilityAtspiCreation, "qt.accessibility.atspi.creation")
|
Q_LOGGING_CATEGORY(lcAccessibilityAtspiCreation, "qt.accessibility.atspi.creation")
|
||||||
|
|
||||||
AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)
|
AtSpiAdaptor::AtSpiAdaptor(QAtSpiDBusConnection *connection, QObject *parent)
|
||||||
: QDBusVirtualObject(parent), m_dbus(connection)
|
: QDBusVirtualObject(parent), m_dbus(connection)
|
||||||
, sendFocus(0)
|
, sendFocus(0)
|
||||||
, sendObject(0)
|
, sendObject(0)
|
||||||
|
@ -38,7 +38,7 @@ class AtSpiAdaptor :public QDBusVirtualObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AtSpiAdaptor(DBusConnection *connection, QObject *parent = nullptr);
|
explicit AtSpiAdaptor(QAtSpiDBusConnection *connection, QObject *parent = nullptr);
|
||||||
~AtSpiAdaptor();
|
~AtSpiAdaptor();
|
||||||
|
|
||||||
void registerApplication();
|
void registerApplication();
|
||||||
@ -114,7 +114,7 @@ private:
|
|||||||
|
|
||||||
// private vars
|
// private vars
|
||||||
QSpiObjectReference accessibilityRegistry;
|
QSpiObjectReference accessibilityRegistry;
|
||||||
DBusConnection *m_dbus;
|
QAtSpiDBusConnection *m_dbus;
|
||||||
QSpiApplicationAdaptor *m_applicationAdaptor;
|
QSpiApplicationAdaptor *m_applicationAdaptor;
|
||||||
|
|
||||||
/// Assigned from the accessibility registry.
|
/// Assigned from the accessibility registry.
|
||||||
|
@ -26,13 +26,13 @@ using namespace Qt::StringLiterals;
|
|||||||
#define A11Y_PATH "/org/a11y/bus"_L1
|
#define A11Y_PATH "/org/a11y/bus"_L1
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class DBusConnection
|
\class QAtSpiDBusConnection
|
||||||
\internal
|
\internal
|
||||||
\brief Connects to the accessibility dbus.
|
\brief Connects to the accessibility dbus.
|
||||||
|
|
||||||
This is usually a different bus from the session bus.
|
This is usually a different bus from the session bus.
|
||||||
*/
|
*/
|
||||||
DBusConnection::DBusConnection(QObject *parent)
|
QAtSpiDBusConnection::QAtSpiDBusConnection(QObject *parent)
|
||||||
: QObject(parent), m_a11yConnection(QString()), m_enabled(false)
|
: QObject(parent), m_a11yConnection(QString()), m_enabled(false)
|
||||||
{
|
{
|
||||||
// If the bus is explicitly set via env var it overrides everything else.
|
// If the bus is explicitly set via env var it overrides everything else.
|
||||||
@ -66,7 +66,7 @@ DBusConnection::DBusConnection(QObject *parent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DBusConnection::getAddressFromXCB()
|
QString QAtSpiDBusConnection::getAddressFromXCB()
|
||||||
{
|
{
|
||||||
QGuiApplication *app = qobject_cast<QGuiApplication *>(QCoreApplication::instance());
|
QGuiApplication *app = qobject_cast<QGuiApplication *>(QCoreApplication::instance());
|
||||||
if (!app)
|
if (!app)
|
||||||
@ -85,7 +85,7 @@ QString DBusConnection::getAddressFromXCB()
|
|||||||
// We have the a11y registry on the session bus.
|
// We have the a11y registry on the session bus.
|
||||||
// Subscribe to updates about a11y enabled state.
|
// Subscribe to updates about a11y enabled state.
|
||||||
// Find out the bus address
|
// Find out the bus address
|
||||||
void DBusConnection::serviceRegistered()
|
void QAtSpiDBusConnection::serviceRegistered()
|
||||||
{
|
{
|
||||||
// listen to enabled changes
|
// listen to enabled changes
|
||||||
QDBusConnection c = QDBusConnection::sessionBus();
|
QDBusConnection c = QDBusConnection::sessionBus();
|
||||||
@ -113,12 +113,12 @@ void DBusConnection::serviceRegistered()
|
|||||||
// connect(a11yStatus, ); QtDbus doesn't support notifications for property changes yet
|
// connect(a11yStatus, ); QtDbus doesn't support notifications for property changes yet
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBusConnection::serviceUnregistered()
|
void QAtSpiDBusConnection::serviceUnregistered()
|
||||||
{
|
{
|
||||||
emit enabledChanged(false);
|
emit enabledChanged(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBusConnection::connectA11yBus(const QString &address)
|
void QAtSpiDBusConnection::connectA11yBus(const QString &address)
|
||||||
{
|
{
|
||||||
if (address.isEmpty()) {
|
if (address.isEmpty()) {
|
||||||
qWarning("Could not find Accessibility DBus address.");
|
qWarning("Could not find Accessibility DBus address.");
|
||||||
@ -130,7 +130,7 @@ void DBusConnection::connectA11yBus(const QString &address)
|
|||||||
emit enabledChanged(true);
|
emit enabledChanged(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBusConnection::dbusError(const QDBusError &error)
|
void QAtSpiDBusConnection::dbusError(const QDBusError &error)
|
||||||
{
|
{
|
||||||
qWarning() << "Accessibility encountered a DBus error:" << error;
|
qWarning() << "Accessibility encountered a DBus error:" << error;
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ void DBusConnection::dbusError(const QDBusError &error)
|
|||||||
Returns the DBus connection that got established.
|
Returns the DBus connection that got established.
|
||||||
Or an invalid connection if not yet connected.
|
Or an invalid connection if not yet connected.
|
||||||
*/
|
*/
|
||||||
QDBusConnection DBusConnection::connection() const
|
QDBusConnection QAtSpiDBusConnection::connection() const
|
||||||
{
|
{
|
||||||
return m_a11yConnection;
|
return m_a11yConnection;
|
||||||
}
|
}
|
||||||
|
@ -27,12 +27,12 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QDBusServiceWatcher;
|
class QDBusServiceWatcher;
|
||||||
|
|
||||||
class DBusConnection : public QObject
|
class QAtSpiDBusConnection : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DBusConnection(QObject *parent = nullptr);
|
QAtSpiDBusConnection(QObject *parent = nullptr);
|
||||||
QDBusConnection connection() const;
|
QDBusConnection connection() const;
|
||||||
bool isEnabled() const { return m_enabled; }
|
bool isEnabled() const { return m_enabled; }
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ using namespace Qt::StringLiterals;
|
|||||||
QSpiAccessibleBridge::QSpiAccessibleBridge()
|
QSpiAccessibleBridge::QSpiAccessibleBridge()
|
||||||
: cache(nullptr), dec(nullptr), dbusAdaptor(nullptr)
|
: cache(nullptr), dec(nullptr), dbusAdaptor(nullptr)
|
||||||
{
|
{
|
||||||
dbusConnection = new DBusConnection();
|
dbusConnection = new QAtSpiDBusConnection();
|
||||||
connect(dbusConnection, SIGNAL(enabledChanged(bool)), this, SLOT(enabledChanged(bool)));
|
connect(dbusConnection, SIGNAL(enabledChanged(bool)), this, SLOT(enabledChanged(bool)));
|
||||||
// Now that we have connected the signal, make sure we didn't miss a change,
|
// Now that we have connected the signal, make sure we didn't miss a change,
|
||||||
// e.g. when running as root or when AT_SPI_BUS_ADDRESS is set by hand.
|
// e.g. when running as root or when AT_SPI_BUS_ADDRESS is set by hand.
|
||||||
|
@ -27,7 +27,7 @@ QT_REQUIRE_CONFIG(accessibility);
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class DBusConnection;
|
class QAtSpiDBusConnection;
|
||||||
class QSpiDBusCache;
|
class QSpiDBusCache;
|
||||||
class AtSpiAdaptor;
|
class AtSpiAdaptor;
|
||||||
struct RoleNames;
|
struct RoleNames;
|
||||||
@ -60,7 +60,7 @@ private:
|
|||||||
QSpiDBusCache *cache;
|
QSpiDBusCache *cache;
|
||||||
DeviceEventControllerAdaptor *dec;
|
DeviceEventControllerAdaptor *dec;
|
||||||
AtSpiAdaptor *dbusAdaptor;
|
AtSpiAdaptor *dbusAdaptor;
|
||||||
DBusConnection* dbusConnection;
|
QAtSpiDBusConnection* dbusConnection;
|
||||||
SpiRoleMapping m_spiRoleMapping;
|
SpiRoleMapping m_spiRoleMapping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user