@@ -34,6 +34,8 @@
3434#include <QDBusMetaType>
3535#include <QDomDocument>
3636
37+#include <glib.h>
38+
3739// This is a mock, specifically to test the LauncherModel
3840class MockApp: public unity::shell::application::ApplicationInfoInterface
3941{
@@ -141,7 +143,7 @@ private:
141143
142144 QList<QVariantMap> getASConfig() {
143145 AccountsServiceDBusAdaptor *as = launcherModel->m_asAdapter->m_accounts;
144− QDBusReply<QVariant> reply = as->getUserPropertyAsync(QString(qgetenv("USER")),
146+ QDBusReply<QVariant> reply = as->getUserPropertyAsync(QString::fromUtf8(g_get_user_name()),
145147 "com.canonical.unity.AccountsService",
146148 "LauncherItems");
147149 return qdbus_cast<QList<QVariantMap>>(reply.value().value<QDBusArgument>());
@@ -166,7 +168,7 @@ private Q_SLOTS:
166168 QStringLiteral("/org/freedesktop/Accounts"),
167169 QStringLiteral("org.freedesktop.Accounts"));
168170 QDBusReply<bool> addReply = accountsInterface.call(QStringLiteral("AddUser"),
169− QString(qgetenv("USER")));
171+ QString::fromUtf8(g_get_user_name()));
170172 QVERIFY(addReply.isValid());
171173 QCOMPARE(addReply.value(), true);
172174
@@ -192,7 +194,7 @@ private Q_SLOTS:
192194 QStringLiteral("/org/freedesktop/Accounts"),
193195 QStringLiteral("org.freedesktop.Accounts"));
194196 QDBusReply<bool> removeReply = accountsInterface.call(QStringLiteral("RemoveUser"),
195− QString(qgetenv("USER")));
197+ QString::fromUtf8(g_get_user_name()));
196198 QVERIFY(removeReply.isValid());
197199 QCOMPARE(removeReply.value(), true);
198200 }