on xenial help sign in
another mess
commitfcec91e034d8e57c1e7af29b52c54a950bab6465 authorJosh Arenson <joshua.arenson@canonical.com> dateWed 18 Nov 2015, 14:57 (11 years ago) parent03fdd29
4 files changed+12−10
plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h+3−1 tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.cpp+6−8 tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.h+3 tests/qmltests/Greeter/tst_Greeter.qml−1
plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h+3−1
@@ -60,8 +60,10 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
6060 int rowCount(const QModelIndex& parent) const override;
6161 QVariant data(const QModelIndex& index, int role) const override;
6262
63− private:
63+ protected:
6464 SessionsModelPrivate* const d_ptr;
65+
66+ private:
6567 QHash<int, QByteArray> m_roleNames;
6668 Q_DECLARE_PRIVATE(SessionsModel)
6769 };
tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.cpp+6−8
@@ -18,23 +18,21 @@
1818#include "MockSessionsModel.h"
1919#include <QLightDM/SessionsModel>
2020#include <QSortFilterProxyModel>
21−#include <QDebug>
21+
2222QString MockSessionsModel::testScenario() const
2323{
24− qDebug() << "AGETTING MockSessionsModel::testScenario->()";
2524 QLightDM::SessionsModel* qSessionsModel =
26− static_cast<QLightDM::SessionsModel*>(static_cast<QSortFilterProxyModel*>(sourceModel())->sourceModel());
27− qDebug() << "CASTING MockSessionsModel::testScenario->()";
28− return QString(qSessionsModel->testScenario());
25+ static_cast<QLightDM::SessionsModel*>(static_cast<QSortFilterProxyModel*>(sourceModel())->sourceModel());
26+
27+ return qSessionsModel->testScenario();
2928}
3029
3130void MockSessionsModel::setTestScenario(QString testScenario)
3231{
33− qDebug() << "SETTING TEST SCENARIO";
34− /*QLightDM::SessionsModel* qSessionsModel =
32+ QLightDM::SessionsModel* qSessionsModel =
3533 static_cast<QLightDM::SessionsModel*>(static_cast<QSortFilterProxyModel*>(sourceModel())->sourceModel());
3634
3735 if (qSessionsModel->testScenario() != testScenario) {
3836 qSessionsModel->setTestScenario(testScenario);
39− }*/
37+ }
4038}
tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.h+3
@@ -29,6 +29,9 @@ class MockSessionsModel : public SessionsModel
2929public:
3030 QString testScenario() const;
3131 void setTestScenario(QString testScenario);
32+
33+private:
34+ QString m_testScenario;
3235};
3336
3437#endif // MOCK_UNITY_SESSIONSMODEL_H
tests/qmltests/Greeter/tst_Greeter.qml−1
@@ -53,7 +53,6 @@ Item {
5353
5454 Component.onDestruction: {
5555 loader.itemDestroyed = true;
56− console.log("JOSH: " + LightDM.Sessions.testScenario)
5756 }
5857 }
5958 }