From kde-commits Thu Jul 31 19:45:02 2014 From: Kevin Ottens Date: Thu, 31 Jul 2014 19:45:02 +0000 To: kde-commits Subject: [zanshin] src/kontact: Get the kontact plugin to also use ApplicationModel/Components Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=140683591515848 Git commit d81cd55476081e4157e144e2e95c8e6f0083ff99 by Kevin Ottens. Committed on 31/07/2014 at 17:27. Pushed by ervin into branch 'master'. Get the kontact plugin to also use ApplicationModel/Components M +19 -3 src/kontact/part.cpp http://commits.kde.org/zanshin/d81cd55476081e4157e144e2e95c8e6f0083ff99 diff --git a/src/kontact/part.cpp b/src/kontact/part.cpp index 769031f..40e3fcc 100644 --- a/src/kontact/part.cpp +++ b/src/kontact/part.cpp @@ -25,10 +25,14 @@ = #include = +#include + #include "../app/aboutdata.h" #include "../app/dependencies.h" = -#include "presentation/inboxpagemodel.h" +#include "presentation/applicationmodel.h" +#include "widgets/applicationcomponents.h" +#include "widgets/datasourcecombobox.h" #include "widgets/pageview.h" = K_PLUGIN_FACTORY(PartFactory, registerPlugin();) @@ -41,8 +45,20 @@ Part::Part(QWidget *parentWidget, QObject *parent, const= QVariantList &) = setComponentData(PartFactory::componentData()); = - auto view =3D new Widgets::PageView(parentWidget); - view->setModel(new Presentation::InboxPageModel(view)); + auto view =3D new QWidget(parentWidget); + auto components =3D new Widgets::ApplicationComponents(view); + components->setModel(new Presentation::ApplicationModel(components)); + + QVBoxLayout *layout =3D new QVBoxLayout; + + QHBoxLayout *hbox =3D new QHBoxLayout; + hbox->addWidget(components->defaultTaskSourceCombo()); + hbox->addWidget(components->defaultNoteSourceCombo()); + + layout->addLayout(hbox); + layout->addWidget(components->pageView()); + view->setLayout(layout); + setWidget(view); } =