@@ -34,6 +34,8 @@
34#include <QDBusMetaType>
34#include <QDBusMetaType>
35#include <QDomDocument>
35#include <QDomDocument>
37// This is a mock, specifically to test the LauncherModel
39// This is a mock, specifically to test the LauncherModel
38class MockApp: public unity::shell::application::ApplicationInfoInterface
40class MockApp: public unity::shell::application::ApplicationInfoInterface
@@ -141,7 +143,7 @@ private:
142 QList<QVariantMap> getASConfig() {
144 QList<QVariantMap> getASConfig() {
143 AccountsServiceDBusAdaptor *as = launcherModel->m_asAdapter->m_accounts;
145 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()),
145 "com.canonical.unity.AccountsService",
147 "com.canonical.unity.AccountsService",
146 "LauncherItems");
148 "LauncherItems");
147 return qdbus_cast<QList<QVariantMap>>(reply.value().value<QDBusArgument>());
149 return qdbus_cast<QList<QVariantMap>>(reply.value().value<QDBusArgument>());
@@ -166,7 +168,7 @@ private Q_SLOTS:
166 QStringLiteral("/org/freedesktop/Accounts"),
168 QStringLiteral("/org/freedesktop/Accounts"),
167 QStringLiteral("org.freedesktop.Accounts"));
169 QStringLiteral("org.freedesktop.Accounts"));
168 QDBusReply<bool> addReply = accountsInterface.call(QStringLiteral("AddUser"),
170 QDBusReply<bool> addReply = accountsInterface.call(QStringLiteral("AddUser"),
169− QString(qgetenv("USER")));
171+ QString::fromUtf8(g_get_user_name()));
170 QVERIFY(addReply.isValid());
172 QVERIFY(addReply.isValid());
171 QCOMPARE(addReply.value(), true);
173 QCOMPARE(addReply.value(), true);
@@ -192,7 +194,7 @@ private Q_SLOTS:
192 QStringLiteral("/org/freedesktop/Accounts"),
194 QStringLiteral("/org/freedesktop/Accounts"),
193 QStringLiteral("org.freedesktop.Accounts"));
195 QStringLiteral("org.freedesktop.Accounts"));
194 QDBusReply<bool> removeReply = accountsInterface.call(QStringLiteral("RemoveUser"),
196 QDBusReply<bool> removeReply = accountsInterface.call(QStringLiteral("RemoveUser"),
195− QString(qgetenv("USER")));
197+ QString::fromUtf8(g_get_user_name()));
196 QVERIFY(removeReply.isValid());
198 QVERIFY(removeReply.isValid());
197 QCOMPARE(removeReply.value(), true);
199 QCOMPARE(removeReply.value(), true);