From e8a4fbab4065e62665421fe2cc33aee5bcfb404c Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Thu, 1 Dec 2011 09:34:59 +0100 Subject: Add "hostname" property to Greeter --- liblightdm-qt/QLightDM/greeter.h | 5 ++++- liblightdm-qt/greeter.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'liblightdm-qt') diff --git a/liblightdm-qt/QLightDM/greeter.h b/liblightdm-qt/QLightDM/greeter.h index 7a1e00a9..a9d8bacf 100644 --- a/liblightdm-qt/QLightDM/greeter.h +++ b/liblightdm-qt/QLightDM/greeter.h @@ -26,7 +26,9 @@ class Q_DECL_EXPORT Greeter : public QObject Q_OBJECT Q_PROPERTY(bool authenticated READ isAuthenticated ); //NOTFIY authenticationComplete - + + Q_PROPERTY(QString hostname READ hostname); + public: enum PromptType { PromptTypeQuestion, @@ -54,6 +56,7 @@ public: bool inAuthentication() const; bool isAuthenticated() const; QString authenticationUser() const; + QString hostname() const; public slots: bool connectSync(); diff --git a/liblightdm-qt/greeter.cpp b/liblightdm-qt/greeter.cpp index 8d6aaaff..6c43448b 100644 --- a/liblightdm-qt/greeter.cpp +++ b/liblightdm-qt/greeter.cpp @@ -217,4 +217,9 @@ int Greeter::autologinTimeoutHint() const return lightdm_greeter_get_autologin_timeout_hint(d->ldmGreeter); } +QString Greeter::hostname() const +{ + return QString::fromLocal8Bit(lightdm_get_hostname()); +} + #include "greeter_moc.cpp" -- cgit v1.2.1