From 36426c5ef4e8d3c8e850996c447d6999e21479c6 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Thu, 4 Oct 2012 12:04:46 +0200 Subject: Move the enums into a class that inherits QObject, so they can be exposed and used directly from QML. --- src/QMenuModel/plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/QMenuModel') diff --git a/src/QMenuModel/plugin.cpp b/src/QMenuModel/plugin.cpp index 494dd2c..ec51ae9 100644 --- a/src/QMenuModel/plugin.cpp +++ b/src/QMenuModel/plugin.cpp @@ -32,6 +32,8 @@ void QMenuModelQmlPlugin::registerTypes(const char *uri) "QMenuModel is a interface"); qmlRegisterUncreatableType(uri, 0, 1, "QStateAction", "QStateAction must be created by QDBusActionGroup::action"); + qmlRegisterUncreatableType(uri, 0, 1, "DBus", + "DBus is only a namespace"); qmlRegisterType(uri, 0, 1, "QDBusMenuModel"); qmlRegisterType(uri, 0, 1, "QDBusActionGroup"); -- cgit v1.2.3 From 36cebbb3e17b0b9df03a3a288e56b5d1e1fedee1 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Thu, 4 Oct 2012 17:12:09 +0200 Subject: Rename the source directories. --- src/QMenuModel/CMakeLists.txt | 46 ------------------------------------------- src/QMenuModel/plugin.cpp | 43 ---------------------------------------- src/QMenuModel/plugin.h | 33 ------------------------------- src/QMenuModel/qmldir | 1 - 4 files changed, 123 deletions(-) delete mode 100644 src/QMenuModel/CMakeLists.txt delete mode 100644 src/QMenuModel/plugin.cpp delete mode 100644 src/QMenuModel/plugin.h delete mode 100644 src/QMenuModel/qmldir (limited to 'src/QMenuModel') diff --git a/src/QMenuModel/CMakeLists.txt b/src/QMenuModel/CMakeLists.txt deleted file mode 100644 index bf3bb5a..0000000 --- a/src/QMenuModel/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ - -project(qmenumodelqmlplugin) - -set(QMENUMODEL_SRC - plugin.cpp -) - -set(QMENUMODEL_HEADERS - plugin.h -) - -qt4_wrap_cpp(QMENUMODEL_MOC - ${QMENUMODEL_HEADERS} -) - -add_library(qmenumodel MODULE - ${QMENUMODEL_SRC} - ${QMENUMODEL_MOC} -) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${qmenumodelcommon_SOURCE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTDECLARATIVE_INCLUDE_DIR} - ${GLIB_INCLUDE_DIRS} - ${GIO_INCLUDE_DIRS} -) - -target_link_libraries(qmenumodel - qmenumodelcommon - ${QT_QTCORE_LIBRARY} - ${QT_QTGUI_LIBRARY} - ${QT_QTDCLARATIVE_LIBRARY} - ${GLIB_LDFLAGS} - ${GIO_LDFLAGS} -) - -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" - "${CMAKE_CURRENT_BINARY_DIR}/qmldir") - -set(QMENUMODEL_INSTALL_PREFIX "${QT_IMPORTS_DIR}/Ubuntu/QMenuModel/") -install(TARGETS qmenumodel DESTINATION ${QMENUMODEL_INSTALL_PREFIX}) -install(FILES qmldir DESTINATION ${QMENUMODEL_INSTALL_PREFIX}) diff --git a/src/QMenuModel/plugin.cpp b/src/QMenuModel/plugin.cpp deleted file mode 100644 index ec51ae9..0000000 --- a/src/QMenuModel/plugin.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Authors: - * Renato Araujo Oliveira Filho - */ - -#include "plugin.h" -#include "qmenumodel.h" -#include "qdbusmenumodel.h" -#include "qdbusactiongroup.h" -#include "qstateaction.h" - -#include - - -void QMenuModelQmlPlugin::registerTypes(const char *uri) -{ - qmlRegisterUncreatableType(uri, 0, 1, "QMenuModel", - "QMenuModel is a interface"); - qmlRegisterUncreatableType(uri, 0, 1, "QStateAction", - "QStateAction must be created by QDBusActionGroup::action"); - qmlRegisterUncreatableType(uri, 0, 1, "DBus", - "DBus is only a namespace"); - - qmlRegisterType(uri, 0, 1, "QDBusMenuModel"); - qmlRegisterType(uri, 0, 1, "QDBusActionGroup"); - -} - -Q_EXPORT_PLUGIN2(qmenumodel, QMenuModelQmlPlugin) diff --git a/src/QMenuModel/plugin.h b/src/QMenuModel/plugin.h deleted file mode 100644 index e9d6850..0000000 --- a/src/QMenuModel/plugin.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Authors: - * Renato Araujo Oliveira Filho - */ - -#ifndef QMENUMODELQMLPLUGIN_H -#define QMENUMODELQMLPLUGIN_H - -#include - - -class QMenuModelQmlPlugin : public QDeclarativeExtensionPlugin -{ - Q_OBJECT -public: - void registerTypes(const char *uri); -}; - -#endif diff --git a/src/QMenuModel/qmldir b/src/QMenuModel/qmldir deleted file mode 100644 index c8f525f..0000000 --- a/src/QMenuModel/qmldir +++ /dev/null @@ -1 +0,0 @@ -plugin qmenumodel -- cgit v1.2.3