on xenial help sign in
Use chained constructors
8952daeAlbert Astals
tests/mocks/Unity/fake_categories.cpp+2−2
@@ -22,9 +22,9 @@
22#include "fake_resultsmodel.h"
22#include "fake_resultsmodel.h"
23
23
24Categories::Categories(int category_count, QObject* parent)
24Categories::Categories(int category_count, QObject* parent)
25+ : unity::shell::scopes::CategoriesInterface(parent)
25− : m_category_count(category_count)
26+ , m_category_count(category_count)
26{
27{
27− setParent(parent);
28}
28}
29
29
30int Categories::rowCount(const QModelIndex& /*parent*/) const
30int Categories::rowCount(const QModelIndex& /*parent*/) const
tests/mocks/Unity/fake_previewmodel.cpp+1−2
@@ -28,9 +28,8 @@
28#include <QDebug>
28#include <QDebug>
29
29
30PreviewModel::PreviewModel(QObject* parent)
30PreviewModel::PreviewModel(QObject* parent)
31+ : unity::shell::scopes::PreviewModelInterface(parent)
31{
32{
32− setParent(parent);
33−
34 // we have one column by default
33 // we have one column by default
35 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
34 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
36 m_previewWidgetModels.append(columnModel);
35 m_previewWidgetModels.append(columnModel);
tests/mocks/Unity/fake_previewstack.cpp+1−2
@@ -22,9 +22,8 @@
22#include "fake_scope.h"
22#include "fake_scope.h"
23
23
24PreviewStack::PreviewStack(QObject* parent)
24PreviewStack::PreviewStack(QObject* parent)
25+ : unity::shell::scopes::PreviewStackInterface(parent)
25{
26{
26− setParent(parent);
27−
28 m_previews << new PreviewModel(this);
27 m_previews << new PreviewModel(this);
29}
28}
30
29
tests/mocks/Unity/fake_previewwidgetmodel.cpp+1−2
@@ -36,9 +36,8 @@ struct PreviewData
36};
36};
37
37
38PreviewWidgetModel::PreviewWidgetModel(QObject* parent)
38PreviewWidgetModel::PreviewWidgetModel(QObject* parent)
39+ : unity::shell::scopes::PreviewWidgetModelInterface(parent)
39{
40{
40− setParent(parent);
41−
42 populateWidgets();
41 populateWidgets();
43}
42}
44
43
tests/mocks/Unity/fake_resultsmodel.cpp+2−2
@@ -23,10 +23,10 @@
23#include <paths.h>
23#include <paths.h>
24
24
25ResultsModel::ResultsModel(int result_count, int categoryId, QObject* parent)
25ResultsModel::ResultsModel(int result_count, int categoryId, QObject* parent)
26+ : unity::shell::scopes::ResultsModelInterface(parent)
26− : m_result_count(result_count)
27+ , m_result_count(result_count)
27 , m_categoryId(categoryId)
28 , m_categoryId(categoryId)
28{
29{
29− setParent(parent);
30}
30}
31
31
32QString ResultsModel::categoryId() const
32QString ResultsModel::categoryId() const
tests/mocks/Unity/fake_scope.cpp+2−2
@@ -22,7 +22,8 @@ Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
22}
22}
23
23
24Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
24Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
25+ : unity::shell::scopes::ScopeInterface(parent)
25− : m_id(id)
26+ , m_id(id)
26 , m_name(name)
27 , m_name(name)
27 , m_visible(visible)
28 , m_visible(visible)
28 , m_searching(false)
29 , m_searching(false)
@@ -30,7 +31,6 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
30 , m_previewRendererName("preview-generic")
31 , m_previewRendererName("preview-generic")
31 , m_categories(new Categories(20, this))
32 , m_categories(new Categories(20, this))
32{
33{
33− setParent(parent);
34}
34}
35
35
36QString Scope::id() const {
36QString Scope::id() const {
tests/mocks/Unity/fake_scopes.cpp+4−4
@@ -24,11 +24,11 @@
24// Qt
24// Qt
25#include <QTimer>
25#include <QTimer>
26
26
27−Scopes::Scopes(QObject *parent) : m_loaded(false)
27+Scopes::Scopes(QObject *parent)
28+ : unity::shell::scopes::ScopesInterface(parent)
29+ , m_loaded(false)
28−, timer(this)
30+ , timer(this)
29{
31{
30− setParent(parent);
31−
32 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
32 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
33 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
33 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
34 QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
34 QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));