From eb1664326e69757b18abd5fef8d22c9a328a2d28 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Sun, 4 Sep 2016 15:15:58 +0200 Subject: able to show all mails and not segfault by random mails (tempfix) --- framework/domain/messageparser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/domain/messageparser.cpp b/framework/domain/messageparser.cpp index 8363e119..ff763aec 100644 --- a/framework/domain/messageparser.cpp +++ b/framework/domain/messageparser.cpp @@ -89,7 +89,8 @@ QVariant PartModel::data(const QModelIndex &index, int role) const case Type: return part->metaObject()->className(); case IsHidden: - return part->property("isHidden").toBool(); + return false; + //return part->property("isHidden").toBool(); } } -- cgit v1.2.3 From f0fc0f9720610adde4e7f08625fdf3fe81de8de2 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 5 Sep 2016 14:13:07 +0200 Subject: adjust outbox height to number of mails in outbox --- components/package/contents/ui/Outbox.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/components/package/contents/ui/Outbox.qml b/components/package/contents/ui/Outbox.qml index 4baa0eae..ff049683 100644 --- a/components/package/contents/ui/Outbox.qml +++ b/components/package/contents/ui/Outbox.qml @@ -38,13 +38,15 @@ ToolButton { Rectangle { id: dialog + property int modelCount: 5 //FIXME replace with actual model + anchors { top: parent.bottom horizontalCenter: parent.horizontalCenter } - height: Kirigami.Units.gridUnit * 15 - width: Kirigami.Units.gridUnit * 12 + height: modelCount * Kirigami.Units.gridUnit * 3 + 10//scrollView.height height: Kirigami.Units.gridUnit * 15 + width: Kirigami.Units.gridUnit * 12 color: Kirigami.Theme.backgroundColor border.width: 1 @@ -55,16 +57,22 @@ ToolButton { //BEGIN Dialog Content ScrollView { + id: scrollView + anchors { fill: parent - margins: 1 + margins: 5 } + ListView { id: listView - model: 3 + model: 5 delegate: Kirigami.AbstractListItem { + + height: Kirigami.Units.gridUnit * 3 + Kirigami.Label { anchors.centerIn: parent text: "Subjext subxetson" -- cgit v1.2.3 From 145c65d5f3dc43a97cec86c2d6f8c3bab7f039ba Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 7 Sep 2016 12:03:11 +0200 Subject: gplv3 -> gplv2+ --- .../package/contents/ui/ImapAccountSettings.qml | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index 070f08aa..3b277a5f 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -1,19 +1,22 @@ /* - * Copyright (C) 2016 Michael Bohlender + * Copyright 2016 Michael Bohlender michael.bohlender@kdemail.net * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 -- cgit v1.2.3 From f179abbb71ece440805cb5fd57b971c0feefc3eb Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 7 Sep 2016 14:01:22 +0200 Subject: remove obsolete code from settings --- framework/settings/CMakeLists.txt | 3 --- framework/settings/maildir_resource.cpp | 32 ----------------------- framework/settings/maildir_resource.h | 29 --------------------- framework/settings/resourcelistmodel.cpp | 42 ------------------------------ framework/settings/resourcelistmodel.h | 26 ------------------ framework/settings/resourcescontroller.cpp | 12 --------- framework/settings/resourcescontroller.h | 20 -------------- 7 files changed, 164 deletions(-) delete mode 100644 framework/settings/maildir_resource.cpp delete mode 100644 framework/settings/maildir_resource.h delete mode 100644 framework/settings/resourcelistmodel.cpp delete mode 100644 framework/settings/resourcelistmodel.h delete mode 100644 framework/settings/resourcescontroller.cpp delete mode 100644 framework/settings/resourcescontroller.h diff --git a/framework/settings/CMakeLists.txt b/framework/settings/CMakeLists.txt index 9d876850..bf456138 100644 --- a/framework/settings/CMakeLists.txt +++ b/framework/settings/CMakeLists.txt @@ -1,8 +1,5 @@ set(settingsplugin_SRCS settingsplugin.cpp - # maildir_resource.cpp - # resourcelistmodel.cpp - # resourcescontroller.cpp settings.cpp ) diff --git a/framework/settings/maildir_resource.cpp b/framework/settings/maildir_resource.cpp deleted file mode 100644 index cb670295..00000000 --- a/framework/settings/maildir_resource.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "maildir_resource.h" - -MaildirResouceController::MaildirResouceController(QObject *parent) : QObject(parent) -{ - -} - -QString MaildirResouceController::name() const -{ - return m_name; -} - -void MaildirResouceController::setName(const QString &name) -{ - if(m_name != name) { - m_name = name; - emit nameChanged(); - } -} - -QUrl MaildirResouceController::folderUrl() const -{ - return m_folderUrl; -} - -void MaildirResouceController::setFolderUrl(const QUrl &url) -{ - if(m_folderUrl != url) { - m_folderUrl = url; - emit folderUrlChanged(); - } -} diff --git a/framework/settings/maildir_resource.h b/framework/settings/maildir_resource.h deleted file mode 100644 index 1db1a1f8..00000000 --- a/framework/settings/maildir_resource.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include -#include - -class MaildirResouceController : public QObject -{ - Q_OBJECT - Q_PROPERTY (QString name READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY (QUrl folderUrl READ folderUrl WRITE setFolderUrl NOTIFY folderUrlChanged); - -public: - explicit MaildirResouceController(QObject *parent = Q_NULLPTR); - - QString name() const; - void setName(const QString &name); - - QUrl folderUrl() const; - void setFolderUrl(const QUrl &url); - -signals: - void nameChanged(); - void folderUrlChanged(); - -private: - QString m_name; - QUrl m_folderUrl; -}; \ No newline at end of file diff --git a/framework/settings/resourcelistmodel.cpp b/framework/settings/resourcelistmodel.cpp deleted file mode 100644 index 27063ebc..00000000 --- a/framework/settings/resourcelistmodel.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "resourcelistmodel.h" - -#include - -ResourceListModel::ResourceListModel(QObject *parent) : QIdentityProxyModel() -{ - Sink::Query query; - query.syncOnDemand = false; - query.processAll = false; - query.liveQuery = true; - query.requestedProperties << "type"; - m_model = Sink::Store::loadModel(query); -} - -ResourceListModel::~ResourceListModel() -{ - -} - -QHash< int, QByteArray > ResourceListModel::roleNames() const -{ - QHash roles; - - roles[Type] = "type"; - roles[Id] = "id"; - - return roles; -} - -QVariant ResourceListModel::data(const QModelIndex& index, int role) const -{ - auto srcIdx = mapToSource(index); - switch (role) { - case Id: - return srcIdx.data(Sink::Store::DomainObjectBaseRole).value()->identifier(); - case Type: - return srcIdx.sibling(srcIdx.row(), 0).data(Qt::DisplayRole).toString(); - } - - return QIdentityProxyModel::data(index, role); -} - diff --git a/framework/settings/resourcelistmodel.h b/framework/settings/resourcelistmodel.h deleted file mode 100644 index de1b5a51..00000000 --- a/framework/settings/resourcelistmodel.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include -#include - -class ResourceListModel : public QIdentityProxyModel -{ - Q_OBJECT - -public: - ResourceListModel(QObject *parent = Q_NULLPTR); - ~ResourceListModel(); - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - - enum Roles { - Id = Qt::UserRole + 1, - Type - }; - - QHash roleNames() const; - -private: - QSharedPointer m_model; -}; diff --git a/framework/settings/resourcescontroller.cpp b/framework/settings/resourcescontroller.cpp deleted file mode 100644 index 03016b67..00000000 --- a/framework/settings/resourcescontroller.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "resourcescontroller.h" - -ResourcesController::ResourcesController(QObject *parent) : QObject(parent), m_model(new ResourceListModel()) -{ - -} - - -ResourceListModel* ResourcesController::model() const -{ - return m_model.data(); -} diff --git a/framework/settings/resourcescontroller.h b/framework/settings/resourcescontroller.h deleted file mode 100644 index 0e2e89de..00000000 --- a/framework/settings/resourcescontroller.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "resourcelistmodel.h" - -#include -#include - -class ResourcesController : public QObject -{ - Q_OBJECT - Q_PROPERTY (ResourceListModel *model READ model CONSTANT) - -public: - explicit ResourcesController(QObject *parent = Q_NULLPTR); - - ResourceListModel *model() const; - -private: - QScopedPointer m_model; -}; -- cgit v1.2.3 From 53d1c709717fe63d4c1585dce6c0205fa7575c90 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 7 Sep 2016 14:06:57 +0200 Subject: remove obsolete custon theme since we are now using the kirigami theme --- framework/CMakeLists.txt | 2 -- framework/theme/CMakeLists.txt | 14 ----------- framework/theme/colorpalette.cpp | 45 ------------------------------------ framework/theme/colorpalette.h | 47 ------------------------------------- framework/theme/qmldir | 3 --- framework/theme/themeplugin.cpp | 50 ---------------------------------------- framework/theme/themeplugin.h | 31 ------------------------- framework/theme/unit.cpp | 29 ----------------------- framework/theme/unit.h | 38 ------------------------------ 9 files changed, 259 deletions(-) delete mode 100644 framework/theme/CMakeLists.txt delete mode 100644 framework/theme/colorpalette.cpp delete mode 100644 framework/theme/colorpalette.h delete mode 100644 framework/theme/qmldir delete mode 100644 framework/theme/themeplugin.cpp delete mode 100644 framework/theme/themeplugin.h delete mode 100644 framework/theme/unit.cpp delete mode 100644 framework/theme/unit.h diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index 4fecaf14..95be342d 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -41,7 +41,5 @@ add_subdirectory(actions) add_subdirectory(settings) # Domain specific domain logic add_subdirectory(domain) -# Theme specfic things like colors -add_subdirectory(theme) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/framework/theme/CMakeLists.txt b/framework/theme/CMakeLists.txt deleted file mode 100644 index 319e3d39..00000000 --- a/framework/theme/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(themeplugin_SRCS - themeplugin.cpp - colorpalette.cpp - unit.cpp -) - -add_library(themeplugin SHARED ${themeplugin_SRCS}) - -qt5_use_modules(themeplugin Core Quick Qml) - -target_link_libraries(themeplugin) - -install(TARGETS themeplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/theme) -install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/theme) diff --git a/framework/theme/colorpalette.cpp b/framework/theme/colorpalette.cpp deleted file mode 100644 index a321a292..00000000 --- a/framework/theme/colorpalette.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "colorpalette.h" - -ColorPalette::ColorPalette(QObject *parent) : QObject(parent), m_background("#fcfcfc"), m_selected("#3daee9"), m_read("#232629"), m_border("#232629") -{ - -} - -QString ColorPalette::background() const -{ - return m_background; -} - -QString ColorPalette::read() const -{ - return m_read; -} - -QString ColorPalette::selected() const -{ - return m_selected; -} - -QString ColorPalette::border() const -{ - return m_border; -} - diff --git a/framework/theme/colorpalette.h b/framework/theme/colorpalette.h deleted file mode 100644 index a06783f3..00000000 --- a/framework/theme/colorpalette.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include -#include - -class ColorPalette : public QObject -{ - Q_OBJECT - - Q_PROPERTY (QString background READ background NOTIFY themeChanged) - Q_PROPERTY (QString selected READ background NOTIFY themeChanged) - Q_PROPERTY (QString read READ read NOTIFY themeChanged) - Q_PROPERTY (QString border READ border NOTIFY themeChanged) - -public: - explicit ColorPalette(QObject *parent = Q_NULLPTR); - - QString background() const; - QString selected() const; - QString read() const; - QString border() const; - -signals: - void themeChanged(); - -private: - QString m_background; - QString m_selected; - QString m_read; - QString m_border; -}; diff --git a/framework/theme/qmldir b/framework/theme/qmldir deleted file mode 100644 index 489a71ca..00000000 --- a/framework/theme/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module org.kube.framework.theme - -plugin themeplugin diff --git a/framework/theme/themeplugin.cpp b/framework/theme/themeplugin.cpp deleted file mode 100644 index ad9d0e1b..00000000 --- a/framework/theme/themeplugin.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "themeplugin.h" - -#include -#include - -#include "colorpalette.h" -#include "unit.h" - -static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine); - Q_UNUSED(scriptEngine); - - return new ColorPalette; -} - -static QObject *unitInstace(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine); - Q_UNUSED(scriptEngine); - - return new Unit; -} - -void ThemePlugin::registerTypes (const char *uri) -{ - Q_ASSERT(uri == QLatin1String("org.kube.framework.theme")); - - qmlRegisterSingletonType(uri, 1, 0, "ColorPalette", colorpaletteInstace); - qmlRegisterSingletonType(uri, 1, 0, "Unit", unitInstace); - -} diff --git a/framework/theme/themeplugin.h b/framework/theme/themeplugin.h deleted file mode 100644 index d8ae43c1..00000000 --- a/framework/theme/themeplugin.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#pragma once - -#include -#include - -class ThemePlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - virtual void registerTypes(const char *uri); -}; \ No newline at end of file diff --git a/framework/theme/unit.cpp b/framework/theme/unit.cpp deleted file mode 100644 index 1f3803cb..00000000 --- a/framework/theme/unit.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "unit.h" - -Unit::Unit(QObject *parent) : QObject(parent), m_size(5) -{ - -} - -int Unit::size() const -{ - return m_size; -} \ No newline at end of file diff --git a/framework/theme/unit.h b/framework/theme/unit.h deleted file mode 100644 index bd9b58f0..00000000 --- a/framework/theme/unit.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2016 Michael Bohlender - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include - - -class Unit : public QObject -{ - Q_OBJECT - Q_PROPERTY (int size READ size NOTIFY unitChanged) - - -public: - explicit Unit(QObject *parent = Q_NULLPTR); - - int size() const; - -signals: - void unitChanged(); - -private: - int m_size; -}; -- cgit v1.2.3 From 2ff0278de5ca9bf3163edee35ddd09480acb2ce8 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:34:33 +0200 Subject: mailviewer dummy model --- components/mailviewer/MailModel.qml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 components/mailviewer/MailModel.qml diff --git a/components/mailviewer/MailModel.qml b/components/mailviewer/MailModel.qml new file mode 100644 index 00000000..85e6af6a --- /dev/null +++ b/components/mailviewer/MailModel.qml @@ -0,0 +1,33 @@ +import QtQuick 2.4 + +ListModel { + + ListElement { + type: "encrypted" + trusted: false + trustlevel: "trusted" // "trusted" = green, "unknown" = grey, "dangerous" = red, "wierd" = yellow + content: [ + ListElement { + type: "plaintext" + textContent: "Moin, \n find the forwarded mail below. \n \n - M" + embeded: false + }, + ListElement { + type: "embeded" + sender: "Senderson" + date: "05/05/2055" + content: [ + ListElement{ + type: "plaintext" + textContent: "sender mc senderson is a sender. sender mc senderson is a sender. sender mc senderson is a mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc a sender sender mc is a sender sender mc senderson is a sendersender mc senderson is a sender" + embeded: true + }] + } + ] + } + ListElement { + type: "plaintext" + textContent: "footer mc footerson" + embeded: false + } +} -- cgit v1.2.3 From 1a3b5430bcfbfb63e2bb1d4ace372d1a803a7716 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:35:53 +0200 Subject: ugly border image until we get some from the vdg --- components/mailviewer/bordergreen.png | Bin 0 -> 1821 bytes components/mailviewer/bordergrey.png | Bin 0 -> 646 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 components/mailviewer/bordergreen.png create mode 100644 components/mailviewer/bordergrey.png diff --git a/components/mailviewer/bordergreen.png b/components/mailviewer/bordergreen.png new file mode 100644 index 00000000..9071d809 Binary files /dev/null and b/components/mailviewer/bordergreen.png differ diff --git a/components/mailviewer/bordergrey.png b/components/mailviewer/bordergrey.png new file mode 100644 index 00000000..1baa8345 Binary files /dev/null and b/components/mailviewer/bordergrey.png differ -- cgit v1.2.3 From c389c6ebc362d3283b4dfc01013565207e0fe3f5 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:37:05 +0200 Subject: mailviewer: text part --- components/mailviewer/TextPart.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 components/mailviewer/TextPart.qml diff --git a/components/mailviewer/TextPart.qml b/components/mailviewer/TextPart.qml new file mode 100644 index 00000000..3a4c8d22 --- /dev/null +++ b/components/mailviewer/TextPart.qml @@ -0,0 +1,10 @@ +import QtQuick 2.4 + +Text { + width: delegateRoot.width + + text: model.textContent + wrapMode: Text.WordWrap + + color: embeded ? "grey" : "black" +} -- cgit v1.2.3 From 711b7b00dbe3e7e5dde3a5ca6e08b734a55aa0c4 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:41:29 +0200 Subject: encrypted part --- components/mailviewer/EncryptedPart.qml | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 components/mailviewer/EncryptedPart.qml diff --git a/components/mailviewer/EncryptedPart.qml b/components/mailviewer/EncryptedPart.qml new file mode 100644 index 00000000..9f4b984e --- /dev/null +++ b/components/mailviewer/EncryptedPart.qml @@ -0,0 +1,51 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.5 + +Item { + + height: mailPart.height + width: mailPart.width + + // Rectangle { + // id: border + + // border.width: 5 + // border.color: "lightgreen" + //} + + BorderImage { + + anchors.fill: parent + border { left: 40; top: 40; right: 40; bottom: 40 } + horizontalTileMode: BorderImage.Repeat + verticalTileMode: BorderImage.Repeat + + source: model.trusted ? "bordergreen.png" : "bordergrey.png" + } + + MailPart { + id: mailPart + + } + + Rectangle { + + anchors { + top: parent.top + right: parent.right + } + + height: 50 + width: 50 + + radius: 100 + + color: model.trusted ? "lightgreen" : "lightgrey" + + ToolButton { + anchors.fill: parent + + iconName: "document-encrypt" + } + } +} -- cgit v1.2.3 From 5404fc8922d90b99692f0ed91fd9a9017ad1cfdb Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:41:45 +0200 Subject: embedded part --- components/mailviewer/EmbededPart.qml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 components/mailviewer/EmbededPart.qml diff --git a/components/mailviewer/EmbededPart.qml b/components/mailviewer/EmbededPart.qml new file mode 100644 index 00000000..11d1081c --- /dev/null +++ b/components/mailviewer/EmbededPart.qml @@ -0,0 +1,36 @@ +import QtQuick 2.4 + +Item { + + height: mailPart.height + width: mailPart.width + + + Rectangle { + id: border + color: "lightgrey" + height: mailPart.height + width: 5 + } + + Text { + id: sender + + anchors { + left: border.right + leftMargin: 15 + } + + text: "sent by " + model.sender + " on " + model.date + color: "grey" + } + + MailPart { + id: mailPart + + anchors.top: sender.bottom + + } + +} + -- cgit v1.2.3 From ce5fb534a38607867a1a8e48530acdc880015101 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:42:02 +0200 Subject: generic mailpart --- components/mailviewer/MailPart.qml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 components/mailviewer/MailPart.qml diff --git a/components/mailviewer/MailPart.qml b/components/mailviewer/MailPart.qml new file mode 100644 index 00000000..d7ae425f --- /dev/null +++ b/components/mailviewer/MailPart.qml @@ -0,0 +1,61 @@ +import QtQuick 2.4 + +Item { + id: root + + height: partColumn.height + 40 + width: delegateRoot.width + + Column { + id: partColumn + + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: 20 + } + + spacing: 10 + + Repeater { + model: content + + delegate: Column { + id: delegateRoot + + width: partColumn.width + + Loader { + id: loader + } + + Component.onCompleted: { + + switch (model.type) { + case "encrypted": + loader.source = "EncryptedPart.qml"; + break; + case "embeded": + loader.source = "EmbededPart.qml"; + break; + case "frame": + loader.source = "Frame.qml" + break; + case "plaintext": + loader.source = "TextPart.qml"; + break; + } + } + } + } + + + Item { + id: footer + + height: 5 + width: 10 + } + } +} -- cgit v1.2.3 From a195c0a48d04c8a9a935f8d5f7b8dd7a4b158148 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:42:19 +0200 Subject: dummyapp for testing --- components/mailviewer/dummyapp.qml | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 components/mailviewer/dummyapp.qml diff --git a/components/mailviewer/dummyapp.qml b/components/mailviewer/dummyapp.qml new file mode 100644 index 00000000..878b77ed --- /dev/null +++ b/components/mailviewer/dummyapp.qml @@ -0,0 +1,69 @@ +import QtQuick 2.4 + +Rectangle { + id: app + + width: 1200 + height: 700 + + Rectangle { + anchors.fill: parent + + color: "black" + + opacity: 0.8 + + } + + Rectangle { + + anchors.centerIn: parent + + height: mainColumn.height + 50 + width: parent.width * 0.9 + + Column { + id: mainColumn + + anchors.centerIn: parent + + width: parent.width - 50 + + spacing: 10 + + Repeater { + model: MailModel {} + + delegate: Column { + id: delegateRoot + + width: mainColumn.width + + Loader { + id: loader + } + + Component.onCompleted: { + switch (model.type) { + case "red": + loader.source = "Rect2.qml"; + break; + case "green": + loader.source = "Rect1.qml"; + break; + case "encrypted": + loader.source = "EncryptedPart.qml"; + break; + case "frame": + loader.source = "Frame.qml"; + break; + case "plaintext": + loader.source = "TextPart.qml"; + break; + } + } + } + } + } + } +} -- cgit v1.2.3 From 79fe32350cf20b2bc6eb76780804fd74b7efa2d2 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 1 Sep 2016 18:42:42 +0200 Subject: adjust trustlevel in mailmodel --- components/mailviewer/MailModel.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/components/mailviewer/MailModel.qml b/components/mailviewer/MailModel.qml index 85e6af6a..97764f79 100644 --- a/components/mailviewer/MailModel.qml +++ b/components/mailviewer/MailModel.qml @@ -5,7 +5,6 @@ ListModel { ListElement { type: "encrypted" trusted: false - trustlevel: "trusted" // "trusted" = green, "unknown" = grey, "dangerous" = red, "wierd" = yellow content: [ ListElement { type: "plaintext" -- cgit v1.2.3 From f29e0ca5670bb683548e158c9ca5d0a7b05555a2 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 5 Sep 2016 16:26:34 +0200 Subject: mailviewer: move qml files to dedicated folder --- components/mailviewer/EmbededPart.qml | 36 --------------- components/mailviewer/EncryptedPart.qml | 51 -------------------- components/mailviewer/MailModel.qml | 32 ------------- components/mailviewer/MailPart.qml | 61 ------------------------ components/mailviewer/TextPart.qml | 10 ---- components/mailviewer/bordergreen.png | Bin 1821 -> 0 bytes components/mailviewer/bordergrey.png | Bin 646 -> 0 bytes components/mailviewer/dummyapp.qml | 69 ---------------------------- components/mailviewer/qml/EmbededPart.qml | 36 +++++++++++++++ components/mailviewer/qml/EncryptedPart.qml | 51 ++++++++++++++++++++ components/mailviewer/qml/MailModel.qml | 32 +++++++++++++ components/mailviewer/qml/MailPart.qml | 61 ++++++++++++++++++++++++ components/mailviewer/qml/TextPart.qml | 10 ++++ components/mailviewer/qml/bordergreen.png | Bin 0 -> 1821 bytes components/mailviewer/qml/bordergrey.png | Bin 0 -> 646 bytes components/mailviewer/qml/dummyapp.qml | 69 ++++++++++++++++++++++++++++ 16 files changed, 259 insertions(+), 259 deletions(-) delete mode 100644 components/mailviewer/EmbededPart.qml delete mode 100644 components/mailviewer/EncryptedPart.qml delete mode 100644 components/mailviewer/MailModel.qml delete mode 100644 components/mailviewer/MailPart.qml delete mode 100644 components/mailviewer/TextPart.qml delete mode 100644 components/mailviewer/bordergreen.png delete mode 100644 components/mailviewer/bordergrey.png delete mode 100644 components/mailviewer/dummyapp.qml create mode 100644 components/mailviewer/qml/EmbededPart.qml create mode 100644 components/mailviewer/qml/EncryptedPart.qml create mode 100644 components/mailviewer/qml/MailModel.qml create mode 100644 components/mailviewer/qml/MailPart.qml create mode 100644 components/mailviewer/qml/TextPart.qml create mode 100644 components/mailviewer/qml/bordergreen.png create mode 100644 components/mailviewer/qml/bordergrey.png create mode 100644 components/mailviewer/qml/dummyapp.qml diff --git a/components/mailviewer/EmbededPart.qml b/components/mailviewer/EmbededPart.qml deleted file mode 100644 index 11d1081c..00000000 --- a/components/mailviewer/EmbededPart.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.4 - -Item { - - height: mailPart.height - width: mailPart.width - - - Rectangle { - id: border - color: "lightgrey" - height: mailPart.height - width: 5 - } - - Text { - id: sender - - anchors { - left: border.right - leftMargin: 15 - } - - text: "sent by " + model.sender + " on " + model.date - color: "grey" - } - - MailPart { - id: mailPart - - anchors.top: sender.bottom - - } - -} - diff --git a/components/mailviewer/EncryptedPart.qml b/components/mailviewer/EncryptedPart.qml deleted file mode 100644 index 9f4b984e..00000000 --- a/components/mailviewer/EncryptedPart.qml +++ /dev/null @@ -1,51 +0,0 @@ -import QtQuick 2.4 -import QtQuick.Controls 1.5 - -Item { - - height: mailPart.height - width: mailPart.width - - // Rectangle { - // id: border - - // border.width: 5 - // border.color: "lightgreen" - //} - - BorderImage { - - anchors.fill: parent - border { left: 40; top: 40; right: 40; bottom: 40 } - horizontalTileMode: BorderImage.Repeat - verticalTileMode: BorderImage.Repeat - - source: model.trusted ? "bordergreen.png" : "bordergrey.png" - } - - MailPart { - id: mailPart - - } - - Rectangle { - - anchors { - top: parent.top - right: parent.right - } - - height: 50 - width: 50 - - radius: 100 - - color: model.trusted ? "lightgreen" : "lightgrey" - - ToolButton { - anchors.fill: parent - - iconName: "document-encrypt" - } - } -} diff --git a/components/mailviewer/MailModel.qml b/components/mailviewer/MailModel.qml deleted file mode 100644 index 97764f79..00000000 --- a/components/mailviewer/MailModel.qml +++ /dev/null @@ -1,32 +0,0 @@ -import QtQuick 2.4 - -ListModel { - - ListElement { - type: "encrypted" - trusted: false - content: [ - ListElement { - type: "plaintext" - textContent: "Moin, \n find the forwarded mail below. \n \n - M" - embeded: false - }, - ListElement { - type: "embeded" - sender: "Senderson" - date: "05/05/2055" - content: [ - ListElement{ - type: "plaintext" - textContent: "sender mc senderson is a sender. sender mc senderson is a sender. sender mc senderson is a mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc a sender sender mc is a sender sender mc senderson is a sendersender mc senderson is a sender" - embeded: true - }] - } - ] - } - ListElement { - type: "plaintext" - textContent: "footer mc footerson" - embeded: false - } -} diff --git a/components/mailviewer/MailPart.qml b/components/mailviewer/MailPart.qml deleted file mode 100644 index d7ae425f..00000000 --- a/components/mailviewer/MailPart.qml +++ /dev/null @@ -1,61 +0,0 @@ -import QtQuick 2.4 - -Item { - id: root - - height: partColumn.height + 40 - width: delegateRoot.width - - Column { - id: partColumn - - anchors { - top: parent.top - left: parent.left - right: parent.right - margins: 20 - } - - spacing: 10 - - Repeater { - model: content - - delegate: Column { - id: delegateRoot - - width: partColumn.width - - Loader { - id: loader - } - - Component.onCompleted: { - - switch (model.type) { - case "encrypted": - loader.source = "EncryptedPart.qml"; - break; - case "embeded": - loader.source = "EmbededPart.qml"; - break; - case "frame": - loader.source = "Frame.qml" - break; - case "plaintext": - loader.source = "TextPart.qml"; - break; - } - } - } - } - - - Item { - id: footer - - height: 5 - width: 10 - } - } -} diff --git a/components/mailviewer/TextPart.qml b/components/mailviewer/TextPart.qml deleted file mode 100644 index 3a4c8d22..00000000 --- a/components/mailviewer/TextPart.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick 2.4 - -Text { - width: delegateRoot.width - - text: model.textContent - wrapMode: Text.WordWrap - - color: embeded ? "grey" : "black" -} diff --git a/components/mailviewer/bordergreen.png b/components/mailviewer/bordergreen.png deleted file mode 100644 index 9071d809..00000000 Binary files a/components/mailviewer/bordergreen.png and /dev/null differ diff --git a/components/mailviewer/bordergrey.png b/components/mailviewer/bordergrey.png deleted file mode 100644 index 1baa8345..00000000 Binary files a/components/mailviewer/bordergrey.png and /dev/null differ diff --git a/components/mailviewer/dummyapp.qml b/components/mailviewer/dummyapp.qml deleted file mode 100644 index 878b77ed..00000000 --- a/components/mailviewer/dummyapp.qml +++ /dev/null @@ -1,69 +0,0 @@ -import QtQuick 2.4 - -Rectangle { - id: app - - width: 1200 - height: 700 - - Rectangle { - anchors.fill: parent - - color: "black" - - opacity: 0.8 - - } - - Rectangle { - - anchors.centerIn: parent - - height: mainColumn.height + 50 - width: parent.width * 0.9 - - Column { - id: mainColumn - - anchors.centerIn: parent - - width: parent.width - 50 - - spacing: 10 - - Repeater { - model: MailModel {} - - delegate: Column { - id: delegateRoot - - width: mainColumn.width - - Loader { - id: loader - } - - Component.onCompleted: { - switch (model.type) { - case "red": - loader.source = "Rect2.qml"; - break; - case "green": - loader.source = "Rect1.qml"; - break; - case "encrypted": - loader.source = "EncryptedPart.qml"; - break; - case "frame": - loader.source = "Frame.qml"; - break; - case "plaintext": - loader.source = "TextPart.qml"; - break; - } - } - } - } - } - } -} diff --git a/components/mailviewer/qml/EmbededPart.qml b/components/mailviewer/qml/EmbededPart.qml new file mode 100644 index 00000000..11d1081c --- /dev/null +++ b/components/mailviewer/qml/EmbededPart.qml @@ -0,0 +1,36 @@ +import QtQuick 2.4 + +Item { + + height: mailPart.height + width: mailPart.width + + + Rectangle { + id: border + color: "lightgrey" + height: mailPart.height + width: 5 + } + + Text { + id: sender + + anchors { + left: border.right + leftMargin: 15 + } + + text: "sent by " + model.sender + " on " + model.date + color: "grey" + } + + MailPart { + id: mailPart + + anchors.top: sender.bottom + + } + +} + diff --git a/components/mailviewer/qml/EncryptedPart.qml b/components/mailviewer/qml/EncryptedPart.qml new file mode 100644 index 00000000..9f4b984e --- /dev/null +++ b/components/mailviewer/qml/EncryptedPart.qml @@ -0,0 +1,51 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.5 + +Item { + + height: mailPart.height + width: mailPart.width + + // Rectangle { + // id: border + + // border.width: 5 + // border.color: "lightgreen" + //} + + BorderImage { + + anchors.fill: parent + border { left: 40; top: 40; right: 40; bottom: 40 } + horizontalTileMode: BorderImage.Repeat + verticalTileMode: BorderImage.Repeat + + source: model.trusted ? "bordergreen.png" : "bordergrey.png" + } + + MailPart { + id: mailPart + + } + + Rectangle { + + anchors { + top: parent.top + right: parent.right + } + + height: 50 + width: 50 + + radius: 100 + + color: model.trusted ? "lightgreen" : "lightgrey" + + ToolButton { + anchors.fill: parent + + iconName: "document-encrypt" + } + } +} diff --git a/components/mailviewer/qml/MailModel.qml b/components/mailviewer/qml/MailModel.qml new file mode 100644 index 00000000..8177b9d4 --- /dev/null +++ b/components/mailviewer/qml/MailModel.qml @@ -0,0 +1,32 @@ +import QtQuick 2.4 + +ListModel { + + ListElement { + type: "encrypted" + trusted: true + content: [ + ListElement { + type: "plaintext" + textContent: "Moin, \n find the forwarded mail below. \n \n - M" + embeded: false + }, + ListElement { + type: "embeded" + sender: "Senderson" + date: "05/05/2055" + content: [ + ListElement{ + type: "plaintext" + textContent: "sender mc senderson is a sender. sender mc senderson is a sender. sender mc senderson is a mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc senderson is a sender sender mc a sender sender mc is a sender sender mc senderson is a sendersender mc senderson is a sender" + embeded: true + }] + } + ] + } + ListElement { + type: "plaintext" + textContent: "footer mc footerson" + embeded: false + } +} diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml new file mode 100644 index 00000000..d7ae425f --- /dev/null +++ b/components/mailviewer/qml/MailPart.qml @@ -0,0 +1,61 @@ +import QtQuick 2.4 + +Item { + id: root + + height: partColumn.height + 40 + width: delegateRoot.width + + Column { + id: partColumn + + anchors { + top: parent.top + left: parent.left + right: parent.right + margins: 20 + } + + spacing: 10 + + Repeater { + model: content + + delegate: Column { + id: delegateRoot + + width: partColumn.width + + Loader { + id: loader + } + + Component.onCompleted: { + + switch (model.type) { + case "encrypted": + loader.source = "EncryptedPart.qml"; + break; + case "embeded": + loader.source = "EmbededPart.qml"; + break; + case "frame": + loader.source = "Frame.qml" + break; + case "plaintext": + loader.source = "TextPart.qml"; + break; + } + } + } + } + + + Item { + id: footer + + height: 5 + width: 10 + } + } +} diff --git a/components/mailviewer/qml/TextPart.qml b/components/mailviewer/qml/TextPart.qml new file mode 100644 index 00000000..3a4c8d22 --- /dev/null +++ b/components/mailviewer/qml/TextPart.qml @@ -0,0 +1,10 @@ +import QtQuick 2.4 + +Text { + width: delegateRoot.width + + text: model.textContent + wrapMode: Text.WordWrap + + color: embeded ? "grey" : "black" +} diff --git a/components/mailviewer/qml/bordergreen.png b/components/mailviewer/qml/bordergreen.png new file mode 100644 index 00000000..9071d809 Binary files /dev/null and b/components/mailviewer/qml/bordergreen.png differ diff --git a/components/mailviewer/qml/bordergrey.png b/components/mailviewer/qml/bordergrey.png new file mode 100644 index 00000000..1baa8345 Binary files /dev/null and b/components/mailviewer/qml/bordergrey.png differ diff --git a/components/mailviewer/qml/dummyapp.qml b/components/mailviewer/qml/dummyapp.qml new file mode 100644 index 00000000..878b77ed --- /dev/null +++ b/components/mailviewer/qml/dummyapp.qml @@ -0,0 +1,69 @@ +import QtQuick 2.4 + +Rectangle { + id: app + + width: 1200 + height: 700 + + Rectangle { + anchors.fill: parent + + color: "black" + + opacity: 0.8 + + } + + Rectangle { + + anchors.centerIn: parent + + height: mainColumn.height + 50 + width: parent.width * 0.9 + + Column { + id: mainColumn + + anchors.centerIn: parent + + width: parent.width - 50 + + spacing: 10 + + Repeater { + model: MailModel {} + + delegate: Column { + id: delegateRoot + + width: mainColumn.width + + Loader { + id: loader + } + + Component.onCompleted: { + switch (model.type) { + case "red": + loader.source = "Rect2.qml"; + break; + case "green": + loader.source = "Rect1.qml"; + break; + case "encrypted": + loader.source = "EncryptedPart.qml"; + break; + case "frame": + loader.source = "Frame.qml"; + break; + case "plaintext": + loader.source = "TextPart.qml"; + break; + } + } + } + } + } + } +} -- cgit v1.2.3 From 217819aa165a72c5c006f3b980e4dc8a4db213c0 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 15 Sep 2016 09:06:19 +0200 Subject: add security border images made by Jens Reuterberg --- components/mailviewer/qml/bordergreen.png | Bin 1821 -> 0 bytes components/mailviewer/qml/bordergrey.png | Bin 646 -> 0 bytes components/mailviewer/qml/securitybordersGRAY.png | Bin 0 -> 734 bytes components/mailviewer/qml/securitybordersGREEN.png | Bin 0 -> 725 bytes components/mailviewer/qml/securitybordersRED.png | Bin 0 -> 725 bytes components/mailviewer/qml/securitybordersYELLOW.png | Bin 0 -> 735 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 components/mailviewer/qml/bordergreen.png delete mode 100644 components/mailviewer/qml/bordergrey.png create mode 100644 components/mailviewer/qml/securitybordersGRAY.png create mode 100644 components/mailviewer/qml/securitybordersGREEN.png create mode 100644 components/mailviewer/qml/securitybordersRED.png create mode 100644 components/mailviewer/qml/securitybordersYELLOW.png diff --git a/components/mailviewer/qml/bordergreen.png b/components/mailviewer/qml/bordergreen.png deleted file mode 100644 index 9071d809..00000000 Binary files a/components/mailviewer/qml/bordergreen.png and /dev/null differ diff --git a/components/mailviewer/qml/bordergrey.png b/components/mailviewer/qml/bordergrey.png deleted file mode 100644 index 1baa8345..00000000 Binary files a/components/mailviewer/qml/bordergrey.png and /dev/null differ diff --git a/components/mailviewer/qml/securitybordersGRAY.png b/components/mailviewer/qml/securitybordersGRAY.png new file mode 100644 index 00000000..f8b768a8 Binary files /dev/null and b/components/mailviewer/qml/securitybordersGRAY.png differ diff --git a/components/mailviewer/qml/securitybordersGREEN.png b/components/mailviewer/qml/securitybordersGREEN.png new file mode 100644 index 00000000..8de8c534 Binary files /dev/null and b/components/mailviewer/qml/securitybordersGREEN.png differ diff --git a/components/mailviewer/qml/securitybordersRED.png b/components/mailviewer/qml/securitybordersRED.png new file mode 100644 index 00000000..f28ed990 Binary files /dev/null and b/components/mailviewer/qml/securitybordersRED.png differ diff --git a/components/mailviewer/qml/securitybordersYELLOW.png b/components/mailviewer/qml/securitybordersYELLOW.png new file mode 100644 index 00000000..a40a8887 Binary files /dev/null and b/components/mailviewer/qml/securitybordersYELLOW.png differ -- cgit v1.2.3 From 711ac9758976f1e2412b28b7b1a80780eec4641f Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 15 Sep 2016 09:35:09 +0200 Subject: use new security boder images --- components/mailviewer/qml/EncryptedPart.qml | 38 +++++------------------------ components/mailviewer/qml/MailModel.qml | 2 +- 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/components/mailviewer/qml/EncryptedPart.qml b/components/mailviewer/qml/EncryptedPart.qml index 9f4b984e..eba6c035 100644 --- a/components/mailviewer/qml/EncryptedPart.qml +++ b/components/mailviewer/qml/EncryptedPart.qml @@ -3,49 +3,23 @@ import QtQuick.Controls 1.5 Item { - height: mailPart.height - width: mailPart.width - - // Rectangle { - // id: border - - // border.width: 5 - // border.color: "lightgreen" - //} + height: mailPart.height + 20 + width: mailPart.width + 20 BorderImage { anchors.fill: parent border { left: 40; top: 40; right: 40; bottom: 40 } - horizontalTileMode: BorderImage.Repeat - verticalTileMode: BorderImage.Repeat + horizontalTileMode: BorderImage.Round + verticalTileMode: BorderImage.Round - source: model.trusted ? "bordergreen.png" : "bordergrey.png" + source: "securityborders" + model.securityLevel + ".png" } MailPart { id: mailPart - } - - Rectangle { - - anchors { - top: parent.top - right: parent.right - } - - height: 50 - width: 50 - - radius: 100 - - color: model.trusted ? "lightgreen" : "lightgrey" - - ToolButton { - anchors.fill: parent + anchors.centerIn: parent - iconName: "document-encrypt" - } } } diff --git a/components/mailviewer/qml/MailModel.qml b/components/mailviewer/qml/MailModel.qml index 8177b9d4..808a8d5b 100644 --- a/components/mailviewer/qml/MailModel.qml +++ b/components/mailviewer/qml/MailModel.qml @@ -4,7 +4,7 @@ ListModel { ListElement { type: "encrypted" - trusted: true + securityLevel: "GREEN" content: [ ListElement { type: "plaintext" -- cgit v1.2.3 From 98e17d6a8ecd46a9d6956d81f781b05e940387e4 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 15 Sep 2016 11:58:26 +0200 Subject: Adapt to KAsync changes. --- accounts/imap/tests/settingstest.cpp | 4 +- accounts/maildir/tests/settingstest.cpp | 4 +- framework/actions/actionhandler.cpp | 12 ++-- framework/domain/accountfactory.cpp | 2 +- framework/domain/accountscontroller.cpp | 10 +-- framework/domain/actions/sinkactions.cpp | 4 +- framework/domain/composercontroller.cpp | 2 +- framework/domain/folderlistmodel.cpp | 2 +- framework/domain/identitiesmodel.cpp | 2 +- framework/domain/settings/accountsettings.cpp | 88 +++++++++++++-------------- 10 files changed, 63 insertions(+), 67 deletions(-) diff --git a/accounts/imap/tests/settingstest.cpp b/accounts/imap/tests/settingstest.cpp index 4301943c..2fbc9b7b 100644 --- a/accounts/imap/tests/settingstest.cpp +++ b/accounts/imap/tests/settingstest.cpp @@ -43,7 +43,7 @@ private slots: settings.setProperty("emailAddress", emailAddress); settings.save(); - Sink::Store::fetchAll(Sink::Query()).then>([](const QList &resources) { + Sink::Store::fetchAll(Sink::Query()).syncThen>([](const QList &resources) { QCOMPARE(resources.size(), 2); }) .exec().waitForFinished(); @@ -76,7 +76,7 @@ private slots: settings.remove(); } - Sink::Store::fetchAll(Sink::Query()).then>([](const QList &resources) { + Sink::Store::fetchAll(Sink::Query()).syncThen>([](const QList &resources) { QCOMPARE(resources.size(), 0); }) .exec().waitForFinished(); diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp index 342a3b40..47cb3b35 100644 --- a/accounts/maildir/tests/settingstest.cpp +++ b/accounts/maildir/tests/settingstest.cpp @@ -39,7 +39,7 @@ private slots: settings.setProperty("emailAddress", emailAddress); settings.save(); - Sink::Store::fetchAll(Sink::Query()).then>([](const QList &resources) { + Sink::Store::fetchAll(Sink::Query()).syncThen>([](const QList &resources) { QCOMPARE(resources.size(), 2); }) .exec().waitForFinished(); @@ -70,7 +70,7 @@ private slots: settings.remove(); } - Sink::Store::fetchAll(Sink::Query()).then>([](const QList &resources) { + Sink::Store::fetchAll(Sink::Query()).syncThen>([](const QList &resources) { QCOMPARE(resources.size(), 0); }) .exec().waitForFinished(); diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp index 4ae8d0a9..9d58f464 100644 --- a/framework/actions/actionhandler.cpp +++ b/framework/actions/actionhandler.cpp @@ -106,14 +106,12 @@ ActionResult ActionHandlerHelper::execute(Context *context) handlerFunction(context); result.setDone(); } else { - jobHandlerFunction(context).then([=]() { + jobHandlerFunction(context).syncThen([=](const KAsync::Error &error) { auto modifyableResult = result; - modifyableResult.setDone(); - }, - [=](int errorCode, const QString &string) { - qWarning() << "Job failed: " << errorCode << string; - auto modifyableResult = result; - modifyableResult.setError(1); + if (error) { + qWarning() << "Job failed: " << error.errorCode << error.errorMessage; + modifyableResult.setError(1); + } modifyableResult.setDone(); }).exec(); } diff --git a/framework/domain/accountfactory.cpp b/framework/domain/accountfactory.cpp index 10f01f65..6261eaf1 100644 --- a/framework/domain/accountfactory.cpp +++ b/framework/domain/accountfactory.cpp @@ -44,7 +44,7 @@ void AccountFactory::setAccountId(const QString &accountId) { mAccountId = accountId; Sink::Store::fetchOne(Sink::Query::IdentityFilter(accountId.toUtf8())) - .then([this](const Sink::ApplicationDomain::SinkAccount &account) { + .syncThen([this](const Sink::ApplicationDomain::SinkAccount &account) { mAccountType = account.getProperty("type").toByteArray(); loadPackage(); }).exec(); diff --git a/framework/domain/accountscontroller.cpp b/framework/domain/accountscontroller.cpp index 2f47fa03..5cb60d0c 100644 --- a/framework/domain/accountscontroller.cpp +++ b/framework/domain/accountscontroller.cpp @@ -34,9 +34,9 @@ void AccountsController::createAccount(const QString &accountType) { auto account = Sink::ApplicationDomain::ApplicationDomainType::createEntity(); account.setProperty("type", accountType); - Sink::Store::create(account).then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while creating account: " << errorMessage; - }) - .exec(); + Sink::Store::create(account).syncThen([](const KAsync::Error &error) { + if (error) { + qWarning() << "Error while creating account: " << error.errorMessage; + } + }).exec(); } diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp index 921fe748..f8a4e9ff 100644 --- a/framework/domain/actions/sinkactions.cpp +++ b/framework/domain/actions/sinkactions.cpp @@ -106,7 +106,7 @@ static ActionHandlerHelper sendMailHandler("org.kde.kube.actions.sendmail", query += Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport); query += Sink::Query::AccountFilter(accountId); Sink::Store::fetchAll(query) - .then, QList>([=](const QList &resources) -> KAsync::Job { + .then>([=](const QList &resources) -> KAsync::Job { if (!resources.isEmpty()) { auto resourceId = resources[0]->identifier(); SinkTrace() << "Sending message via resource: " << resourceId; @@ -141,7 +141,7 @@ static ActionHandlerHelper saveAsDraft("org.kde.kube.actions.save-as-draft", query += Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::drafts); query += Sink::Query::AccountFilter(accountId); return Sink::Store::fetchOne(query) - .then, Sink::ApplicationDomain::SinkResource>([=](const Sink::ApplicationDomain::SinkResource &resource) -> KAsync::Job { + .then([=](const Sink::ApplicationDomain::SinkResource &resource) -> KAsync::Job { Sink::ApplicationDomain::Mail mail(resource.identifier()); mail.setProperty("draft", true); mail.setBlobProperty("mimeMessage", message->encodedContent()); diff --git a/framework/domain/composercontroller.cpp b/framework/domain/composercontroller.cpp index 2dcf1bb1..b2ad7ecc 100644 --- a/framework/domain/composercontroller.cpp +++ b/framework/domain/composercontroller.cpp @@ -133,7 +133,7 @@ void ComposerController::loadMessage(const QVariant &message, bool loadAsDraft) { Sink::Query query(*message.value()); query.request(); - Sink::Store::fetchOne(query).then([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { + Sink::Store::fetchOne(query).syncThen([this, loadAsDraft](const Sink::ApplicationDomain::Mail &mail) { m_existingMail = mail; const auto mailData = KMime::CRLFtoLF(mail.getMimeMessage()); if (!mailData.isEmpty()) { diff --git a/framework/domain/folderlistmodel.cpp b/framework/domain/folderlistmodel.cpp index 14d3d5a7..000dd263 100644 --- a/framework/domain/folderlistmodel.cpp +++ b/framework/domain/folderlistmodel.cpp @@ -74,7 +74,7 @@ void FolderListModel::setAccountId(const QVariant &accountId) { const auto account = accountId.toString().toUtf8(); Sink::Store::fetchAll(Sink::Query::PropertyFilter("account", QVariant::fromValue(account))) - .then>([this, account](const QList &resources) { + .syncThen>([this, account](const QList &resources) { Sink::Query query; query.liveQuery = true; query.requestedProperties << "name" << "icon" << "parent"; diff --git a/framework/domain/identitiesmodel.cpp b/framework/domain/identitiesmodel.cpp index adb5d625..1958d2f5 100644 --- a/framework/domain/identitiesmodel.cpp +++ b/framework/domain/identitiesmodel.cpp @@ -83,7 +83,7 @@ void IdentitiesModel::runQuery(const Sink::Query &query) setSourceModel(mModel.data()); Sink::Store::fetchAll(Sink::Query()) - .then >([this](const QList &accounts) { + .syncThen >([this](const QList &accounts) { for (const auto &account : accounts) { mAccountNames.insert(account->identifier(), account->getProperty("name").toString()); mAccountIcons.insert(account->identifier(), account->getProperty("icon").toString()); diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp index cf348f39..9a3be059 100644 --- a/framework/domain/settings/accountsettings.cpp +++ b/framework/domain/settings/accountsettings.cpp @@ -135,18 +135,18 @@ void AccountSettings::saveAccount() account.setProperty("name", mName); account.setProperty("icon", mIcon); Q_ASSERT(!account.identifier().isEmpty()); - Sink::Store::modify(account).then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while creating account: " << errorMessage; - }) - .exec(); + Sink::Store::modify(account) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while creating account: " << error.errorMessage;; + }) + .exec(); } void AccountSettings::loadAccount() { Q_ASSERT(!mAccountIdentifier.isEmpty()); Sink::Store::fetchOne(Sink::Query::IdentityFilter(mAccountIdentifier)) - .then([this](const Sink::ApplicationDomain::SinkAccount &account) { + .syncThen([this](const Sink::ApplicationDomain::SinkAccount &account) { mIcon = account.getProperty("icon").toString(); mName = account.getProperty("name").toString(); emit changed(); @@ -156,46 +156,43 @@ void AccountSettings::loadAccount() void AccountSettings::loadImapResource() { Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) - .then([this](const Sink::ApplicationDomain::SinkResource &resource) { + .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { mImapIdentifier = resource.identifier(); mImapServer = resource.getProperty("server").toString(); mImapUsername = resource.getProperty("username").toString(); mImapPassword = resource.getProperty("password").toString(); emit imapResourceChanged(); - }, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Failed to find the imap resource: " << errorMessage; + }).onError([](const KAsync::Error &error) { + qWarning() << "Failed to find the imap resource: " << error.errorMessage; }).exec(); } void AccountSettings::loadMaildirResource() { Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) - .then([this](const Sink::ApplicationDomain::SinkResource &resource) { + .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { mMaildirIdentifier = resource.identifier(); auto path = resource.getProperty("path").toString(); if (mPath != path) { mPath = path; emit pathChanged(); } - }, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Failed to find the maildir resource: " << errorMessage; + }).onError([](const KAsync::Error &error) { + qWarning() << "Failed to find the maildir resource: " << error.errorMessage; }).exec(); } void AccountSettings::loadMailtransportResource() { Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport)) - .then([this](const Sink::ApplicationDomain::SinkResource &resource) { + .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { mMailtransportIdentifier = resource.identifier(); mSmtpServer = resource.getProperty("server").toString(); mSmtpUsername = resource.getProperty("username").toString(); mSmtpPassword = resource.getProperty("password").toString(); emit smtpResourceChanged(); - }, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Failed to find the smtp resource: " << errorMessage; + }).onError([](const KAsync::Error &error) { + qWarning() << "Failed to find the smtp resource: " << error.errorMessage; }).exec(); } @@ -203,14 +200,13 @@ void AccountSettings::loadIdentity() { //FIXME this assumes that we only ever have one identity per account Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier)) - .then([this](const Sink::ApplicationDomain::Identity &identity) { + .syncThen([this](const Sink::ApplicationDomain::Identity &identity) { mIdentityIdentifier = identity.identifier(); mUsername = identity.getProperty("username").toString(); mEmailAddress = identity.getProperty("address").toString(); emit identityChanged(); - }, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Failed to find the identity resource: " << errorMessage; + }).onError([](const KAsync::Error &error) { + qWarning() << "Failed to find the identity resource: " << error.errorMessage; }).exec(); } @@ -224,21 +220,22 @@ static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteA for (const auto &pair : properties) { resource.setProperty(pair.first, pair.second); } - Sink::Store::modify(resource).then([](){}, [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while modifying resource: " << errorMessage; - }) - .exec(); + Sink::Store::modify(resource) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while modifying resource: " << error.errorMessage; + }) + .exec(); } else { auto resource = ResourceType::create(accountIdentifier); auto newIdentifier = resource.identifier(); for (const auto &pair : properties) { resource.setProperty(pair.first, pair.second); } - Sink::Store::create(resource).template then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while creating resource: " << errorMessage; - }) - .exec(); + Sink::Store::create(resource) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while creating resource: " << error.errorMessage; + }) + .exec(); return newIdentifier; } return identifier; @@ -275,8 +272,9 @@ void AccountSettings::saveIdentity() Sink::ApplicationDomain::Identity identity(mMailtransportIdentifier); identity.setProperty("username", mUsername); identity.setProperty("address", mEmailAddress); - Sink::Store::modify(identity).then([](){}, [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while modifying identity: " << errorMessage; + Sink::Store::modify(identity) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while modifying identity: " << error.errorMessage; }) .exec(); } else { @@ -285,9 +283,9 @@ void AccountSettings::saveIdentity() identity.setProperty("account", mAccountIdentifier); identity.setProperty("username", mUsername); identity.setProperty("address", mEmailAddress); - Sink::Store::create(identity).then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while creating identity: " << errorMessage; + Sink::Store::create(identity) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while creating identity: " << error.errorMessage; }) .exec(); } @@ -299,9 +297,9 @@ void AccountSettings::removeResource(const QByteArray &identifier) qWarning() << "We're missing an identifier"; } else { Sink::ApplicationDomain::SinkResource resource("", identifier, 0, QSharedPointer::create()); - Sink::Store::remove(resource).template then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while removing resource: " << errorMessage; + Sink::Store::remove(resource) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while removing resource: " << error.errorMessage; }) .exec(); } @@ -313,9 +311,9 @@ void AccountSettings::removeAccount() qWarning() << "We're missing an identifier"; } else { Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer::create()); - Sink::Store::remove(account).then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while removing account: " << errorMessage; + Sink::Store::remove(account) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while removing account: " << error.errorMessage; }) .exec(); } @@ -327,9 +325,9 @@ void AccountSettings::removeIdentity() qWarning() << "We're missing an identifier"; } else { Sink::ApplicationDomain::Identity identity("", mIdentityIdentifier, 0, QSharedPointer::create()); - Sink::Store::remove(identity).then([]() {}, - [](int errorCode, const QString &errorMessage) { - qWarning() << "Error while removing identity: " << errorMessage; + Sink::Store::remove(identity) + .onError([](const KAsync::Error &error) { + qWarning() << "Error while removing identity: " << error.errorMessage; }) .exec(); } -- cgit v1.2.3 From 9afc6c4b38b2d24783f26d82e155308af6685485 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 22 Sep 2016 10:58:19 +0200 Subject: mailviewer: add signed part --- components/mailviewer/qml/SignedPart.qml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 components/mailviewer/qml/SignedPart.qml diff --git a/components/mailviewer/qml/SignedPart.qml b/components/mailviewer/qml/SignedPart.qml new file mode 100644 index 00000000..729a2a8d --- /dev/null +++ b/components/mailviewer/qml/SignedPart.qml @@ -0,0 +1,26 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.5 + +Item { + + height: mailPart.height + 20 + width: mailPart.width + 20 + + BorderImage { + + anchors.fill: parent + border { left: 40; top: 40; right: 40; bottom: 40 } + horizontalTileMode: BorderImage.Round + verticalTileMode: BorderImage.Round + + source: "securityborders" + model.securityLevel + ".png" + } + + MailPart { + id: mailPart + + anchors.centerIn: parent + + } +} + -- cgit v1.2.3 From 9bae06b6cc73a50e1aebac83e4b6a05ebce293c9 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 22 Sep 2016 11:02:10 +0200 Subject: add license headers to mailviewer --- components/mailviewer/qml/EmbededPart.qml | 18 ++++++++++++++++++ components/mailviewer/qml/EncryptedPart.qml | 18 ++++++++++++++++++ components/mailviewer/qml/MailModel.qml | 18 ++++++++++++++++++ components/mailviewer/qml/MailPart.qml | 18 ++++++++++++++++++ components/mailviewer/qml/SignedPart.qml | 18 ++++++++++++++++++ components/mailviewer/qml/TextPart.qml | 18 ++++++++++++++++++ components/mailviewer/qml/dummyapp.qml | 18 ++++++++++++++++++ 7 files changed, 126 insertions(+) diff --git a/components/mailviewer/qml/EmbededPart.qml b/components/mailviewer/qml/EmbededPart.qml index 11d1081c..8921ab6f 100644 --- a/components/mailviewer/qml/EmbededPart.qml +++ b/components/mailviewer/qml/EmbededPart.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 Item { diff --git a/components/mailviewer/qml/EncryptedPart.qml b/components/mailviewer/qml/EncryptedPart.qml index eba6c035..18a5d588 100644 --- a/components/mailviewer/qml/EncryptedPart.qml +++ b/components/mailviewer/qml/EncryptedPart.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.5 diff --git a/components/mailviewer/qml/MailModel.qml b/components/mailviewer/qml/MailModel.qml index 808a8d5b..d18f5ece 100644 --- a/components/mailviewer/qml/MailModel.qml +++ b/components/mailviewer/qml/MailModel.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 ListModel { diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml index d7ae425f..4917271b 100644 --- a/components/mailviewer/qml/MailPart.qml +++ b/components/mailviewer/qml/MailPart.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 Item { diff --git a/components/mailviewer/qml/SignedPart.qml b/components/mailviewer/qml/SignedPart.qml index 729a2a8d..f0daedeb 100644 --- a/components/mailviewer/qml/SignedPart.qml +++ b/components/mailviewer/qml/SignedPart.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.5 diff --git a/components/mailviewer/qml/TextPart.qml b/components/mailviewer/qml/TextPart.qml index 3a4c8d22..5f183852 100644 --- a/components/mailviewer/qml/TextPart.qml +++ b/components/mailviewer/qml/TextPart.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 Text { diff --git a/components/mailviewer/qml/dummyapp.qml b/components/mailviewer/qml/dummyapp.qml index 878b77ed..25892f8e 100644 --- a/components/mailviewer/qml/dummyapp.qml +++ b/components/mailviewer/qml/dummyapp.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 Rectangle { -- cgit v1.2.3 From 3ad9814b98b6405d0f9b6c7b89413465631d2504 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 22 Sep 2016 11:42:52 +0200 Subject: add htmlpart and a model for testing it --- components/mailviewer/qml/HtmlPart.qml | 48 ++++++++++++++++++++++++++++++++ components/mailviewer/qml/MailModel2.qml | 28 +++++++++++++++++++ components/mailviewer/qml/MailPart.qml | 3 ++ components/mailviewer/qml/dummyapp.qml | 3 ++ 4 files changed, 82 insertions(+) create mode 100644 components/mailviewer/qml/HtmlPart.qml create mode 100644 components/mailviewer/qml/MailModel2.qml diff --git a/components/mailviewer/qml/HtmlPart.qml b/components/mailviewer/qml/HtmlPart.qml new file mode 100644 index 00000000..f1add75c --- /dev/null +++ b/components/mailviewer/qml/HtmlPart.qml @@ -0,0 +1,48 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtWebKit 3.0 +// import QtWebEngine 1.3 //This would give use contentsSize +import QtWebEngine 1.2 + +Item { + id: root + property string content: model.htmlContent + property int contentHeight: helperView.contentHeight; + //FIXME workaround until QtWebEngine 1.3 with contentsSize + + height: contentHeight + width: delegateRoot.width + + WebView { + id: helperView + visible: false + Component.onCompleted: loadHtml(content, "file:///") + } + WebEngineView { + id: htmlView + anchors.fill: parent + Component.onCompleted: loadHtml(content, "file:///") + } + onContentChanged: { + htmlView.loadHtml(content, "file:///"); + helperView.loadHtml(content, "file:///"); + } +} diff --git a/components/mailviewer/qml/MailModel2.qml b/components/mailviewer/qml/MailModel2.qml new file mode 100644 index 00000000..9ea45d57 --- /dev/null +++ b/components/mailviewer/qml/MailModel2.qml @@ -0,0 +1,28 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 + +ListModel { + + ListElement { + type: "html" + htmlContent: "

Some Heading

My some paragraph.

" + } +} + diff --git a/components/mailviewer/qml/MailPart.qml b/components/mailviewer/qml/MailPart.qml index 4917271b..966337cd 100644 --- a/components/mailviewer/qml/MailPart.qml +++ b/components/mailviewer/qml/MailPart.qml @@ -63,6 +63,9 @@ Item { case "plaintext": loader.source = "TextPart.qml"; break; + case "html": + loader.source = "HtmlPart.qml"; + break; } } } diff --git a/components/mailviewer/qml/dummyapp.qml b/components/mailviewer/qml/dummyapp.qml index 25892f8e..a186f0f1 100644 --- a/components/mailviewer/qml/dummyapp.qml +++ b/components/mailviewer/qml/dummyapp.qml @@ -78,6 +78,9 @@ Rectangle { case "plaintext": loader.source = "TextPart.qml"; break; + case "html": + loader.source = "HtmlPart.qml"; + break; } } } -- cgit v1.2.3 From 06ffde93ce2c7a675b3ee56e5dc5744b53696fc5 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 26 Sep 2016 10:25:33 +0200 Subject: relicense under gplv2+ --- components/mail/contents/ui/main.qml | 34 ++++++++++++---------- components/package/contents/ui/AccountSwitcher.qml | 33 +++++++++++---------- components/package/contents/ui/Avatar.qml | 31 ++++++++++---------- components/package/contents/ui/Composer.qml | 31 ++++++++++---------- components/package/contents/ui/ContentView.qml | 18 ++++++++++++ .../package/contents/ui/EditAccountDialog.qml | 31 ++++++++++---------- components/package/contents/ui/FocusComposer.qml | 31 ++++++++++---------- components/package/contents/ui/FolderListView.qml | 31 ++++++++++---------- components/package/contents/ui/ListItem.qml | 31 ++++++++++---------- components/package/contents/ui/MailListView.qml | 31 ++++++++++---------- components/package/contents/ui/MailViewer.qml | 18 ++++++++++++ components/package/contents/ui/MessagePartTree.qml | 18 ++++++++++++ .../package/contents/ui/NewAccountDialog.qml | 31 ++++++++++---------- components/package/contents/ui/Outbox.qml | 31 ++++++++++---------- components/package/contents/ui/OverlayDialog.qml | 33 +++++++++++---------- components/package/contents/ui/SingleMailView.qml | 33 +++++++++++---------- components/package/contents/ui/TextView.qml | 18 ++++++++++++ components/package/contents/ui/WebView.qml | 18 ++++++++++++ 18 files changed, 303 insertions(+), 199 deletions(-) diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 4cda7f8e..ef167bbe 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -1,19 +1,21 @@ /* - * Copyright (C) 2015 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2015 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.3 @@ -280,4 +282,4 @@ ApplicationWindow { } } //END ToolBar -} \ No newline at end of file +} diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index cb79b6e4..8767e96e 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.3 @@ -192,4 +193,4 @@ Button { } } } -} \ No newline at end of file +} diff --git a/components/package/contents/ui/Avatar.qml b/components/package/contents/ui/Avatar.qml index cfd031b3..dfe14ce7 100644 --- a/components/package/contents/ui/Avatar.qml +++ b/components/package/contents/ui/Avatar.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2015 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.3 diff --git a/components/package/contents/ui/Composer.qml b/components/package/contents/ui/Composer.qml index 1558ba0a..e8dc4e1a 100644 --- a/components/package/contents/ui/Composer.qml +++ b/components/package/contents/ui/Composer.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 diff --git a/components/package/contents/ui/ContentView.qml b/components/package/contents/ui/ContentView.qml index a8f4c437..099d5c5d 100644 --- a/components/package/contents/ui/ContentView.qml +++ b/components/package/contents/ui/ContentView.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.3 diff --git a/components/package/contents/ui/EditAccountDialog.qml b/components/package/contents/ui/EditAccountDialog.qml index 887f50e1..6045faf8 100644 --- a/components/package/contents/ui/EditAccountDialog.qml +++ b/components/package/contents/ui/EditAccountDialog.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml index 4d5499d9..bbee1edc 100644 --- a/components/package/contents/ui/FocusComposer.qml +++ b/components/package/contents/ui/FocusComposer.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index c8284b0a..bf4263c4 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2015 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 diff --git a/components/package/contents/ui/ListItem.qml b/components/package/contents/ui/ListItem.qml index bea3c11b..0f3b7af9 100644 --- a/components/package/contents/ui/ListItem.qml +++ b/components/package/contents/ui/ListItem.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2015 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import org.kube.framework.theme 1.0 diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index d0278833..ff71e43e 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2015 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 as Controls diff --git a/components/package/contents/ui/MailViewer.qml b/components/package/contents/ui/MailViewer.qml index 9abd30be..5365be66 100644 --- a/components/package/contents/ui/MailViewer.qml +++ b/components/package/contents/ui/MailViewer.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Controls 1.4 diff --git a/components/package/contents/ui/MessagePartTree.qml b/components/package/contents/ui/MessagePartTree.qml index 8bc13e6e..a904f42c 100644 --- a/components/package/contents/ui/MessagePartTree.qml +++ b/components/package/contents/ui/MessagePartTree.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.3 diff --git a/components/package/contents/ui/NewAccountDialog.qml b/components/package/contents/ui/NewAccountDialog.qml index 9183be65..e565cb6a 100644 --- a/components/package/contents/ui/NewAccountDialog.qml +++ b/components/package/contents/ui/NewAccountDialog.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 diff --git a/components/package/contents/ui/Outbox.qml b/components/package/contents/ui/Outbox.qml index ff049683..01501410 100644 --- a/components/package/contents/ui/Outbox.qml +++ b/components/package/contents/ui/Outbox.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.3 diff --git a/components/package/contents/ui/OverlayDialog.qml b/components/package/contents/ui/OverlayDialog.qml index 226ed79d..da75ca99 100644 --- a/components/package/contents/ui/OverlayDialog.qml +++ b/components/package/contents/ui/OverlayDialog.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 @@ -59,4 +60,4 @@ Item { anchors.fill: parent } } -} \ No newline at end of file +} diff --git a/components/package/contents/ui/SingleMailView.qml b/components/package/contents/ui/SingleMailView.qml index ea8a7730..b06216dd 100644 --- a/components/package/contents/ui/SingleMailView.qml +++ b/components/package/contents/ui/SingleMailView.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2015 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.3 @@ -229,4 +230,4 @@ Item { } } } -} \ No newline at end of file +} diff --git a/components/package/contents/ui/TextView.qml b/components/package/contents/ui/TextView.qml index 7c2f3153..d0ff9999 100644 --- a/components/package/contents/ui/TextView.qml +++ b/components/package/contents/ui/TextView.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.3 diff --git a/components/package/contents/ui/WebView.qml b/components/package/contents/ui/WebView.qml index 01998911..4c7aab53 100644 --- a/components/package/contents/ui/WebView.qml +++ b/components/package/contents/ui/WebView.qml @@ -1,3 +1,21 @@ +/* + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + import QtQuick 2.4 import QtQuick.Controls 1.3 import QtWebKit 3.0 -- cgit v1.2.3 From acae662cf3aee020f3c5e2eb5876e562926cb931 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 26 Sep 2016 10:29:24 +0200 Subject: more gplv3 -> gplv2+ --- .../package/contents/ui/ImapAccountSettings.qml | 32 ++++++++++------------ .../contents/ui/KolabnowAccountSettings.qml | 31 +++++++++++---------- .../package/contents/ui/MaildirAccountSettings.qml | 31 +++++++++++---------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index 3b277a5f..83886572 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -1,21 +1,19 @@ /* - * Copyright 2016 Michael Bohlender michael.bohlender@kdemail.net - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.4 diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml index 274b9207..753762b7 100644 --- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml +++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index 4db7177b..d867c264 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 Michael Bohlender - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ + Copyright (C) 2016 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ import QtQuick 2.4 import QtQuick.Controls 1.4 -- cgit v1.2.3 From dd060cc5e3b336a77f8e5e76df4bc76a58e22cd4 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 4 Oct 2016 12:10:06 +0200 Subject: Adapted to new query api --- framework/domain/actions/sinkactions.cpp | 15 ++++++++------- framework/domain/folderlistmodel.cpp | 23 +++++++++++------------ framework/domain/settings/accountsettings.cpp | 8 ++++---- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp index f8a4e9ff..47041a5b 100644 --- a/framework/domain/actions/sinkactions.cpp +++ b/framework/domain/actions/sinkactions.cpp @@ -28,6 +28,7 @@ SINK_DEBUG_AREA("sinkactions") using namespace Kube; +using namespace Sink; static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", [](Context *context) -> bool { @@ -102,11 +103,11 @@ static ActionHandlerHelper sendMailHandler("org.kde.kube.actions.sendmail", auto message = context->property("message").value(); SinkLog() << "Sending a mail: "; - Sink::Query query; - query += Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport); - query += Sink::Query::AccountFilter(accountId); - Sink::Store::fetchAll(query) - .then>([=](const QList &resources) -> KAsync::Job { + Query query; + query.containsFilter(ApplicationDomain::ResourceCapabilities::Mail::transport); + query.filter(ApplicationDomain::SinkAccount(accountId)); + Store::fetchAll(query) + .then>([=](const QList &resources) -> KAsync::Job { if (!resources.isEmpty()) { auto resourceId = resources[0]->identifier(); SinkTrace() << "Sending message via resource: " << resourceId; @@ -138,8 +139,8 @@ static ActionHandlerHelper saveAsDraft("org.kde.kube.actions.save-as-draft", if (existingMail.identifier().isEmpty()) { Sink::Query query; - query += Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::drafts); - query += Sink::Query::AccountFilter(accountId); + query.containsFilter(ApplicationDomain::ResourceCapabilities::Mail::drafts); + query.filter(ApplicationDomain::SinkAccount(accountId)); return Sink::Store::fetchOne(query) .then([=](const Sink::ApplicationDomain::SinkResource &resource) -> KAsync::Job { Sink::ApplicationDomain::Mail mail(resource.identifier()); diff --git a/framework/domain/folderlistmodel.cpp b/framework/domain/folderlistmodel.cpp index 000dd263..98453ce9 100644 --- a/framework/domain/folderlistmodel.cpp +++ b/framework/domain/folderlistmodel.cpp @@ -72,19 +72,18 @@ void FolderListModel::runQuery(const Sink::Query &query) void FolderListModel::setAccountId(const QVariant &accountId) { + using namespace Sink::ApplicationDomain; const auto account = accountId.toString().toUtf8(); - Sink::Store::fetchAll(Sink::Query::PropertyFilter("account", QVariant::fromValue(account))) - .syncThen>([this, account](const QList &resources) { - Sink::Query query; - query.liveQuery = true; - query.requestedProperties << "name" << "icon" << "parent"; - query.parentProperty = "parent"; - for (const auto &r : resources) { - qDebug() << "Found resources for account: " << r->identifier() << account; - query.resources << r->identifier(); - } - runQuery(query); - }).exec(); + + //Get all folders of an account + auto query = Sink::Query(); + query.filter(SinkAccount(account)); + query.liveQuery = true; + query.request() + .request() + .request(); + query.parentProperty = Folder::Parent::name; + runQuery(query); } QVariant FolderListModel::accountId() const diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp index 9a3be059..020fd503 100644 --- a/framework/domain/settings/accountsettings.cpp +++ b/framework/domain/settings/accountsettings.cpp @@ -155,7 +155,7 @@ void AccountSettings::loadAccount() void AccountSettings::loadImapResource() { - Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) + Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier)).containsFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { mImapIdentifier = resource.identifier(); mImapServer = resource.getProperty("server").toString(); @@ -169,7 +169,7 @@ void AccountSettings::loadImapResource() void AccountSettings::loadMaildirResource() { - Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) + Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier)).containsFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { mMaildirIdentifier = resource.identifier(); auto path = resource.getProperty("path").toString(); @@ -184,7 +184,7 @@ void AccountSettings::loadMaildirResource() void AccountSettings::loadMailtransportResource() { - Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier) + Sink::Query::CapabilityFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport)) + Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier)).containsFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport)) .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { mMailtransportIdentifier = resource.identifier(); mSmtpServer = resource.getProperty("server").toString(); @@ -199,7 +199,7 @@ void AccountSettings::loadMailtransportResource() void AccountSettings::loadIdentity() { //FIXME this assumes that we only ever have one identity per account - Sink::Store::fetchOne(Sink::Query::AccountFilter(mAccountIdentifier)) + Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier))) .syncThen([this](const Sink::ApplicationDomain::Identity &identity) { mIdentityIdentifier = identity.identifier(); mUsername = identity.getProperty("username").toString(); -- cgit v1.2.3 From 268eb7207b955bb92e4ae2572996877e7f837325 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 4 Oct 2016 12:19:27 +0200 Subject: Less namespaces improve readability --- framework/domain/actions/sinkactions.cpp | 37 +++++++++-------- framework/domain/folderlistmodel.cpp | 16 ++++---- framework/domain/settings/accountsettings.cpp | 59 ++++++++++++++------------- 3 files changed, 59 insertions(+), 53 deletions(-) diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp index 47041a5b..e79e79c9 100644 --- a/framework/domain/actions/sinkactions.cpp +++ b/framework/domain/actions/sinkactions.cpp @@ -29,20 +29,21 @@ SINK_DEBUG_AREA("sinkactions") using namespace Kube; using namespace Sink; +using namespace Sink::ApplicationDomain; static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", [](Context *context) -> bool { return context->property("mail").isValid(); }, [](Context *context) { - auto mail = context->property("mail").value(); + auto mail = context->property("mail").value(); if (!mail) { SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); return; } mail->setProperty("unread", false); SinkLog() << "Mark as read " << mail->identifier(); - Sink::Store::modify(*mail).exec(); + Store::modify(*mail).exec(); } ); @@ -51,14 +52,14 @@ static ActionHandlerHelper moveToTrashHandler("org.kde.kube.actions.move-to-tras return context->property("mail").isValid(); }, [](Context *context) { - auto mail = context->property("mail").value(); + auto mail = context->property("mail").value(); if (!mail) { SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); return; } mail->setTrash(true); SinkLog() << "Move to trash " << mail->identifier(); - Sink::Store::modify(*mail).exec(); + Store::modify(*mail).exec(); } ); @@ -67,13 +68,13 @@ static ActionHandlerHelper deleteHandler("org.kde.kube.actions.delete", return context->property("mail").isValid(); }, [](Context *context) { - auto mail = context->property("mail").value(); + auto mail = context->property("mail").value(); if (!mail) { SinkWarning() << "Failed to get the mail mail: " << context->property("mail"); return; } SinkLog() << "Remove " << mail->identifier(); - Sink::Store::remove(*mail).exec(); + Store::remove(*mail).exec(); } ); @@ -82,12 +83,12 @@ static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize" return true; }, [](Context *context) { - if (auto folder = context->property("folder").value()) { + if (auto folder = context->property("folder").value()) { SinkLog() << "Synchronizing resource " << folder->resourceInstanceIdentifier(); - Sink::Store::synchronize(Sink::Query::ResourceFilter(folder->resourceInstanceIdentifier())).exec(); + Store::synchronize(Query::ResourceFilter(folder->resourceInstanceIdentifier())).exec(); } else { SinkLog() << "Synchronizing all"; - Sink::Store::synchronize(Sink::Query()).exec(); + Store::synchronize(Query()).exec(); } } ); @@ -111,9 +112,9 @@ static ActionHandlerHelper sendMailHandler("org.kde.kube.actions.sendmail", if (!resources.isEmpty()) { auto resourceId = resources[0]->identifier(); SinkTrace() << "Sending message via resource: " << resourceId; - Sink::ApplicationDomain::Mail mail(resourceId); + Mail mail(resourceId); mail.setBlobProperty("mimeMessage", message->encodedContent()); - return Sink::Store::create(mail); + return Store::create(mail); } SinkWarning() << "Failed to find a mailtransport resource"; return KAsync::error(0, "Failed to find a MailTransport resource."); @@ -131,27 +132,27 @@ static ActionHandlerHelper saveAsDraft("org.kde.kube.actions.save-as-draft", SinkWarning() << "executing save as draft"; const auto accountId = context->property("accountId").value(); const auto message = context->property("message").value(); - auto existingMail = context->property("existingMail").value(); + auto existingMail = context->property("existingMail").value(); if (!message) { SinkWarning() << "Failed to get the mail: " << context->property("mail"); return KAsync::error(1, "Failed to get the mail: " + context->property("mail").toString()); } if (existingMail.identifier().isEmpty()) { - Sink::Query query; + Query query; query.containsFilter(ApplicationDomain::ResourceCapabilities::Mail::drafts); query.filter(ApplicationDomain::SinkAccount(accountId)); - return Sink::Store::fetchOne(query) - .then([=](const Sink::ApplicationDomain::SinkResource &resource) -> KAsync::Job { - Sink::ApplicationDomain::Mail mail(resource.identifier()); + return Store::fetchOne(query) + .then([=](const SinkResource &resource) -> KAsync::Job { + Mail mail(resource.identifier()); mail.setProperty("draft", true); mail.setBlobProperty("mimeMessage", message->encodedContent()); - return Sink::Store::create(mail); + return Store::create(mail); }); } else { SinkWarning() << "Modifying an existing mail" << existingMail.identifier(); existingMail.setBlobProperty("mimeMessage", message->encodedContent()); - return Sink::Store::modify(existingMail); + return Store::modify(existingMail); } }) ); diff --git a/framework/domain/folderlistmodel.cpp b/framework/domain/folderlistmodel.cpp index 98453ce9..e852288f 100644 --- a/framework/domain/folderlistmodel.cpp +++ b/framework/domain/folderlistmodel.cpp @@ -22,9 +22,12 @@ #include #include +using namespace Sink; +using namespace Sink::ApplicationDomain; + FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() { - Sink::Query query; + Query query; query.liveQuery = true; query.requestedProperties << "name" << "icon" << "parent"; query.parentProperty = "parent"; @@ -57,26 +60,25 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const case Icon: return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); case Id: - return srcIdx.data(Sink::Store::DomainObjectBaseRole).value()->identifier(); + return srcIdx.data(Store::DomainObjectBaseRole).value()->identifier(); case DomainObject: - return srcIdx.data(Sink::Store::DomainObjectRole); + return srcIdx.data(Store::DomainObjectRole); } return QIdentityProxyModel::data(idx, role); } -void FolderListModel::runQuery(const Sink::Query &query) +void FolderListModel::runQuery(const Query &query) { - mModel = Sink::Store::loadModel(query); + mModel = Store::loadModel(query); setSourceModel(mModel.data()); } void FolderListModel::setAccountId(const QVariant &accountId) { - using namespace Sink::ApplicationDomain; const auto account = accountId.toString().toUtf8(); //Get all folders of an account - auto query = Sink::Query(); + auto query = Query(); query.filter(SinkAccount(account)); query.liveQuery = true; query.request() diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp index 020fd503..635aef6e 100644 --- a/framework/domain/settings/accountsettings.cpp +++ b/framework/domain/settings/accountsettings.cpp @@ -23,6 +23,9 @@ #include #include +using namespace Sink; +using namespace Sink::ApplicationDomain; + AccountSettings::AccountSettings(QObject *parent) : QObject(parent) { @@ -130,12 +133,12 @@ void AccountSettings::saveAccount() { qDebug() << "Saving account " << mAccountIdentifier << mMailtransportIdentifier; Q_ASSERT(!mAccountIdentifier.isEmpty()); - Sink::ApplicationDomain::SinkAccount account(mAccountIdentifier); + SinkAccount account(mAccountIdentifier); account.setProperty("type", "imap"); account.setProperty("name", mName); account.setProperty("icon", mIcon); Q_ASSERT(!account.identifier().isEmpty()); - Sink::Store::modify(account) + Store::modify(account) .onError([](const KAsync::Error &error) { qWarning() << "Error while creating account: " << error.errorMessage;; }) @@ -145,8 +148,8 @@ void AccountSettings::saveAccount() void AccountSettings::loadAccount() { Q_ASSERT(!mAccountIdentifier.isEmpty()); - Sink::Store::fetchOne(Sink::Query::IdentityFilter(mAccountIdentifier)) - .syncThen([this](const Sink::ApplicationDomain::SinkAccount &account) { + Store::fetchOne(Query::IdentityFilter(mAccountIdentifier)) + .syncThen([this](const SinkAccount &account) { mIcon = account.getProperty("icon").toString(); mName = account.getProperty("name").toString(); emit changed(); @@ -155,8 +158,8 @@ void AccountSettings::loadAccount() void AccountSettings::loadImapResource() { - Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier)).containsFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) - .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { + Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier)).containsFilter(ResourceCapabilities::Mail::storage)) + .syncThen([this](const SinkResource &resource) { mImapIdentifier = resource.identifier(); mImapServer = resource.getProperty("server").toString(); mImapUsername = resource.getProperty("username").toString(); @@ -169,8 +172,8 @@ void AccountSettings::loadImapResource() void AccountSettings::loadMaildirResource() { - Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier)).containsFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::storage)) - .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { + Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier)).containsFilter(ResourceCapabilities::Mail::storage)) + .syncThen([this](const SinkResource &resource) { mMaildirIdentifier = resource.identifier(); auto path = resource.getProperty("path").toString(); if (mPath != path) { @@ -184,8 +187,8 @@ void AccountSettings::loadMaildirResource() void AccountSettings::loadMailtransportResource() { - Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier)).containsFilter(Sink::ApplicationDomain::ResourceCapabilities::Mail::transport)) - .syncThen([this](const Sink::ApplicationDomain::SinkResource &resource) { + Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier)).containsFilter(ResourceCapabilities::Mail::transport)) + .syncThen([this](const SinkResource &resource) { mMailtransportIdentifier = resource.identifier(); mSmtpServer = resource.getProperty("server").toString(); mSmtpUsername = resource.getProperty("username").toString(); @@ -199,8 +202,8 @@ void AccountSettings::loadMailtransportResource() void AccountSettings::loadIdentity() { //FIXME this assumes that we only ever have one identity per account - Sink::Store::fetchOne(Sink::Query().filter(Sink::ApplicationDomain::SinkAccount(mAccountIdentifier))) - .syncThen([this](const Sink::ApplicationDomain::Identity &identity) { + Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier))) + .syncThen([this](const Identity &identity) { mIdentityIdentifier = identity.identifier(); mUsername = identity.getProperty("username").toString(); mEmailAddress = identity.getProperty("address").toString(); @@ -216,11 +219,11 @@ template static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteArray &identifier, const std::map &properties) { if (!identifier.isEmpty()) { - Sink::ApplicationDomain::SinkResource resource(identifier); + SinkResource resource(identifier); for (const auto &pair : properties) { resource.setProperty(pair.first, pair.second); } - Sink::Store::modify(resource) + Store::modify(resource) .onError([](const KAsync::Error &error) { qWarning() << "Error while modifying resource: " << error.errorMessage; }) @@ -231,7 +234,7 @@ static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteA for (const auto &pair : properties) { resource.setProperty(pair.first, pair.second); } - Sink::Store::create(resource) + Store::create(resource) .onError([](const KAsync::Error &error) { qWarning() << "Error while creating resource: " << error.errorMessage; }) @@ -243,7 +246,7 @@ static QByteArray saveResource(const QByteArray &accountIdentifier, const QByteA void AccountSettings::saveImapResource() { - mImapIdentifier = saveResource(mAccountIdentifier, mImapIdentifier, { + mImapIdentifier = saveResource(mAccountIdentifier, mImapIdentifier, { {"server", mImapServer}, {"username", mImapUsername}, {"password", mImapPassword}, @@ -252,14 +255,14 @@ void AccountSettings::saveImapResource() void AccountSettings::saveMaildirResource() { - mMaildirIdentifier = saveResource(mAccountIdentifier, mMaildirIdentifier, { + mMaildirIdentifier = saveResource(mAccountIdentifier, mMaildirIdentifier, { {"path", mPath}, }); } void AccountSettings::saveMailtransportResource() { - mMailtransportIdentifier = saveResource(mAccountIdentifier, mMailtransportIdentifier, { + mMailtransportIdentifier = saveResource(mAccountIdentifier, mMailtransportIdentifier, { {"server", mSmtpServer}, {"username", mSmtpUsername}, {"password", mSmtpPassword}, @@ -269,21 +272,21 @@ void AccountSettings::saveMailtransportResource() void AccountSettings::saveIdentity() { if (!mIdentityIdentifier.isEmpty()) { - Sink::ApplicationDomain::Identity identity(mMailtransportIdentifier); + Identity identity(mMailtransportIdentifier); identity.setProperty("username", mUsername); identity.setProperty("address", mEmailAddress); - Sink::Store::modify(identity) + Store::modify(identity) .onError([](const KAsync::Error &error) { qWarning() << "Error while modifying identity: " << error.errorMessage; }) .exec(); } else { - auto identity = Sink::ApplicationDomain::ApplicationDomainType::createEntity(); + auto identity = ApplicationDomainType::createEntity(); mIdentityIdentifier = identity.identifier(); identity.setProperty("account", mAccountIdentifier); identity.setProperty("username", mUsername); identity.setProperty("address", mEmailAddress); - Sink::Store::create(identity) + Store::create(identity) .onError([](const KAsync::Error &error) { qWarning() << "Error while creating identity: " << error.errorMessage; }) @@ -296,8 +299,8 @@ void AccountSettings::removeResource(const QByteArray &identifier) if (identifier.isEmpty()) { qWarning() << "We're missing an identifier"; } else { - Sink::ApplicationDomain::SinkResource resource("", identifier, 0, QSharedPointer::create()); - Sink::Store::remove(resource) + SinkResource resource("", identifier, 0, QSharedPointer::create()); + Store::remove(resource) .onError([](const KAsync::Error &error) { qWarning() << "Error while removing resource: " << error.errorMessage; }) @@ -310,8 +313,8 @@ void AccountSettings::removeAccount() if (mAccountIdentifier.isEmpty()) { qWarning() << "We're missing an identifier"; } else { - Sink::ApplicationDomain::SinkAccount account("", mAccountIdentifier, 0, QSharedPointer::create()); - Sink::Store::remove(account) + SinkAccount account("", mAccountIdentifier, 0, QSharedPointer::create()); + Store::remove(account) .onError([](const KAsync::Error &error) { qWarning() << "Error while removing account: " << error.errorMessage; }) @@ -324,8 +327,8 @@ void AccountSettings::removeIdentity() if (mIdentityIdentifier.isEmpty()) { qWarning() << "We're missing an identifier"; } else { - Sink::ApplicationDomain::Identity identity("", mIdentityIdentifier, 0, QSharedPointer::create()); - Sink::Store::remove(identity) + Identity identity("", mIdentityIdentifier, 0, QSharedPointer::create()); + Store::remove(identity) .onError([](const KAsync::Error &error) { qWarning() << "Error while removing identity: " << error.errorMessage; }) -- cgit v1.2.3 From 5fa8608e9877eab40336a60ed8ed979aaf3cfbd0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 5 Oct 2016 22:42:53 +0200 Subject: Adapted to new API --- framework/domain/accountfactory.cpp | 2 +- framework/domain/actions/sinkactions.cpp | 16 +++++++-------- framework/domain/folderlistmodel.cpp | 4 ++-- framework/domain/maillistmodel.cpp | 2 +- framework/domain/settings/accountsettings.cpp | 28 +++++++++++++-------------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/framework/domain/accountfactory.cpp b/framework/domain/accountfactory.cpp index 6261eaf1..182a0a1d 100644 --- a/framework/domain/accountfactory.cpp +++ b/framework/domain/accountfactory.cpp @@ -43,7 +43,7 @@ QString AccountFactory::name() const void AccountFactory::setAccountId(const QString &accountId) { mAccountId = accountId; - Sink::Store::fetchOne(Sink::Query::IdentityFilter(accountId.toUtf8())) + Sink::Store::fetchOne(Sink::Query().filter(accountId.toUtf8())) .syncThen([this](const Sink::ApplicationDomain::SinkAccount &account) { mAccountType = account.getProperty("type").toByteArray(); loadPackage(); diff --git a/framework/domain/actions/sinkactions.cpp b/framework/domain/actions/sinkactions.cpp index e79e79c9..cc8d324e 100644 --- a/framework/domain/actions/sinkactions.cpp +++ b/framework/domain/actions/sinkactions.cpp @@ -85,7 +85,7 @@ static ActionHandlerHelper synchronizeHandler("org.kde.kube.actions.synchronize" [](Context *context) { if (auto folder = context->property("folder").value()) { SinkLog() << "Synchronizing resource " << folder->resourceInstanceIdentifier(); - Store::synchronize(Query::ResourceFilter(folder->resourceInstanceIdentifier())).exec(); + Store::synchronize(Query().resourceFilter(folder->resourceInstanceIdentifier())).exec(); } else { SinkLog() << "Synchronizing all"; Store::synchronize(Query()).exec(); @@ -106,7 +106,7 @@ static ActionHandlerHelper sendMailHandler("org.kde.kube.actions.sendmail", Query query; query.containsFilter(ApplicationDomain::ResourceCapabilities::Mail::transport); - query.filter(ApplicationDomain::SinkAccount(accountId)); + query.filter(accountId); Store::fetchAll(query) .then>([=](const QList &resources) -> KAsync::Job { if (!resources.isEmpty()) { @@ -129,7 +129,7 @@ static ActionHandlerHelper saveAsDraft("org.kde.kube.actions.save-as-draft", return !accountId.isEmpty() && message; }, ActionHandlerHelper::JobHandler([](Context *context) -> KAsync::Job { - SinkWarning() << "executing save as draft"; + SinkLog() << "Executing the save-as-draft action"; const auto accountId = context->property("accountId").value(); const auto message = context->property("message").value(); auto existingMail = context->property("existingMail").value(); @@ -140,18 +140,18 @@ static ActionHandlerHelper saveAsDraft("org.kde.kube.actions.save-as-draft", if (existingMail.identifier().isEmpty()) { Query query; - query.containsFilter(ApplicationDomain::ResourceCapabilities::Mail::drafts); - query.filter(ApplicationDomain::SinkAccount(accountId)); + query.containsFilter(ApplicationDomain::ResourceCapabilities::Mail::drafts); + query.filter(accountId); return Store::fetchOne(query) .then([=](const SinkResource &resource) -> KAsync::Job { Mail mail(resource.identifier()); - mail.setProperty("draft", true); - mail.setBlobProperty("mimeMessage", message->encodedContent()); + mail.setDraft(true); + mail.setMimeMessage(message->encodedContent()); return Store::create(mail); }); } else { SinkWarning() << "Modifying an existing mail" << existingMail.identifier(); - existingMail.setBlobProperty("mimeMessage", message->encodedContent()); + existingMail.setMimeMessage(message->encodedContent()); return Store::modify(existingMail); } }) diff --git a/framework/domain/folderlistmodel.cpp b/framework/domain/folderlistmodel.cpp index e852288f..7cf5ad5d 100644 --- a/framework/domain/folderlistmodel.cpp +++ b/framework/domain/folderlistmodel.cpp @@ -29,7 +29,7 @@ FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() { Query query; query.liveQuery = true; - query.requestedProperties << "name" << "icon" << "parent"; + query.request().request().request(); query.parentProperty = "parent"; runQuery(query); } @@ -79,7 +79,7 @@ void FolderListModel::setAccountId(const QVariant &accountId) //Get all folders of an account auto query = Query(); - query.filter(SinkAccount(account)); + query.resourceFilter(account); query.liveQuery = true; query.request() .request() diff --git a/framework/domain/maillistmodel.cpp b/framework/domain/maillistmodel.cpp index e3f555c4..9afb6408 100644 --- a/framework/domain/maillistmodel.cpp +++ b/framework/domain/maillistmodel.cpp @@ -107,7 +107,7 @@ void MailListModel::setParentFolder(const QVariant &parentFolder) } Sink::Query query; query.liveQuery = true; - query.resources << folder->resourceInstanceIdentifier(); + query.resourceFilter(folder->resourceInstanceIdentifier()); query.sort(); query.limit = 100; query.request(); diff --git a/framework/domain/settings/accountsettings.cpp b/framework/domain/settings/accountsettings.cpp index 635aef6e..ea798a73 100644 --- a/framework/domain/settings/accountsettings.cpp +++ b/framework/domain/settings/accountsettings.cpp @@ -134,9 +134,9 @@ void AccountSettings::saveAccount() qDebug() << "Saving account " << mAccountIdentifier << mMailtransportIdentifier; Q_ASSERT(!mAccountIdentifier.isEmpty()); SinkAccount account(mAccountIdentifier); - account.setProperty("type", "imap"); - account.setProperty("name", mName); - account.setProperty("icon", mIcon); + account.setAccountType("imap"); + account.setName(mName); + account.setIcon(mIcon); Q_ASSERT(!account.identifier().isEmpty()); Store::modify(account) .onError([](const KAsync::Error &error) { @@ -148,17 +148,17 @@ void AccountSettings::saveAccount() void AccountSettings::loadAccount() { Q_ASSERT(!mAccountIdentifier.isEmpty()); - Store::fetchOne(Query::IdentityFilter(mAccountIdentifier)) + Store::fetchOne(Query().filter(mAccountIdentifier)) .syncThen([this](const SinkAccount &account) { - mIcon = account.getProperty("icon").toString(); - mName = account.getProperty("name").toString(); + mIcon = account.getIcon(); + mName = account.getName(); emit changed(); }).exec(); } void AccountSettings::loadImapResource() { - Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier)).containsFilter(ResourceCapabilities::Mail::storage)) + Store::fetchOne(Query().filter(mAccountIdentifier).containsFilter(ResourceCapabilities::Mail::storage)) .syncThen([this](const SinkResource &resource) { mImapIdentifier = resource.identifier(); mImapServer = resource.getProperty("server").toString(); @@ -172,7 +172,7 @@ void AccountSettings::loadImapResource() void AccountSettings::loadMaildirResource() { - Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier)).containsFilter(ResourceCapabilities::Mail::storage)) + Store::fetchOne(Query().filter(mAccountIdentifier).containsFilter(ResourceCapabilities::Mail::storage)) .syncThen([this](const SinkResource &resource) { mMaildirIdentifier = resource.identifier(); auto path = resource.getProperty("path").toString(); @@ -187,7 +187,7 @@ void AccountSettings::loadMaildirResource() void AccountSettings::loadMailtransportResource() { - Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier)).containsFilter(ResourceCapabilities::Mail::transport)) + Store::fetchOne(Query().filter(mAccountIdentifier).containsFilter(ResourceCapabilities::Mail::transport)) .syncThen([this](const SinkResource &resource) { mMailtransportIdentifier = resource.identifier(); mSmtpServer = resource.getProperty("server").toString(); @@ -202,7 +202,7 @@ void AccountSettings::loadMailtransportResource() void AccountSettings::loadIdentity() { //FIXME this assumes that we only ever have one identity per account - Store::fetchOne(Query().filter(SinkAccount(mAccountIdentifier))) + Store::fetchOne(Query().filter(mAccountIdentifier)) .syncThen([this](const Identity &identity) { mIdentityIdentifier = identity.identifier(); mUsername = identity.getProperty("username").toString(); @@ -283,7 +283,7 @@ void AccountSettings::saveIdentity() } else { auto identity = ApplicationDomainType::createEntity(); mIdentityIdentifier = identity.identifier(); - identity.setProperty("account", mAccountIdentifier); + identity.setAccount(mAccountIdentifier); identity.setProperty("username", mUsername); identity.setProperty("address", mEmailAddress); Store::create(identity) @@ -299,7 +299,7 @@ void AccountSettings::removeResource(const QByteArray &identifier) if (identifier.isEmpty()) { qWarning() << "We're missing an identifier"; } else { - SinkResource resource("", identifier, 0, QSharedPointer::create()); + SinkResource resource(identifier); Store::remove(resource) .onError([](const KAsync::Error &error) { qWarning() << "Error while removing resource: " << error.errorMessage; @@ -313,7 +313,7 @@ void AccountSettings::removeAccount() if (mAccountIdentifier.isEmpty()) { qWarning() << "We're missing an identifier"; } else { - SinkAccount account("", mAccountIdentifier, 0, QSharedPointer::create()); + SinkAccount account(mAccountIdentifier); Store::remove(account) .onError([](const KAsync::Error &error) { qWarning() << "Error while removing account: " << error.errorMessage; @@ -327,7 +327,7 @@ void AccountSettings::removeIdentity() if (mIdentityIdentifier.isEmpty()) { qWarning() << "We're missing an identifier"; } else { - Identity identity("", mIdentityIdentifier, 0, QSharedPointer::create()); + Identity identity(mIdentityIdentifier); Store::remove(identity) .onError([](const KAsync::Error &error) { qWarning() << "Error while removing identity: " << error.errorMessage; -- cgit v1.2.3