summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2016-03-09 16:28:57 +0100
committerMichael Bohlender <michael.bohlender@kdemail.net>2016-03-09 16:28:57 +0100
commitbae0a227350a4e602fd605e467728112f766eb4f (patch)
tree68cc3ec354acf85ab99db670d4592347489709a6
parentaca02709fedabf9028768fe9a699f31a91b4ab0e (diff)
downloadkube-bae0a227350a4e602fd605e467728112f766eb4f.tar.gz
kube-bae0a227350a4e602fd605e467728112f766eb4f.zip
remove controller that are not longer needed
-rw-r--r--framework/domain/CMakeLists.txt3
-rw-r--r--framework/domain/folderlistcontroller.cpp69
-rw-r--r--framework/domain/folderlistcontroller.h56
-rw-r--r--framework/domain/maillistcontroller.cpp101
-rw-r--r--framework/domain/maillistcontroller.h61
-rw-r--r--framework/domain/singlemailcontroller.cpp46
-rw-r--r--framework/domain/singlemailcontroller.h49
7 files changed, 0 insertions, 385 deletions
diff --git a/framework/domain/CMakeLists.txt b/framework/domain/CMakeLists.txt
index b14e410e..75fcef09 100644
--- a/framework/domain/CMakeLists.txt
+++ b/framework/domain/CMakeLists.txt
@@ -1,10 +1,7 @@
1set(mailplugin_SRCS 1set(mailplugin_SRCS
2 mailplugin.cpp 2 mailplugin.cpp
3 maillistcontroller.cpp
4 maillistmodel.cpp 3 maillistmodel.cpp
5 singlemailcontroller.cpp
6 folderlistmodel.cpp 4 folderlistmodel.cpp
7 folderlistcontroller.cpp
8 actions/sinkactions.cpp 5 actions/sinkactions.cpp
9 actions/mailactions.cpp 6 actions/mailactions.cpp
10 objecttreesource.cpp 7 objecttreesource.cpp
diff --git a/framework/domain/folderlistcontroller.cpp b/framework/domain/folderlistcontroller.cpp
deleted file mode 100644
index 46a6f648..00000000
--- a/framework/domain/folderlistcontroller.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#include "folderlistcontroller.h"
22
23#include "folderlistmodel.h"
24
25#include <QDebug>
26
27FolderListController::FolderListController(QObject *parent) : QObject(parent), m_model(new FolderListModel)
28{
29
30}
31
32QString FolderListController::accountId() const
33{
34 return m_accountId;
35}
36
37void FolderListController::setAccountId(const QString &id)
38{
39 if(m_accountId != id) {
40 m_accountId = id;
41
42 loadFolders(id);
43
44 emit accountIdChanged();
45 }
46}
47
48FolderListModel* FolderListController::model() const
49{
50 return m_model.data();
51}
52
53void FolderListController::loadFolders(const QString &id)
54{
55 //load foldermodel from sink
56
57}
58
59
60void FolderListController::addFolder(const QString &name)
61{
62 qDebug() << "User Action: add folder " << name;
63}
64
65void FolderListController::deleteFolder(const QString &id)
66{
67 qDebug() << "User Action: delete folder " << id;
68}
69
diff --git a/framework/domain/folderlistcontroller.h b/framework/domain/folderlistcontroller.h
deleted file mode 100644
index 11057f21..00000000
--- a/framework/domain/folderlistcontroller.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#pragma once
22
23#include "folderlistmodel.h"
24
25#include <QObject>
26#include <QScopedPointer>
27#include <QString>
28
29class FolderListController : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY (QString accountId READ accountId WRITE setAccountId NOTIFY accountIdChanged)
33 Q_PROPERTY (FolderListModel *model READ model CONSTANT)
34
35public:
36 explicit FolderListController(QObject *parent = Q_NULLPTR);
37
38 QString accountId() const;
39 void setAccountId(const QString &id);
40
41 FolderListModel *model() const;
42
43 void loadFolders(const QString &id);
44
45signals:
46 void accountIdChanged();
47
48public slots:
49 void deleteFolder(const QString &id);
50 void addFolder(const QString &name);
51
52
53private:
54 QString m_accountId;
55 QScopedPointer<FolderListModel> m_model;
56};
diff --git a/framework/domain/maillistcontroller.cpp b/framework/domain/maillistcontroller.cpp
deleted file mode 100644
index a4bd6436..00000000
--- a/framework/domain/maillistcontroller.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#include "maillistcontroller.h"
22
23#include <QStringList>
24
25#include <sink/store.h>
26
27#include "maillistmodel.h"
28
29MailListController::MailListController(QObject *parent) : QObject(parent), m_model(new MailListModel)
30{
31}
32
33MailListModel *MailListController::model() const
34{
35 return m_model.data();
36
37}
38
39void MailListController::loadAllMail()
40{
41 Sink::Query query;
42 query.liveQuery = true;
43 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
44 m_model->runQuery(query);
45}
46
47void MailListController::loadMailFolder(const QString &folderId)
48{
49 Sink::Query query;
50 query.liveQuery = true;
51 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "folder";
52 query.propertyFilter.insert("folder", folderId.toLatin1());
53 m_model->runQuery(query);
54}
55
56void MailListController::loadUnreadMail()
57{
58 Sink::Query query;
59 query.liveQuery = true;
60 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
61 query.propertyFilter.insert("unread", true);
62 m_model->runQuery(query);
63}
64
65void MailListController::loadImportantMail()
66{
67 Sink::Query query;
68 query.liveQuery = true;
69 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important";
70 query.propertyFilter.insert("important", true);
71 m_model->runQuery(query);
72}
73
74QString MailListController::selectedMail() const
75{
76 return m_selectedMail;
77}
78
79void MailListController::setSelectedMail(const QString& id)
80{
81 if (m_selectedMail != id) {
82 m_selectedMail = id;
83 emit selectedMailChanged();
84 }
85}
86
87void MailListController::markMailImportant(bool important)
88{
89 qDebug() << "user action: mark mail important ";
90}
91
92void MailListController::markMailUnread(bool unread)
93{
94 qDebug() << "user action: mark mail unread ";
95}
96
97void MailListController::deleteMail()
98{
99 qDebug() << "user action: delete mail";
100}
101
diff --git a/framework/domain/maillistcontroller.h b/framework/domain/maillistcontroller.h
deleted file mode 100644
index 959c63a3..00000000
--- a/framework/domain/maillistcontroller.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#pragma once
22
23#include "maillistmodel.h"
24
25#include <QObject>
26#include <QScopedPointer>
27#include <QString>
28#include <QAbstractItemModel>
29
30class MailListController : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY (MailListModel *model READ model CONSTANT)
34 Q_PROPERTY (QString selectedMail READ selectedMail WRITE setSelectedMail NOTIFY selectedMailChanged)
35
36public:
37 explicit MailListController(QObject *parent = Q_NULLPTR);
38
39 MailListModel *model() const;
40
41 QString selectedMail() const;
42 void setSelectedMail(const QString &id);
43
44signals:
45 void selectedMailChanged();
46
47public slots:
48 void loadAllMail();
49 void loadUnreadMail();
50 void loadImportantMail();
51 void loadMailFolder(const QString &folderId);
52
53 void markMailImportant(bool important);
54 void markMailUnread(bool unread);
55 void deleteMail();
56
57private:
58 QScopedPointer<MailListModel> m_model;
59
60 QString m_selectedMail;
61};
diff --git a/framework/domain/singlemailcontroller.cpp b/framework/domain/singlemailcontroller.cpp
deleted file mode 100644
index 8ee4acbb..00000000
--- a/framework/domain/singlemailcontroller.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#include "singlemailcontroller.h"
22
23SingleMailController::SingleMailController(QObject *parent) : QObject(parent), m_model(new MailListModel)
24{
25
26}
27
28SingleMailController::~SingleMailController()
29{
30
31}
32
33MailListModel* SingleMailController::model() const
34{
35 return m_model.data();
36}
37
38
39void SingleMailController::loadMail(const QString &id)
40{
41 Sink::Query query;
42 query.liveQuery = false;
43 query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "mimeMessage";
44 query.ids << id.toLatin1();
45 m_model->runQuery(query);
46} \ No newline at end of file
diff --git a/framework/domain/singlemailcontroller.h b/framework/domain/singlemailcontroller.h
deleted file mode 100644
index 283b03c4..00000000
--- a/framework/domain/singlemailcontroller.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 Copyright (c) 2016 Michael Bohlender <michael.bohlender@kdemail.net>
3 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#pragma once
22
23#include "maillistmodel.h"
24
25#include <QObject>
26#include <QString>
27#include <QDateTime>
28#include <QScopedPointer>
29
30class SingleMailController : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY (MailListModel *model READ model CONSTANT)
34
35public:
36 explicit SingleMailController(QObject *parent = Q_NULLPTR);
37 ~SingleMailController();
38
39 MailListModel *model() const;
40
41Q_SIGNALS:
42 void messageChanged();
43
44public slots:
45 void loadMail(const QString &id);
46
47private:
48 QScopedPointer<MailListModel> m_model;
49};