on xenial help sign in
Use chained constructors
commit8952dae44f16519c1b73842359f7f0c0207d1702 authorAlbert Astals <albert.astals@canonical.com> dateWed 14 May 2014, 10:36 (12 years ago) parent2d05265
7 files changed+13−16
tests/mocks/Unity/fake_categories.cpp+2−2 tests/mocks/Unity/fake_previewmodel.cpp+1−2 tests/mocks/Unity/fake_previewstack.cpp+1−2 tests/mocks/Unity/fake_previewwidgetmodel.cpp+1−2 tests/mocks/Unity/fake_resultsmodel.cpp+2−2 tests/mocks/Unity/fake_scope.cpp+2−2 tests/mocks/Unity/fake_scopes.cpp+4−4
tests/mocks/Unity/fake_categories.cpp+2−2
@@ -22,9 +22,9 @@
2222#include "fake_resultsmodel.h"
2323
2424Categories::Categories(int category_count, QObject* parent)
25− : m_category_count(category_count)
25+ : unity::shell::scopes::CategoriesInterface(parent)
26+ , m_category_count(category_count)
2627{
27− setParent(parent);
2828}
2929
3030int Categories::rowCount(const QModelIndex& /*parent*/) const
tests/mocks/Unity/fake_previewmodel.cpp+1−2
@@ -28,9 +28,8 @@
2828#include <QDebug>
2929
3030PreviewModel::PreviewModel(QObject* parent)
31+ : unity::shell::scopes::PreviewModelInterface(parent)
3132{
32− setParent(parent);
33−
3433 // we have one column by default
3534 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
3635 m_previewWidgetModels.append(columnModel);
tests/mocks/Unity/fake_previewstack.cpp+1−2
@@ -22,9 +22,8 @@
2222#include "fake_scope.h"
2323
2424PreviewStack::PreviewStack(QObject* parent)
25+ : unity::shell::scopes::PreviewStackInterface(parent)
2526{
26− setParent(parent);
27−
2827 m_previews << new PreviewModel(this);
2928}
3029
tests/mocks/Unity/fake_previewwidgetmodel.cpp+1−2
@@ -36,9 +36,8 @@ struct PreviewData
3636};
3737
3838PreviewWidgetModel::PreviewWidgetModel(QObject* parent)
39+ : unity::shell::scopes::PreviewWidgetModelInterface(parent)
3940{
40− setParent(parent);
41−
4241 populateWidgets();
4342}
4443
tests/mocks/Unity/fake_resultsmodel.cpp+2−2
@@ -23,10 +23,10 @@
2323#include <paths.h>
2424
2525ResultsModel::ResultsModel(int result_count, int categoryId, QObject* parent)
26− : m_result_count(result_count)
26+ : unity::shell::scopes::ResultsModelInterface(parent)
27+ , m_result_count(result_count)
2728 , m_categoryId(categoryId)
2829{
29− setParent(parent);
3030}
3131
3232QString ResultsModel::categoryId() const
tests/mocks/Unity/fake_scope.cpp+2−2
@@ -22,7 +22,8 @@ Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
2222}
2323
2424Scope::Scope(QString const& id, QString const& name, bool visible, QObject* parent)
25− : m_id(id)
25+ : unity::shell::scopes::ScopeInterface(parent)
26+ , m_id(id)
2627 , m_name(name)
2728 , m_visible(visible)
2829 , m_searching(false)
@@ -30,7 +31,6 @@ Scope::Scope(QString const& id, QString const& name, bool visible, QObject* pare
3031 , m_previewRendererName("preview-generic")
3132 , m_categories(new Categories(20, this))
3233{
33− setParent(parent);
3434}
3535
3636QString Scope::id() const {
tests/mocks/Unity/fake_scopes.cpp+4−4
@@ -24,11 +24,11 @@
2424// Qt
2525#include <QTimer>
2626
27−Scopes::Scopes(QObject *parent) : m_loaded(false)
28−, timer(this)
27+Scopes::Scopes(QObject *parent)
28+ : unity::shell::scopes::ScopesInterface(parent)
29+ , m_loaded(false)
30+ , timer(this)
2931{
30− setParent(parent);
31−
3232 QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
3333 QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
3434 QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));