Skip to content

Commit

Permalink
Drop the QDBusConnection parameter since logind only uses system bus …
Browse files Browse the repository at this point in the history
…connections
  • Loading branch information
ilpianista committed Nov 29, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 05aa8f6 commit a80dd6e
Showing 10 changed files with 25 additions and 31 deletions.
14 changes: 7 additions & 7 deletions src/ldmanager.cpp
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ QList<Systemd::Logind::Seat::Ptr> Systemd::Logind::LogindPrivate::listSeats()
if (message.type() == QDBusMessage::ReplyMessage) {
const DBusSeatList seats = qdbus_cast<DBusSeatList>(message.arguments().first());
Q_FOREACH (const DBusSeat seat, seats) {
Seat::Ptr s = Seat::Ptr(new Seat(seat.path.path(), ildface.connection()));
Seat::Ptr s = Seat::Ptr(new Seat(seat.path.path()));
seatLists.append(s);
}
}
@@ -183,37 +183,37 @@ void Systemd::Logind::LogindPrivate::hybridSleep(const bool interactive)
void Systemd::Logind::LogindPrivate::onSeatNew(const QString &id, const QDBusObjectPath &seat)
{
Q_UNUSED(id)
emit Logind::Notifier::seatNew(Seat::Ptr(new Seat(seat.path(), ildface.connection())));
emit Logind::Notifier::seatNew(Seat::Ptr(new Seat(seat.path())));
}

void Systemd::Logind::LogindPrivate::onSeatRemoved(const QString &id, const QDBusObjectPath &seat)
{
Q_UNUSED(id)
emit Logind::Notifier::seatRemoved(Seat::Ptr(new Seat(seat.path(), ildface.connection())));
emit Logind::Notifier::seatRemoved(Seat::Ptr(new Seat(seat.path())));
}

void Systemd::Logind::LogindPrivate::onSessionNew(const QString &id, const QDBusObjectPath &session)
{
Q_UNUSED(id)
emit Logind::Notifier::sessionNew(Session::Ptr(new Session(session.path(), ildface.connection())));
emit Logind::Notifier::sessionNew(Session::Ptr(new Session(session.path())));
}

void Systemd::Logind::LogindPrivate::onSessionRemoved(const QString &id, const QDBusObjectPath &session)
{
Q_UNUSED(id)
emit Logind::Notifier::sessionRemoved(Session::Ptr(new Session(session.path(), ildface.connection())));
emit Logind::Notifier::sessionRemoved(Session::Ptr(new Session(session.path())));
}

void Systemd::Logind::LogindPrivate::onUserNew(const uint &id, const QDBusObjectPath &user)
{
Q_UNUSED(id)
emit Logind::Notifier::userNew(User::Ptr(new User(user.path(), ildface.connection())));
emit Logind::Notifier::userNew(User::Ptr(new User(user.path())));
}

void Systemd::Logind::LogindPrivate::onUserRemoved(const uint &id, const QDBusObjectPath &user)
{
Q_UNUSED(id)
emit Logind::Notifier::userRemoved(User::Ptr(new User(user.path(), ildface.connection())));
emit Logind::Notifier::userRemoved(User::Ptr(new User(user.path())));
}

void Systemd::Logind::LogindPrivate::powerOff(const bool interactive)
8 changes: 4 additions & 4 deletions src/seat.cpp
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@
#include "seat_p.h"
#include "ldmanager_p.h"

Systemd::Logind::SeatPrivate::SeatPrivate(const QString &path, const QDBusConnection &connection) :
seatIface(Systemd::Logind::LogindPrivate::LD_DBUS_SERVICE, path, connection)
Systemd::Logind::SeatPrivate::SeatPrivate(const QString &path) :
seatIface(Systemd::Logind::LogindPrivate::LD_DBUS_SERVICE, path, QDBusConnection::systemBus())
{
qDBusRegisterMetaType<DBusSession>();
qDBusRegisterMetaType<DBusSessionList>();
@@ -40,8 +40,8 @@ Systemd::Logind::SeatPrivate::~SeatPrivate()
{
}

Systemd::Logind::Seat::Seat(const QString &path, const QDBusConnection &connection, QObject *parent) :
QObject(parent), d_ptr(new SeatPrivate(path, connection))
Systemd::Logind::Seat::Seat(const QString &path, QObject *parent) :
QObject(parent), d_ptr(new SeatPrivate(path))
{
}

4 changes: 1 addition & 3 deletions src/seat.h
Original file line number Diff line number Diff line change
@@ -25,8 +25,6 @@

#include "QtSystemd-export.h"

class QDBusConnection;

namespace Systemd
{
namespace Logind
@@ -41,7 +39,7 @@ class SDQT_EXPORT Seat : public QObject
public:
typedef QSharedPointer<Seat> Ptr;

explicit Seat(const QString &path, const QDBusConnection &connection, QObject *parent = 0);
explicit Seat(const QString &path, QObject *parent = 0);
explicit Seat(SeatPrivate &seat, QObject *parent = 0);
virtual ~Seat();

2 changes: 1 addition & 1 deletion src/seat_p.h
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class SeatPrivate
{

public:
explicit SeatPrivate(const QString &path, const QDBusConnection &connection);
explicit SeatPrivate(const QString &path);
virtual ~SeatPrivate();

OrgFreedesktopLogin1SeatInterface seatIface;
8 changes: 4 additions & 4 deletions src/session.cpp
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@
#include "session_p.h"
#include "ldmanager_p.h"

Systemd::Logind::SessionPrivate::SessionPrivate(const QString &path, const QDBusConnection &connection) :
sessionIface(Systemd::Logind::LogindPrivate::LD_DBUS_SERVICE, path, connection)
Systemd::Logind::SessionPrivate::SessionPrivate(const QString &path) :
sessionIface(Systemd::Logind::LogindPrivate::LD_DBUS_SERVICE, path, QDBusConnection::systemBus())
{
active = sessionIface.active();
audit = sessionIface.audit();
@@ -53,8 +53,8 @@ Systemd::Logind::SessionPrivate::~SessionPrivate()
{
}

Systemd::Logind::Session::Session(const QString &path, const QDBusConnection &connection, QObject *parent) :
QObject(parent), d_ptr(new SessionPrivate(path, connection))
Systemd::Logind::Session::Session(const QString &path, QObject *parent) :
QObject(parent), d_ptr(new SessionPrivate(path))
{
}

4 changes: 1 addition & 3 deletions src/session.h
Original file line number Diff line number Diff line change
@@ -25,8 +25,6 @@

#include "QtSystemd-export.h"

class QDBusConnection;

namespace Systemd
{
namespace Logind
@@ -41,7 +39,7 @@ class SDQT_EXPORT Session : public QObject
public:
typedef QSharedPointer<Session> Ptr;

explicit Session(const QString &path, const QDBusConnection &connection, QObject *parent = 0);
explicit Session(const QString &path, QObject *parent = 0);
explicit Session(SessionPrivate &session, QObject *parent = 0);
virtual ~Session();

2 changes: 1 addition & 1 deletion src/session_p.h
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class SessionPrivate
{

public:
explicit SessionPrivate(const QString &path, const QDBusConnection &connection);
explicit SessionPrivate(const QString &path);
virtual ~SessionPrivate();

OrgFreedesktopLogin1SessionInterface sessionIface;
8 changes: 4 additions & 4 deletions src/user.cpp
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@
#include "user_p.h"
#include "ldmanager_p.h"

Systemd::Logind::UserPrivate::UserPrivate(const QString &path, const QDBusConnection &connection) :
userIface(Systemd::Logind::LogindPrivate::LD_DBUS_SERVICE, path, connection)
Systemd::Logind::UserPrivate::UserPrivate(const QString &path) :
userIface(Systemd::Logind::LogindPrivate::LD_DBUS_SERVICE, path, QDBusConnection::systemBus())
{
//display = userIface.display();
gid = userIface.uID();
@@ -44,8 +44,8 @@ Systemd::Logind::UserPrivate::~UserPrivate()
{
}

Systemd::Logind::User::User(const QString &path, const QDBusConnection &connection, QObject *parent) :
QObject(parent), d_ptr(new UserPrivate(path, connection))
Systemd::Logind::User::User(const QString &path, QObject *parent) :
QObject(parent), d_ptr(new UserPrivate(path))
{
}

4 changes: 1 addition & 3 deletions src/user.h
Original file line number Diff line number Diff line change
@@ -25,8 +25,6 @@

#include "QtSystemd-export.h"

class QDBusConnection;

namespace Systemd
{
namespace Logind
@@ -41,7 +39,7 @@ class SDQT_EXPORT User : public QObject
public:
typedef QSharedPointer<User> Ptr;

explicit User(const QString &path, const QDBusConnection &connection, QObject *parent = 0);
explicit User(const QString &path, QObject *parent = 0);
explicit User(UserPrivate &user, QObject *parent = 0);
virtual ~User();

2 changes: 1 addition & 1 deletion src/user_p.h
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class UserPrivate
{

public:
explicit UserPrivate(const QString &path, const QDBusConnection &connection);
explicit UserPrivate(const QString &path);
virtual ~UserPrivate();

OrgFreedesktopLogin1UserInterface userIface;

0 comments on commit a80dd6e

Please sign in to comment.