Create localebindingsplugin.{cpp,h},CMakeLists.txt,qmldir

This commit is contained in:
Antonis Tsiapaliokas 2012-01-18 11:32:49 +02:00
parent 78a91a7cc9
commit de6ae24554
5 changed files with 94 additions and 3 deletions

View File

@ -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<DialogProxy>(uri, 0, 1, "Dialog");
qmlRegisterType<ToolTipProxy>(uri, 0, 1, "ToolTip");
qmlRegisterType<Locale>(uri, 0, 1, "Locale");
qmlRegisterInterface<Plasma::Service>("Service");
qRegisterMetaType<Plasma::Service*>("Service");
qmlRegisterInterface<Plasma::ServiceJob>("ServiceJob");

View File

@ -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)

View File

@ -0,0 +1,34 @@
/*
* Copyright 2012 by Antonis Tsiapaliokas <kok3rs@gmail.com>
* Copyright 2012 by Giorgos Tsiapaliwkas <terietor@gmail.com>
* 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 <QtDeclarative/qdeclarative.h>
#include "locale.h"
void LocaleBindingsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.locale"));
qmlRegisterType<ToolTipProxy>(uri, 0, 1, "Locale");
}
#include "localebindingsplugin.moc"

View File

@ -0,0 +1,36 @@
/*
* Copyright 2012 by Antonis Tsiapaliokas <kok3rs@gmail.com>
* Copyright 2012 by Giorgos Tsiapaliwkas <terietor@gmail.com>
*
* 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 <QDeclarativeExtensionPlugin>
class LocaleBindingsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
void registerTypes(const char *uri);
};
Q_EXPORT_PLUGIN2(localebindingsplugin, LocaleBindingsPlugin)
#endif

View File

@ -0,0 +1 @@
plugin localebindingsplugin