summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-10-06 14:01:56 +1000
committerJason McDonald <jason.mcdonald@nokia.com>2010-10-08 12:59:34 +1000
commitb3ccb9f7b7795dab6520e7328c75537d58d08577 (patch)
tree25ff1b1981aebd10a35b7d515d0e24bd8446b3a6
parent4652008c01b23eefdba3b02fe8101c5bde857d41 (diff)
Fix minehunt execution from QtDemo
Task-number: QTBUG-14250 Reviewed-by: Martin Jones (cherry picked from commit 695b54e671b55bd8103dee8b30ee76309dbd26c1)
-rw-r--r--demos/declarative/minehunt/main.cpp2
-rw-r--r--demos/declarative/minehunt/minehunt.pro1
-rw-r--r--demos/declarative/minehunt/minehunt.qrc20
-rw-r--r--demos/qtdemo/menumanager.cpp1
-rw-r--r--demos/qtdemo/xml/examples.xml2
5 files changed, 24 insertions, 2 deletions
diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp
index 8bbaee9cfc..2b286eff50 100644
--- a/demos/declarative/minehunt/main.cpp
+++ b/demos/declarative/minehunt/main.cpp
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView);
#endif
canvas.engine()->rootContext()->setContextObject(game);
- canvas.setSource(QString("minehunt.qml"));
+ canvas.setSource(QString("qrc:minehunt.qml"));
QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));
#ifdef Q_OS_SYMBIAN
diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro
index 7a491ab6fc..753ca4eb68 100644
--- a/demos/declarative/minehunt/minehunt.pro
+++ b/demos/declarative/minehunt/minehunt.pro
@@ -6,6 +6,7 @@ CONFIG += qt plugin
# Input
HEADERS += minehunt.h
SOURCES += main.cpp minehunt.cpp
+RESOURCES = minehunt.qrc
sources.files = minehunt.qml minehunt.pro MinehuntCore
sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt
diff --git a/demos/declarative/minehunt/minehunt.qrc b/demos/declarative/minehunt/minehunt.qrc
new file mode 100644
index 0000000000..fa8e27d383
--- /dev/null
+++ b/demos/declarative/minehunt/minehunt.qrc
@@ -0,0 +1,20 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>minehunt.qml</file>
+ <file>MinehuntCore/Explosion.qml</file>
+ <file>MinehuntCore/Tile.qml</file>
+ <file>MinehuntCore/qmldir</file>
+ <file>MinehuntCore/pics/background.png</file>
+ <file>MinehuntCore/pics/back.png</file>
+ <file>MinehuntCore/pics/bomb-color.png</file>
+ <file>MinehuntCore/pics/bomb.png</file>
+ <file>MinehuntCore/pics/face-sad.png</file>
+ <file>MinehuntCore/pics/face-smile-big.png</file>
+ <file>MinehuntCore/pics/face-smile.png</file>
+ <file>MinehuntCore/pics/flag-color.png</file>
+ <file>MinehuntCore/pics/flag.png</file>
+ <file>MinehuntCore/pics/front.png</file>
+ <file>MinehuntCore/pics/quit.png</file>
+ <file>MinehuntCore/pics/star.png</file>
+</qresource>
+</RCC>
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index fe3c5aafbf..ea9146eb5b 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -518,6 +518,7 @@ QString MenuManager::resolveExeFile(const QString &name)
dir.cd(dirName);
dir.cd(fileName);
+ fileName = fileName.split("/").last();
QFile unixFile(dir.path() + "/" + fileName);
if (unixFile.exists()) return unixFile.fileName();
QFile winR(dir.path() + "\\release\\" + fileName + ".exe");
diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml
index 0ab048e0a1..27f72bbeb7 100644
--- a/demos/qtdemo/xml/examples.xml
+++ b/demos/qtdemo/xml/examples.xml
@@ -18,7 +18,7 @@
<example filename="boxes" name="Boxes" />
<example filename="sub-attaq" name="Sub-attaq" />
<example filename="spectrum" name="Spectrum Analyzer" />
- <example filename="declarative/minehunt" name="Minehunt" executable="false" qml="true"/>
+ <example filename="declarative/minehunt" name="Minehunt"/>
<example filename="declarative/snake" name="Snake" executable="false" qml="true"/>
<example filename="deform" name="Vector Deformation" />
<example filename="books" name="Books" />