-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomebrew_kf5_kdevplatform.popup_qrc.patch
56 lines (52 loc) · 2 KB
/
homebrew_kf5_kdevplatform.popup_qrc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
commit be1f04096c05a4402e1df0420c9a2d1b20edbee8
Author: Andrew McCann <[email protected]>
Date: Tue Nov 10 14:50:26 2015 -0800
Make assistantpopup qml load from resource
diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt
index fdd5fb3..340e0a6 100644
--- a/shell/CMakeLists.txt
+++ b/shell/CMakeLists.txt
@@ -172,5 +172,3 @@ install(FILES
filteredproblemstore.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kdevplatform/shell COMPONENT Devel
)
-
-install( FILES AssistantButton.qml assistantpopup.qml DESTINATION ${KDE_INSTALL_DATADIR}/kdevelop )
diff --git a/shell/assistantpopup.cpp b/shell/assistantpopup.cpp
index efd8249..1bc1a06 100644
--- a/shell/assistantpopup.cpp
+++ b/shell/assistantpopup.cpp
@@ -176,7 +176,19 @@ AssistantPopup::AssistantPopup()
rootContext()->setContextProperty("config", m_config);
- setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kdevelop/assistantpopup.qml")));
+ QUrl qmlURL;
+ {
+ QLatin1String qmlString("kdevelop/assistantpopup.qml");
+
+ auto qmlPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, qmlString);
+
+ if (!qmlPath.isEmpty()) {
+ qmlURL = QUrl::fromLocalFile(qmlPath);
+ } else {
+ qmlURL = QUrl(QLatin1String("qrc:/")+qmlString);
+ }
+ }
+ setSource(qmlURL);
if (!rootObject()) {
qWarning() << "Failed to load assistant markup! The assistant will not work.";
} else {
diff --git a/shell/kdevplatformshell.qrc b/shell/kdevplatformshell.qrc
index 4b75ba1..8436cc5 100644
--- a/shell/kdevplatformshell.qrc
+++ b/shell/kdevplatformshell.qrc
@@ -9,4 +9,10 @@
<qresource prefix="/kxmlgui5/kdevdebugger">
<file alias="kdevdebuggershellui.rc">debugger/kdevdebuggershellui.rc</file>
</qresource>
+ <qresource prefix="/kdevelop">
+ <file>AssistantButton.qml</file>
+ </qresource>
+ <qresource prefix="/kdevelop">
+ <file>assistantpopup.qml</file>
+ </qresource>
</RCC>