summaryrefslogtreecommitdiff
path: root/liblightdm-qt
diff options
context:
space:
mode:
authorAurelien Gateau <aurelien.gateau@canonical.com>2011-12-07 13:15:42 +0100
committerAurelien Gateau <aurelien.gateau@canonical.com>2011-12-07 13:15:42 +0100
commitc950881ab32a24f134295d2e73fd2899afd80c74 (patch)
treea746efba34b333c21e7ec4508f5ad34f364acfb7 /liblightdm-qt
parent99c910b01e424ad48391f67eb47508530bb10e06 (diff)
parent99feb696b581c364df7fb2f5b7d6cd90e80381a8 (diff)
downloadlightdm-c950881ab32a24f134295d2e73fd2899afd80c74.tar.gz
Merged trunk
Diffstat (limited to 'liblightdm-qt')
-rw-r--r--liblightdm-qt/QLightDM/greeter.h5
-rw-r--r--liblightdm-qt/greeter.cpp5
-rw-r--r--liblightdm-qt/system.cpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/liblightdm-qt/QLightDM/greeter.h b/liblightdm-qt/QLightDM/greeter.h
index 7a1e00a9..5f82b52b 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 CONSTANT);
+
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"
diff --git a/liblightdm-qt/system.cpp b/liblightdm-qt/system.cpp
index 2461aaad..84040aa0 100644
--- a/liblightdm-qt/system.cpp
+++ b/liblightdm-qt/system.cpp
@@ -12,11 +12,11 @@
#include "QLightDM/system.h"
-#include <QtNetwork/QHostInfo>
+#include <lightdm.h>
using namespace QLightDM;
QString System::hostname()
{
- return QHostInfo::localHostName();
+ return QString::fromLocal8Bit(lightdm_get_hostname());
}