on xenial help sign in
Drop useStorage argument and use exising LAUNCHER_TESTING define for this decision.

Approved by PS Jenkins bot, Michał Sawicz, Michal Hruby.

commit8e05f3286c3137002f480cec86bbedc01dc6af49 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 2 Oct 2013, 22:59 (13 years ago) parentfd2f17e2e84f9a
4 files changed+9−9
plugins/Unity/Launcher/backend/launcherbackend.cpp+4−4 plugins/Unity/Launcher/backend/launcherbackend.h+1−1 plugins/Unity/Launcher/launchermodel.cpp+1−1 tests/plugins/Unity/Launcher/launcherbackendtest.cpp+3−3
plugins/Unity/Launcher/backend/launcherbackend.cpp+4−4
@@ -38,13 +38,13 @@ public:
3838 bool pinned;
3939};
4040
41−LauncherBackend::LauncherBackend(bool useStorage, QObject *parent):
41+LauncherBackend::LauncherBackend(QObject *parent):
4242 QObject(parent),
4343 m_accounts(nullptr)
4444{
45− if (useStorage) {
46− m_accounts = new AccountsServiceDBusAdaptor(this);
47− }
45+#ifndef LAUNCHER_TESTING
46+ m_accounts = new AccountsServiceDBusAdaptor(this);
47+#endif
4848 m_user = qgetenv("USER");
4949 syncFromAccounts();
5050}
plugins/Unity/Launcher/backend/launcherbackend.h+1−1
@@ -39,7 +39,7 @@ class LauncherBackend : public QObject
3939
4040
4141public:
42− LauncherBackend(bool useStorage = true, QObject *parent = 0);
42+ LauncherBackend(QObject *parent = 0);
4343 virtual ~LauncherBackend();
4444
4545 /**
plugins/Unity/Launcher/launchermodel.cpp+1−1
@@ -27,7 +27,7 @@ using namespace unity::shell::application;
2727
2828LauncherModel::LauncherModel(QObject *parent):
2929 LauncherModelInterface(parent),
30− m_backend(new LauncherBackend(true, this)),
30+ m_backend(new LauncherBackend(this)),
3131 m_appManager(0)
3232{
3333 connect(m_backend, SIGNAL(countChanged(QString,int)), SLOT(countChanged(QString,int)));
tests/plugins/Unity/Launcher/launcherbackendtest.cpp+3−3
@@ -37,7 +37,7 @@ private Q_SLOTS:
3737
3838 void testFileNames()
3939 {
40− LauncherBackend backend(false);
40+ LauncherBackend backend;
4141
4242 backend.setStoredApplications(QStringList() << "rel-icon" << "abs-icon" << "invalid");
4343 QCOMPARE(backend.storedApplications(), QStringList() << "rel-icon" << "abs-icon");
@@ -45,7 +45,7 @@ private Q_SLOTS:
4545
4646 void testPinning()
4747 {
48− LauncherBackend backend(false);
48+ LauncherBackend backend;
4949
5050 backend.setStoredApplications(QStringList() << "rel-icon" << "abs-icon");
5151 QCOMPARE(backend.isPinned("rel-icon"), false);
@@ -82,7 +82,7 @@ private Q_SLOTS:
8282 QFETCH(QString, appId);
8383 QFETCH(QString, expectedIcon);
8484
85− LauncherBackend backend(false);
85+ LauncherBackend backend;
8686 backend.setStoredApplications(QStringList() << appId);
8787
8888 QCOMPARE(backend.icon(appId), expectedIcon);