aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/QMenuModel
diff options
context:
space:
mode:
Diffstat (limited to 'libqmenumodel/QMenuModel')
-rw-r--r--libqmenumodel/QMenuModel/CMakeLists.txt2
-rw-r--r--libqmenumodel/QMenuModel/plugin.cpp13
-rw-r--r--libqmenumodel/QMenuModel/plugin.h1
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);
};