[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [zanshin] src/kontact: Get the kontact plugin to also use ApplicationModel/Components
From:       Kevin Ottens <ervin () kde ! org>
Date:       2014-07-31 19:45:02
Message-ID: E1XCwHe-0007Xx-Vi () scm ! kde ! org
[Download RAW message or body]

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 <KDE/KPluginFactory>
 
+#include <QBoxLayout>
+
 #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<Part>();)
@@ -41,8 +45,20 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
 
     setComponentData(PartFactory::componentData());
 
-    auto view = new Widgets::PageView(parentWidget);
-    view->setModel(new Presentation::InboxPageModel(view));
+    auto view = new QWidget(parentWidget);
+    auto components = new Widgets::ApplicationComponents(view);
+    components->setModel(new Presentation::ApplicationModel(components));
+
+    QVBoxLayout *layout = new QVBoxLayout;
+
+    QHBoxLayout *hbox = new QHBoxLayout;
+    hbox->addWidget(components->defaultTaskSourceCombo());
+    hbox->addWidget(components->defaultNoteSourceCombo());
+
+    layout->addLayout(hbox);
+    layout->addWidget(components->pageView());
+    view->setLayout(layout);
+
     setWidget(view);
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic