From de6ae24554283cf4d2fecd50ae91773653e20aa3 Mon Sep 17 00:00:00 2001 From: Antonis Tsiapaliokas Date: Wed, 18 Jan 2012 11:32:49 +0200 Subject: [PATCH] Create localebindingsplugin.{cpp,h},CMakeLists.txt,qmldir --- .../core/corebindingsplugin.cpp | 3 -- declarativeimports/locale/CMakeLists.txt | 23 ++++++++++++ .../locale/localebindingsplugin.cpp | 34 ++++++++++++++++++ .../locale/localebindingsplugin.h | 36 +++++++++++++++++++ declarativeimports/locale/qmldir | 1 + 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 declarativeimports/locale/CMakeLists.txt create mode 100644 declarativeimports/locale/localebindingsplugin.cpp create mode 100644 declarativeimports/locale/localebindingsplugin.h create mode 100644 declarativeimports/locale/qmldir diff --git a/declarativeimports/core/corebindingsplugin.cpp b/declarativeimports/core/corebindingsplugin.cpp index 4fd65c8ad..f08d8b36d 100644 --- a/declarativeimports/core/corebindingsplugin.cpp +++ b/declarativeimports/core/corebindingsplugin.cpp @@ -38,7 +38,6 @@ #include "dialog.h" #include "tooltip.h" #include "dataenginebindings_p.h" -#include "Locale.h" void CoreBindingsPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) { @@ -81,8 +80,6 @@ void CoreBindingsPlugin::registerTypes(const char *uri) qmlRegisterType(uri, 0, 1, "Dialog"); qmlRegisterType(uri, 0, 1, "ToolTip"); - qmlRegisterType(uri, 0, 1, "Locale"); - qmlRegisterInterface("Service"); qRegisterMetaType("Service"); qmlRegisterInterface("ServiceJob"); diff --git a/declarativeimports/locale/CMakeLists.txt b/declarativeimports/locale/CMakeLists.txt new file mode 100644 index 000000000..24431c7f3 --- /dev/null +++ b/declarativeimports/locale/CMakeLists.txt @@ -0,0 +1,23 @@ +project(localebindings) + +set(localebindings_SRCS + locale.cpp + ) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${KDE4_INCLUDES} +) + +qt4_automoc(${localebindings_SRCS}) + + +add_library(localebindingsplugin SHARED ${localebindings_SRCS}) +#FIXME +#Should i remove KDE4_PLASMA_LIBS? +#Should i put something? +target_link_libraries(localebindingsplugin ${KDE4_PLASMA_LIBS} ${QT_QTDECLARATIVE_LIBRARY} kdeclarative) + +install(TARGETS localebindingsplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/locale) +install(FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/locale) diff --git a/declarativeimports/locale/localebindingsplugin.cpp b/declarativeimports/locale/localebindingsplugin.cpp new file mode 100644 index 000000000..e3cb7bc74 --- /dev/null +++ b/declarativeimports/locale/localebindingsplugin.cpp @@ -0,0 +1,34 @@ +/* + * Copyright 2012 by Antonis Tsiapaliokas + * Copyright 2012 by Giorgos Tsiapaliwkas + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, 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 Library 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 "localebindingsplugin.h" + +#include + +#include "locale.h" + +void LocaleBindingsPlugin::registerTypes(const char *uri) +{ + Q_ASSERT(uri == QLatin1String("org.kde.plasma.locale")); + + qmlRegisterType(uri, 0, 1, "Locale"); +} + +#include "localebindingsplugin.moc" diff --git a/declarativeimports/locale/localebindingsplugin.h b/declarativeimports/locale/localebindingsplugin.h new file mode 100644 index 000000000..9f56d5baa --- /dev/null +++ b/declarativeimports/locale/localebindingsplugin.h @@ -0,0 +1,36 @@ +/* + * Copyright 2012 by Antonis Tsiapaliokas + * Copyright 2012 by Giorgos Tsiapaliwkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, 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 Library 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. + */ + +#ifndef LOCALEBINDINGSPLUGIN_H +#define LOCALEBINDINGSPLUGIN_H + +#include + +class LocaleBindingsPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT + +public: + void registerTypes(const char *uri); +}; + +Q_EXPORT_PLUGIN2(localebindingsplugin, LocaleBindingsPlugin) + +#endif diff --git a/declarativeimports/locale/qmldir b/declarativeimports/locale/qmldir new file mode 100644 index 000000000..4e8428dc7 --- /dev/null +++ b/declarativeimports/locale/qmldir @@ -0,0 +1 @@ +plugin localebindingsplugin