diff options
Diffstat (limited to 'core/polkitqt1-authority.cpp')
-rw-r--r-- | core/polkitqt1-authority.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp index 0951d97b5..d7cf300b8 100644 --- a/core/polkitqt1-authority.cpp +++ b/core/polkitqt1-authority.cpp @@ -23,12 +23,12 @@ #include "polkitqt1-authority.h" -#include <QtDBus/QDBusInterface> -#include <QtDBus/QDBusReply> +#include <TQtDBus/TQDBusInterface> +#include <TQtDBus/TQDBusReply> #include <polkit/polkit.h> -namespace PolkitQt1 +namespace PolkitTQt1 { class AuthorityHelper @@ -91,18 +91,18 @@ public: /** Use this method to set the error message to \p message. Set recover to \c true * to try to reinitialize this object with init() method */ - void setError(Authority::ErrorCode code, const QString &details = QString(), bool recover = false); + void setError(Authority::ErrorCode code, const TQString &details = TQString(), bool recover = false); - void dbusFilter(const QDBusMessage &message); - void dbusSignalAdd(const QString &service, const QString &path, const QString &interface, const QString &name); - void seatSignalsConnect(const QString &seat); + void dbusFilter(const TQDBusMessage &message); + void dbusSignalAdd(const TQString &service, const TQString &path, const TQString &interface, const TQString &name); + void seatSignalsConnect(const TQString &seat); Authority *q; PolkitAuthority *pkAuthority; bool m_hasError; Authority::ErrorCode m_lastError; - QString m_errorDetails; - QDBusConnection *m_systemBus; + TQString m_errorDetails; + TQDBusConnection *m_systemBus; GCancellable *m_checkAuthorizationCancellable, *m_enumerateActionsCancellable, *m_registerAuthenticationAgentCancellable, @@ -136,12 +136,12 @@ Authority::Private::~Private() g_object_unref(m_revokeTemporaryAuthorizationCancellable); } -Authority::Authority(PolkitAuthority *authority, QObject *parent) - : QObject(parent) +Authority::Authority(PolkitAuthority *authority, TQObject *parent) + : TQObject(parent) , d(new Private(this)) { - qRegisterMetaType<PolkitQt1::Authority::Result> (); - qRegisterMetaType<PolkitQt1::ActionDescription::List>(); + qRegisterMetaType<PolkitTQt1::Authority::Result> (); + qRegisterMetaType<PolkitTQt1::ActionDescription::List>(); Q_ASSERT(!s_globalAuthority()->q); s_globalAuthority()->q = this; @@ -164,8 +164,8 @@ Authority::~Authority() void Authority::Private::init() { - QDBusError error; - QDBusError dbus_error; + TQDBusError error; + TQDBusError dbus_error; g_type_init(); @@ -207,30 +207,30 @@ void Authority::Private::init() // need to listen to NameOwnerChanged dbusSignalAdd("org.freedesktop.DBus", "/", "org.freedesktop.DBus", "NameOwnerChanged"); - QString consoleKitService("org.freedesktop.ConsoleKit"); - QString consoleKitManagerPath("/org/freedesktop/ConsoleKit/Manager"); - QString consoleKitManagerInterface("org.freedesktop.ConsoleKit.Manager"); - QString consoleKitSeatInterface("org.freedesktop.ConsoleKit.Seat"); + TQString consoleKitService("org.freedesktop.ConsoleKit"); + TQString consoleKitManagerPath("/org/freedesktop/ConsoleKit/Manager"); + TQString consoleKitManagerInterface("org.freedesktop.ConsoleKit.Manager"); + TQString consoleKitSeatInterface("org.freedesktop.ConsoleKit.Seat"); // first, add signals SeadAdded and SeatRemoved from ConsoleKit Manager dbusSignalAdd(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "SeatAdded"); dbusSignalAdd(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "SeatRemoved"); // then we need to extract all seats from ConsoleKit - QDBusMessage msg = QDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats"); - msg = QDBusConnection::systemBus().call(msg); + TQDBusMessage msg = TQDBusMessage::createMethodCall(consoleKitService, consoleKitManagerPath, consoleKitManagerInterface, "GetSeats"); + msg = TQDBusConnection::systemBus().call(msg); if (!msg.arguments().isEmpty()) { // this method returns a list with present seats - QList<QString> seats; - qVariantValue<QDBusArgument> (msg.arguments()[0]) >> seats; + TQList<TQString> seats; + qVariantValue<TQDBusArgument> (msg.arguments()[0]) >> seats; // it can be multiple seats present so connect all their signals - Q_FOREACH(const QString &seat, seats) { + Q_FOREACH(const TQString &seat, seats) { seatSignalsConnect(seat); } } } -void Authority::Private::setError(Authority::ErrorCode code, const QString &details, bool recover) +void Authority::Private::setError(Authority::ErrorCode code, const TQString &details, bool recover) { if (recover) { init(); @@ -240,10 +240,10 @@ void Authority::Private::setError(Authority::ErrorCode code, const QString &deta m_hasError = true; } -void Authority::Private::seatSignalsConnect(const QString &seat) +void Authority::Private::seatSignalsConnect(const TQString &seat) { - QString consoleKitService("org.freedesktop.ConsoleKit"); - QString consoleKitSeatInterface("org.freedesktop.ConsoleKit.Seat"); + TQString consoleKitService("org.freedesktop.ConsoleKit"); + TQString consoleKitSeatInterface("org.freedesktop.ConsoleKit.Seat"); // we want to connect to all slots of the seat dbusSignalAdd(consoleKitService, seat, consoleKitSeatInterface, "DeviceAdded"); dbusSignalAdd(consoleKitService, seat, consoleKitSeatInterface, "DeviceRemoved"); @@ -252,21 +252,21 @@ void Authority::Private::seatSignalsConnect(const QString &seat) dbusSignalAdd(consoleKitService, seat, consoleKitSeatInterface, "ActiveSessionChanged"); } -void Authority::Private::dbusSignalAdd(const QString &service, const QString &path, const QString &interface, const QString &name) +void Authority::Private::dbusSignalAdd(const TQString &service, const TQString &path, const TQString &interface, const TQString &name) { - // FIXME: This code seems to be nonfunctional - it needs to be fixed somewhere (is it Qt BUG?) - QDBusConnection::systemBus().connect(service, path, interface, name, - q, SLOT(dbusFilter(const QDBusMessage &))); + // FIXME: This code seems to be nonfunctional - it needs to be fixed somewhere (is it TQt BUG?) + TQDBusConnection::systemBus().connect(service, path, interface, name, + q, SLOT(dbusFilter(const TQDBusMessage &))); } -void Authority::Private::dbusFilter(const QDBusMessage &message) +void Authority::Private::dbusFilter(const TQDBusMessage &message) { - if (message.type() == QDBusMessage::SignalMessage) { + if (message.type() == TQDBusMessage::SignalMessage) { Q_EMIT q->consoleKitDBChanged(); // TODO: Test this with the multiseat support if (message.member() == "SeatAdded") { - seatSignalsConnect(qVariantValue<QDBusObjectPath> (message.arguments()[0]).path()); + seatSignalsConnect(qVariantValue<TQDBusObjectPath> (message.arguments()[0]).path()); } } } @@ -281,10 +281,10 @@ Authority::ErrorCode Authority::lastError() const return d->m_lastError; } -const QString Authority::errorDetails() const +const TQString Authority::errorDetails() const { if (d->m_lastError == E_None) { - return QString(); + return TQString(); } else { return d->m_errorDetails; } @@ -306,7 +306,7 @@ PolkitAuthority *Authority::polkitAuthority() const return d->pkAuthority; } -Authority::Result Authority::checkAuthorizationSync(const QString &actionId, const Subject &subject, AuthorizationFlags flags) +Authority::Result Authority::checkAuthorizationSync(const TQString &actionId, const Subject &subject, AuthorizationFlags flags) { PolkitAuthorizationResult *pk_result; GError *error = NULL; @@ -344,7 +344,7 @@ Authority::Result Authority::checkAuthorizationSync(const QString &actionId, con } } -void Authority::checkAuthorization(const QString &actionId, const Subject &subject, AuthorizationFlags flags) +void Authority::checkAuthorization(const TQString &actionId, const Subject &subject, AuthorizationFlags flags) { if (Authority::instance()->hasError()) { return; @@ -454,7 +454,7 @@ void Authority::enumerateActionsCancel() } } -bool Authority::registerAuthenticationAgentSync(const Subject &subject, const QString &locale, const QString &objectPath) +bool Authority::registerAuthenticationAgentSync(const Subject &subject, const TQString &locale, const TQString &objectPath) { if (Authority::instance()->hasError()) { return false; @@ -481,7 +481,7 @@ bool Authority::registerAuthenticationAgentSync(const Subject &subject, const QS return result; } -void Authority::registerAuthenticationAgent(const Subject &subject, const QString &locale, const QString &objectPath) +void Authority::registerAuthenticationAgent(const Subject &subject, const TQString &locale, const TQString &objectPath) { if (Authority::instance()->hasError()) { return; @@ -526,7 +526,7 @@ void Authority::registerAuthenticationAgentCancel() } } -bool Authority::unregisterAuthenticationAgentSync(const Subject &subject, const QString &objectPath) +bool Authority::unregisterAuthenticationAgentSync(const Subject &subject, const TQString &objectPath) { if (d->pkAuthority) { return false; @@ -554,7 +554,7 @@ bool Authority::unregisterAuthenticationAgentSync(const Subject &subject, const return result; } -void Authority::unregisterAuthenticationAgent(const Subject &subject, const QString &objectPath) +void Authority::unregisterAuthenticationAgent(const Subject &subject, const TQString &objectPath) { if (Authority::instance()->hasError()) { return; @@ -598,7 +598,7 @@ void Authority::unregisterAuthenticationAgentCancel() } } -bool Authority::authenticationAgentResponseSync(const QString &cookie, const Identity &identity) +bool Authority::authenticationAgentResponseSync(const TQString &cookie, const Identity &identity) { if (Authority::instance()->hasError()) { return false; @@ -625,7 +625,7 @@ bool Authority::authenticationAgentResponseSync(const QString &cookie, const Ide return result; } -void Authority::authenticationAgentResponse(const QString &cookie, const Identity &identity) +void Authority::authenticationAgentResponse(const TQString &cookie, const Identity &identity) { if (Authority::instance()->hasError()) { return; @@ -790,7 +790,7 @@ void Authority::revokeTemporaryAuthorizationsCancel() } } -bool Authority::revokeTemporaryAuthorizationSync(const QString &id) +bool Authority::revokeTemporaryAuthorizationSync(const TQString &id) { bool result; if (Authority::instance()->hasError()) { @@ -810,7 +810,7 @@ bool Authority::revokeTemporaryAuthorizationSync(const QString &id) return result; } -void Authority::revokeTemporaryAuthorization(const QString &id) +void Authority::revokeTemporaryAuthorization(const TQString &id) { if (Authority::instance()->hasError()) { return; |