@@ -34,6 +34,7 @@
34#include <QDBusMetaType>
34#include <QDBusMetaType>
35#include <QDomDocument>
35#include <QDomDocument>
37#include <paths.h>
38#include <paths.h>
39// This is a mock, specifically to test the LauncherModel
40// This is a mock, specifically to test the LauncherModel
@@ -144,7 +145,7 @@ private:
145 QList<QVariantMap> getASConfig() {
146 QList<QVariantMap> getASConfig() {
146 AccountsServiceDBusAdaptor *as = launcherModel->m_asAdapter->m_accounts;
147 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()),
148 "com.canonical.unity.AccountsService",
149 "com.canonical.unity.AccountsService",
149 "LauncherItems");
150 "LauncherItems");
150 return qdbus_cast<QList<QVariantMap>>(reply.value().value<QDBusArgument>());
151 return qdbus_cast<QList<QVariantMap>>(reply.value().value<QDBusArgument>());
@@ -172,7 +173,7 @@ private Q_SLOTS:
172 QStringLiteral("/org/freedesktop/Accounts"),
173 QStringLiteral("/org/freedesktop/Accounts"),
173 QStringLiteral("org.freedesktop.Accounts"));
174 QStringLiteral("org.freedesktop.Accounts"));
174 QDBusReply<bool> addReply = accountsInterface.call(QStringLiteral("AddUser"),
175 QDBusReply<bool> addReply = accountsInterface.call(QStringLiteral("AddUser"),
175− QString(qgetenv("USER")));
176+ QString::fromUtf8(g_get_user_name()));
176 QVERIFY(addReply.isValid());
177 QVERIFY(addReply.isValid());
177 QCOMPARE(addReply.value(), true);
178 QCOMPARE(addReply.value(), true);
@@ -198,7 +199,7 @@ private Q_SLOTS:
198 QStringLiteral("/org/freedesktop/Accounts"),
199 QStringLiteral("/org/freedesktop/Accounts"),
199 QStringLiteral("org.freedesktop.Accounts"));
200 QStringLiteral("org.freedesktop.Accounts"));
200 QDBusReply<bool> removeReply = accountsInterface.call(QStringLiteral("RemoveUser"),
201 QDBusReply<bool> removeReply = accountsInterface.call(QStringLiteral("RemoveUser"),
201− QString(qgetenv("USER")));
202+ QString::fromUtf8(g_get_user_name()));
202 QVERIFY(removeReply.isValid());
203 QVERIFY(removeReply.isValid());
203 QCOMPARE(removeReply.value(), true);
204 QCOMPARE(removeReply.value(), true);