Remove client credentials from ShellSurface

It's now part of ClientConnection, where it makes more sense.

This allowed to make Resource::Private::create non-virtual.
This commit is contained in:
Martin Gräßlin 2014-11-19 16:57:12 +01:00
parent c71cf3999c
commit 14d052d9d1
3 changed files with 1 additions and 31 deletions

View file

@ -33,7 +33,7 @@ class Resource::Private
{
public:
virtual ~Private();
virtual void create(ClientConnection *client, quint32 version, quint32 id);
void create(ClientConnection *client, quint32 version, quint32 id);
wl_resource *resource = nullptr;
ClientConnection *client = nullptr;

View file

@ -66,15 +66,11 @@ class ShellSurfaceInterface::Private : public Resource::Private
{
public:
Private(ShellSurfaceInterface *q, ShellInterface *shell, SurfaceInterface *surface);
void create(ClientConnection *client, quint32 version, quint32 id) override;
void setFullscreen(bool fullscreen);
void setToplevel(bool toplevel);
void ping();
SurfaceInterface *surface;
pid_t clientPid = 0;
uid_t clientUser = 0;
gid_t clientGroup = 0;
QString title;
QByteArray windowClass;
QScopedPointer<QTimer> pingTimer;
@ -206,12 +202,6 @@ ShellSurfaceInterface::ShellSurfaceInterface(ShellInterface *shell, SurfaceInter
ShellSurfaceInterface::~ShellSurfaceInterface() = default;
void ShellSurfaceInterface::Private::create(ClientConnection *c, quint32 version, quint32 id)
{
Resource::Private::create(c, version, id);
wl_client_get_credentials(*client, &clientPid, &clientUser, &clientGroup);
}
void ShellSurfaceInterface::Private::pongCallback(wl_client *client, wl_resource *resource, uint32_t serial)
{
auto s = cast<Private>(resource);
@ -421,21 +411,6 @@ bool ShellSurfaceInterface::isToplevel() const {
return d->toplevel;
}
pid_t ShellSurfaceInterface::clientPid() const {
Q_D();
return d->clientPid;
}
uid_t ShellSurfaceInterface::clientUser() const {
Q_D();
return d->clientUser;
}
gid_t ShellSurfaceInterface::clientGroup() const {
Q_D();
return d->clientGroup;
}
ShellSurfaceInterface::Private *ShellSurfaceInterface::d_func() const
{
return reinterpret_cast<ShellSurfaceInterface::Private*>(d.data());

View file

@ -77,11 +77,6 @@ public:
bool isFullscreen() const;
bool isToplevel() const;
// TODO: keep them here or add a better encapsulation?
pid_t clientPid() const;
uid_t clientUser() const;
gid_t clientGroup() const;
Q_SIGNALS:
void titleChanged(const QString&);
void windowClassChanged(const QByteArray&);