@@ -34,6 +34,7 @@
3434#include <QDBusMetaType>
3535#include <QDomDocument>
3636
37+#include <glib.h>
3738#include <paths.h>
3839
3940// This is a mock, specifically to test the LauncherModel
@@ -144,7 +145,7 @@ private:
144145
145146 QList<QVariantMap> getASConfig() {
146147 AccountsServiceDBusAdaptor *as = launcherModel->m_asAdapter->m_accounts;
147− QDBusReply<QVariant> reply = as->getUserPropertyAsync(QString(qgetenv("USER")),
148+ QDBusReply<QVariant> reply = as->getUserPropertyAsync(QString::fromUtf8(g_get_user_name()),
148149 "com.canonical.unity.AccountsService",
149150 "LauncherItems");
150151 return qdbus_cast<QList<QVariantMap>>(reply.value().value<QDBusArgument>());
@@ -172,7 +173,7 @@ private Q_SLOTS:
172173 QStringLiteral("/org/freedesktop/Accounts"),
173174 QStringLiteral("org.freedesktop.Accounts"));
174175 QDBusReply<bool> addReply = accountsInterface.call(QStringLiteral("AddUser"),
175− QString(qgetenv("USER")));
176+ QString::fromUtf8(g_get_user_name()));
176177 QVERIFY(addReply.isValid());
177178 QCOMPARE(addReply.value(), true);
178179
@@ -198,7 +199,7 @@ private Q_SLOTS:
198199 QStringLiteral("/org/freedesktop/Accounts"),
199200 QStringLiteral("org.freedesktop.Accounts"));
200201 QDBusReply<bool> removeReply = accountsInterface.call(QStringLiteral("RemoveUser"),
201− QString(qgetenv("USER")));
202+ QString::fromUtf8(g_get_user_name()));
202203 QVERIFY(removeReply.isValid());
203204 QCOMPARE(removeReply.value(), true);
204205 }