From bae0a227350a4e602fd605e467728112f766eb4f Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 9 Mar 2016 16:28:57 +0100 Subject: remove controller that are not longer needed --- framework/domain/CMakeLists.txt | 3 - framework/domain/folderlistcontroller.cpp | 69 -------------------- framework/domain/folderlistcontroller.h | 56 ----------------- framework/domain/maillistcontroller.cpp | 101 ------------------------------ framework/domain/maillistcontroller.h | 61 ------------------ framework/domain/singlemailcontroller.cpp | 46 -------------- framework/domain/singlemailcontroller.h | 49 --------------- 7 files changed, 385 deletions(-) delete mode 100644 framework/domain/folderlistcontroller.cpp delete mode 100644 framework/domain/folderlistcontroller.h delete mode 100644 framework/domain/maillistcontroller.cpp delete mode 100644 framework/domain/maillistcontroller.h delete mode 100644 framework/domain/singlemailcontroller.cpp delete mode 100644 framework/domain/singlemailcontroller.h 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 @@ set(mailplugin_SRCS mailplugin.cpp - maillistcontroller.cpp maillistmodel.cpp - singlemailcontroller.cpp folderlistmodel.cpp - folderlistcontroller.cpp actions/sinkactions.cpp actions/mailactions.cpp 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 @@ -/* - Copyright (c) 2016 Michael Bohlender - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "folderlistcontroller.h" - -#include "folderlistmodel.h" - -#include - -FolderListController::FolderListController(QObject *parent) : QObject(parent), m_model(new FolderListModel) -{ - -} - -QString FolderListController::accountId() const -{ - return m_accountId; -} - -void FolderListController::setAccountId(const QString &id) -{ - if(m_accountId != id) { - m_accountId = id; - - loadFolders(id); - - emit accountIdChanged(); - } -} - -FolderListModel* FolderListController::model() const -{ - return m_model.data(); -} - -void FolderListController::loadFolders(const QString &id) -{ - //load foldermodel from sink - -} - - -void FolderListController::addFolder(const QString &name) -{ - qDebug() << "User Action: add folder " << name; -} - -void FolderListController::deleteFolder(const QString &id) -{ - qDebug() << "User Action: delete folder " << id; -} - 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 @@ -/* - Copyright (c) 2016 Michael Bohlender - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#pragma once - -#include "folderlistmodel.h" - -#include -#include -#include - -class FolderListController : public QObject -{ - Q_OBJECT - Q_PROPERTY (QString accountId READ accountId WRITE setAccountId NOTIFY accountIdChanged) - Q_PROPERTY (FolderListModel *model READ model CONSTANT) - -public: - explicit FolderListController(QObject *parent = Q_NULLPTR); - - QString accountId() const; - void setAccountId(const QString &id); - - FolderListModel *model() const; - - void loadFolders(const QString &id); - -signals: - void accountIdChanged(); - -public slots: - void deleteFolder(const QString &id); - void addFolder(const QString &name); - - -private: - QString m_accountId; - QScopedPointer m_model; -}; 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 @@ -/* - Copyright (c) 2016 Michael Bohlender - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "maillistcontroller.h" - -#include - -#include - -#include "maillistmodel.h" - -MailListController::MailListController(QObject *parent) : QObject(parent), m_model(new MailListModel) -{ -} - -MailListModel *MailListController::model() const -{ - return m_model.data(); - -} - -void MailListController::loadAllMail() -{ - Sink::Query query; - query.liveQuery = true; - query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important"; - m_model->runQuery(query); -} - -void MailListController::loadMailFolder(const QString &folderId) -{ - Sink::Query query; - query.liveQuery = true; - query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "folder"; - query.propertyFilter.insert("folder", folderId.toLatin1()); - m_model->runQuery(query); -} - -void MailListController::loadUnreadMail() -{ - Sink::Query query; - query.liveQuery = true; - query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important"; - query.propertyFilter.insert("unread", true); - m_model->runQuery(query); -} - -void MailListController::loadImportantMail() -{ - Sink::Query query; - query.liveQuery = true; - query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important"; - query.propertyFilter.insert("important", true); - m_model->runQuery(query); -} - -QString MailListController::selectedMail() const -{ - return m_selectedMail; -} - -void MailListController::setSelectedMail(const QString& id) -{ - if (m_selectedMail != id) { - m_selectedMail = id; - emit selectedMailChanged(); - } -} - -void MailListController::markMailImportant(bool important) -{ - qDebug() << "user action: mark mail important "; -} - -void MailListController::markMailUnread(bool unread) -{ - qDebug() << "user action: mark mail unread "; -} - -void MailListController::deleteMail() -{ - qDebug() << "user action: delete mail"; -} - 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 @@ -/* - Copyright (c) 2016 Michael Bohlender - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#pragma once - -#include "maillistmodel.h" - -#include -#include -#include -#include - -class MailListController : public QObject -{ - Q_OBJECT - Q_PROPERTY (MailListModel *model READ model CONSTANT) - Q_PROPERTY (QString selectedMail READ selectedMail WRITE setSelectedMail NOTIFY selectedMailChanged) - -public: - explicit MailListController(QObject *parent = Q_NULLPTR); - - MailListModel *model() const; - - QString selectedMail() const; - void setSelectedMail(const QString &id); - -signals: - void selectedMailChanged(); - -public slots: - void loadAllMail(); - void loadUnreadMail(); - void loadImportantMail(); - void loadMailFolder(const QString &folderId); - - void markMailImportant(bool important); - void markMailUnread(bool unread); - void deleteMail(); - -private: - QScopedPointer m_model; - - QString m_selectedMail; -}; 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 @@ -/* - Copyright (c) 2016 Michael Bohlender - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "singlemailcontroller.h" - -SingleMailController::SingleMailController(QObject *parent) : QObject(parent), m_model(new MailListModel) -{ - -} - -SingleMailController::~SingleMailController() -{ - -} - -MailListModel* SingleMailController::model() const -{ - return m_model.data(); -} - - -void SingleMailController::loadMail(const QString &id) -{ - Sink::Query query; - query.liveQuery = false; - query.requestedProperties << "subject" << "sender" << "senderName" << "date" << "unread" << "important" << "mimeMessage"; - query.ids << id.toLatin1(); - m_model->runQuery(query); -} \ 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 @@ -/* - Copyright (c) 2016 Michael Bohlender - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#pragma once - -#include "maillistmodel.h" - -#include -#include -#include -#include - -class SingleMailController : public QObject -{ - Q_OBJECT - Q_PROPERTY (MailListModel *model READ model CONSTANT) - -public: - explicit SingleMailController(QObject *parent = Q_NULLPTR); - ~SingleMailController(); - - MailListModel *model() const; - -Q_SIGNALS: - void messageChanged(); - -public slots: - void loadMail(const QString &id); - -private: - QScopedPointer m_model; -}; -- cgit v1.2.3