It is not working yet...
But it would make simulator debugging easier.
#-------------------------------------------------
VERSION = 0.4.80
+USE_RESOURCES=0
QT += webkit network
CONFIG += qt webkit mobility
VERSION_STRING = '\\"$${VERSION}\\"'
DEFINES += QP_VERSION=\"$${VERSION_STRING}\"
+contains(USE_RESOURCES,1) {
+ DEFINES += USE_RESOURCES=1
+}
+
!debug {
# DEFINES += QT_NO_DEBUG_OUTPUT
}
BINDIR=$$PREFIX/bin
DESKTOPDIR=$$PREFIX/share/applications
- DATADIR=$$PREFIX/share/apps/$${TARGET}
+ contains(USE_RESOURCES,1) {
+ DATADIR=":"
+ } else {
+ DATADIR=$$PREFIX/share/apps/$${TARGET}
+ }
DEFINES += DATADIR=\\\"$${DATADIR}\\\" PKGDATADIR=\\\"$${PKGDATADIR}\\\"
}
INSTALLS += icon48
INSTALLS += icon64
INSTALLS += iconscalable
- INSTALLS += css
- INSTALLS += i18n
- INSTALLS += stations
+ !contains(USE_RESOURCES,1) {
+ INSTALLS += css
+ INSTALLS += i18n
+ INSTALLS += stations
+ }
}
-harmattan {
- qml.files = resources/harmattan/qml/*.qml resources/harmattan/qml/*.js
- qml.path = $$DATADIR/qml
- INSTALLS += qml
+!contains(USE_RESOURCES,1) {
+ harmattan {
+ qml.files = resources/harmattan/qml/*.qml resources/harmattan/qml/*.js
+ qml.path = $$DATADIR/qml
+ INSTALLS += qml
+ }
}
-
+contains(USE_RESOURCES,1) {
+ RESOURCES += \
+ quandoparte.qrc
+}
QDir::setSearchPaths("css", QStringList(DATADIR "/css"));
QDir::setSearchPaths("stations", QStringList(DATADIR "/stations"));
QDir::setSearchPaths("i18n", QStringList(DATADIR "/i18n"));
+#ifdef USE_RESOURCES
+ QDir::setSearchPaths("qml", QStringList(DATADIR ""));
+#else
QDir::setSearchPaths("qml", QStringList(DATADIR "/qml"));
+#endif
#ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeKeypadTabOrder);
--- /dev/null
+<RCC>
+ <qresource prefix="/">
+ <file alias="uiconstants.js">resources/harmattan/qml/uiconstants.js</file>
+ <file alias="StationPage.qml">resources/harmattan/qml/StationPage.qml</file>
+ <file alias="StationListPage.qml">resources/harmattan/qml/StationListPage.qml</file>
+ <file alias="StationListPage.js">resources/harmattan/qml/StationListPage.js</file>
+ <file alias="SearchBar.qml">resources/harmattan/qml/SearchBar.qml</file>
+ <file alias="PageHeader.qml">resources/harmattan/qml/PageHeader.qml</file>
+ <file alias="main.qml">resources/harmattan/qml/main.qml</file>
+ <file alias="InfoBar.qml">resources/harmattan/qml/InfoBar.qml</file>
+ <file alias="DroppedShadow.qml">resources/harmattan/qml/DroppedShadow.qml</file>
+ <file alias="DelayIndicator.qml">resources/harmattan/qml/DelayIndicator.qml</file>
+ <file alias="AboutPage.qml">resources/harmattan/qml/AboutPage.qml</file>
+ </qresource>
+ <qresource prefix="/stations">
+ <file alias="stations.qpl">resources/stations/stations.qpl</file>
+ </qresource>
+ <qresource prefix="/i18n">
+ <file>resources/i18n/quandoparte_it.qm</file>
+ </qresource>
+</RCC>
// search Paths seem to be broken in Harmattan?
-static QString trueFilePath(QString path)
+static QString trueFilePath(const QString &path)
{
qDebug() << "searching for" << path;
+#if USE_RESOURCES
+ return path;
+#else
QString searchPathName = path.section(':', 0, 0);
qDebug() << "path is" << searchPathName;
QString fileName = path.section(':', 1, 1);
}
qDebug() << "file not found";
return QString();
+#endif
}
View::View(QWidget *parent) :
// This does not seem ot work in harmattan. As a workaround, change dir to
// the qml dir, then load the file.
// m_view->setSource(QUrl::fromLocalFile("qml:main.qml"));
- setSource(QUrl::fromLocalFile(trueFilePath("qml:main.qml")));
+ future.waitForFinished();
+ setSource(trueFilePath("qml:main.qml"));
}
View::~View()