From 5b521141a0576a6f12a8a1f990198a97a4d60aa6 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 5 Jan 2017 15:22:48 +0100 Subject: create account framework plugin --- framework/accounts/CMakeLists.txt | 13 +++++++++++++ framework/accounts/accountsplugin.cpp | 31 +++++++++++++++++++++++++++++++ framework/accounts/accountsplugin.h | 31 +++++++++++++++++++++++++++++++ framework/accounts/qmldir | 4 ++++ 4 files changed, 79 insertions(+) create mode 100644 framework/accounts/CMakeLists.txt create mode 100644 framework/accounts/accountsplugin.cpp create mode 100644 framework/accounts/accountsplugin.h create mode 100644 framework/accounts/qmldir (limited to 'framework/accounts') diff --git a/framework/accounts/CMakeLists.txt b/framework/accounts/CMakeLists.txt new file mode 100644 index 00000000..bccafd77 --- /dev/null +++ b/framework/accounts/CMakeLists.txt @@ -0,0 +1,13 @@ +set(accountsplugin_SRCS + accountsplugin.cpp + accountfactory.cpp + accountsmodel.cpp +) + +add_library(accountsplugin SHARED ${accountsplugin_SRCS}) + +qt5_use_modules(accountsplugin Core Quick Qml) +target_link_libraries(accountsplugin sink mailplugin) + +install(TARGETS accountsplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/accounts) +install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/accounts) diff --git a/framework/accounts/accountsplugin.cpp b/framework/accounts/accountsplugin.cpp new file mode 100644 index 00000000..e980d5f3 --- /dev/null +++ b/framework/accounts/accountsplugin.cpp @@ -0,0 +1,31 @@ +/* + Copyright (C) 2017 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 "accountsplugin.h" + +#include "accountsmodel.h" +#include "accountfactory.h" + +#include + +void AccountsPlugin::registerTypes (const char *uri) +{ + Q_ASSERT(uri == QLatin1String("org.kube.framework.accounts")); + qmlRegisterType(uri, 1, 0, "AccountFactory"); + qmlRegisterType(uri, 1, 0, "AccountsModel"); +} diff --git a/framework/accounts/accountsplugin.h b/framework/accounts/accountsplugin.h new file mode 100644 index 00000000..4f784f26 --- /dev/null +++ b/framework/accounts/accountsplugin.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2017 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 AccountsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + virtual void registerTypes(const char *uri); +}; diff --git a/framework/accounts/qmldir b/framework/accounts/qmldir new file mode 100644 index 00000000..662725de --- /dev/null +++ b/framework/accounts/qmldir @@ -0,0 +1,4 @@ +module org.kube.framework.accounts + +plugin accountsplugin + -- cgit v1.2.3