diff options
author | Nick Dedekind <nicholas.dedekind@gmail.com> | 2013-08-12 15:28:57 +0000 |
---|---|---|
committer | Tarmac <> | 2013-08-12 15:28:57 +0000 |
commit | d6085f82847f07de4aa3bf13e8d3f8c779d60e32 (patch) | |
tree | 85912cf783c8ef081fe0eeea0279e88ad792ba44 /libqmenumodel/QMenuModel | |
parent | 52b17007596bcd29ec0fe01468d28fddfcc18785 (diff) | |
parent | 94a0809279ae8768fa53e19f9ad06832112b15de (diff) | |
download | qmenumodel-d6085f82847f07de4aa3bf13e8d3f8c779d60e32.tar.gz qmenumodel-d6085f82847f07de4aa3bf13e8d3f8c779d60e32.tar.bz2 qmenumodel-d6085f82847f07de4aa3bf13e8d3f8c779d60e32.zip |
Added UnityMenuModel.
Approved by PS Jenkins bot, Nick Dedekind.
Diffstat (limited to 'libqmenumodel/QMenuModel')
-rw-r--r-- | libqmenumodel/QMenuModel/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libqmenumodel/QMenuModel/plugin.cpp | 13 | ||||
-rw-r--r-- | libqmenumodel/QMenuModel/plugin.h | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/libqmenumodel/QMenuModel/CMakeLists.txt b/libqmenumodel/QMenuModel/CMakeLists.txt index 7367e18..78e062b 100644 --- a/libqmenumodel/QMenuModel/CMakeLists.txt +++ b/libqmenumodel/QMenuModel/CMakeLists.txt @@ -19,7 +19,7 @@ target_link_libraries(qmenumodel-qml ${GIO_LDFLAGS} ) -qt5_use_modules(qmenumodel-qml Qml Widgets) +qt5_use_modules(qmenumodel-qml Qml Quick) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" "${CMAKE_CURRENT_BINARY_DIR}/qmldir") diff --git a/libqmenumodel/QMenuModel/plugin.cpp b/libqmenumodel/QMenuModel/plugin.cpp index ee05fff..c1a5e40 100644 --- a/libqmenumodel/QMenuModel/plugin.cpp +++ b/libqmenumodel/QMenuModel/plugin.cpp @@ -22,9 +22,17 @@ #include "qdbusmenumodel.h" #include "qdbusactiongroup.h" #include "qstateaction.h" +#include "unitymenuaction.h" +#include "unitymenumodel.h" +#include "unitythemediconprovider.h" #include <QtQml> +void QMenuModelQmlPlugin::initializeEngine(QQmlEngine *engine, const char *uri) +{ + engine->addImageProvider("theme", new UnityThemedIconProvider); +} + void QMenuModelQmlPlugin::registerTypes(const char *uri) { qmlRegisterUncreatableType<QMenuModel>(uri, 0, 1, "QMenuModel", @@ -33,9 +41,10 @@ void QMenuModelQmlPlugin::registerTypes(const char *uri) "QStateAction must be created by QDBusActionGroup::action"); qmlRegisterUncreatableType<DBusEnums>(uri, 0, 1, "DBus", "DBus is only a namespace"); + qmlRegisterUncreatableType<UnityMenuAction>(uri, 0, 1, "UnityMenuAction", + "UnityMenuAction must be created by UnityMenuModel"); qmlRegisterType<QDBusMenuModel>(uri, 0, 1, "QDBusMenuModel"); qmlRegisterType<QDBusActionGroup>(uri, 0, 1, "QDBusActionGroup"); - + qmlRegisterType<UnityMenuModel>(uri, 0, 1, "UnityMenuModel"); } - diff --git a/libqmenumodel/QMenuModel/plugin.h b/libqmenumodel/QMenuModel/plugin.h index fc732d2..3474139 100644 --- a/libqmenumodel/QMenuModel/plugin.h +++ b/libqmenumodel/QMenuModel/plugin.h @@ -28,6 +28,7 @@ class QMenuModelQmlPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "com.canonical.qmenumodel") public: + void initializeEngine(QQmlEngine *engine, const char *uri); void registerTypes(const char *uri); }; |