Fix some coding style issues in FilteredDisplay

This commit is contained in:
Vlad Zahorodnii 2021-04-05 11:25:27 +03:00
parent ba4f796e24
commit f119c9470d
2 changed files with 22 additions and 22 deletions

View file

@ -21,22 +21,22 @@ public:
FilteredDisplay *q;
static bool globalFilterCallback(const wl_client *client, const wl_global *global, void *data)
{
auto t = static_cast<FilteredDisplay::Private*>(data);
auto clientConnection = t->q->getConnection(const_cast<wl_client*>(client));
auto t = static_cast<FilteredDisplay::Private *>(data);
auto clientConnection = t->q->getConnection(const_cast<wl_client *>(client));
auto interface = wl_global_get_interface(global);
auto name = QByteArray::fromRawData(interface->name, strlen(interface->name));
return t->q->allowInterface(clientConnection, name);
};
};
FilteredDisplay::Private::Private(FilteredDisplay *_q):
q(_q)
{}
FilteredDisplay::Private::Private(FilteredDisplay *_q)
: q(_q)
{
}
FilteredDisplay::FilteredDisplay(QObject *parent):
Display(parent),
d(new Private(this))
FilteredDisplay::FilteredDisplay(QObject *parent)
: Display(parent)
, d(new Private(this))
{
connect(this, &Display::runningChanged, [this](bool running) {
if (!running) {

View file

@ -14,25 +14,25 @@ namespace KWaylandServer
{
/**
* Server Implementation that allows one to restrict which globals are available to which clients
*
* Users of this class must implement the virtual @method allowInterface method.
*/
* Server Implementation that allows one to restrict which globals are available to which clients
*
* Users of this class must implement the virtual @method allowInterface method.
*/
class KWAYLANDSERVER_EXPORT FilteredDisplay : public Display
{
Q_OBJECT
public:
FilteredDisplay(QObject *parent);
~FilteredDisplay();
~FilteredDisplay() override;
/**
* Return whether the @arg client can see the interface with the given @arg interfaceName
*
* When false will not see these globals for a given interface in the registry,
* and any manual attempts to bind will fail
*
* @return true if the client should be able to access the global with the following interfaceName
*/
/**
* Return whether the @arg client can see the interface with the given @arg interfaceName
*
* When false will not see these globals for a given interface in the registry,
* and any manual attempts to bind will fail
*
* @return true if the client should be able to access the global with the following interfaceName
*/
virtual bool allowInterface(ClientConnection *client, const QByteArray &interfaceName) = 0;
private:
class Private;