QWaylandDisplay: make hasRegistryGlobal() const-correct and take a QStringView
Also port a Q_FOREACH loop to C++11 ranged-for. Change-Id: Ifde232a00e6abed285efaf146a48521c7df25378 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
parent
72cae9c58c
commit
6b761b7448
@ -386,9 +386,9 @@ void QWaylandDisplay::registry_global_remove(uint32_t id)
|
||||
}
|
||||
}
|
||||
|
||||
bool QWaylandDisplay::hasRegistryGlobal(const QString &interfaceName)
|
||||
bool QWaylandDisplay::hasRegistryGlobal(QStringView interfaceName) const
|
||||
{
|
||||
Q_FOREACH (const RegistryGlobal &global, mGlobals)
|
||||
for (const RegistryGlobal &global : mGlobals)
|
||||
if (global.interface == interfaceName)
|
||||
return true;
|
||||
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
: id(id_), interface(interface_), version(version_), registry(registry_) { }
|
||||
};
|
||||
QList<RegistryGlobal> globals() const { return mGlobals; }
|
||||
bool hasRegistryGlobal(const QString &interfaceName);
|
||||
bool hasRegistryGlobal(QStringView interfaceName) const;
|
||||
|
||||
/* wl_registry_add_listener does not add but rather sets a listener, so this function is used
|
||||
* to enable many listeners at once. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user