aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/QMenuModel
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-06-25 15:39:11 -0400
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-06-25 15:39:11 -0400
commit6aaafd55328c1860fd1b734fa29ff77673538a2b (patch)
treeb2c54591354672c6c15b959160a5d013345329b7 /libqmenumodel/QMenuModel
parent050958c58924934b10cf3a6272cff3ebe867f1dd (diff)
downloadqmenumodel-6aaafd55328c1860fd1b734fa29ff77673538a2b.tar.gz
qmenumodel-6aaafd55328c1860fd1b734fa29ff77673538a2b.tar.bz2
qmenumodel-6aaafd55328c1860fd1b734fa29ff77673538a2b.zip
unitymenumodel: add support for icons
For now, this includes themed icons, file icons, and icons send as raw data.
Diffstat (limited to 'libqmenumodel/QMenuModel')
-rw-r--r--libqmenumodel/QMenuModel/CMakeLists.txt2
-rw-r--r--libqmenumodel/QMenuModel/plugin.cpp6
-rw-r--r--libqmenumodel/QMenuModel/plugin.h1
3 files changed, 8 insertions, 1 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 f529c0a..0629099 100644
--- a/libqmenumodel/QMenuModel/plugin.cpp
+++ b/libqmenumodel/QMenuModel/plugin.cpp
@@ -23,9 +23,15 @@
#include "qdbusactiongroup.h"
#include "qstateaction.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",
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);
};