From 3a4fb52902f711de9662078aa22f2e92a8d17604 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 17 Sep 2014 11:39:53 +0200 Subject: Put pre-defined GPS log file into qrc file This fixes shadow build breaks and not found log file on OSX when using app bundles. Change-Id: Ib92cb2973c4687b356f8f35d4dbce2c39ef70b17 Reviewed-by: Mitch Curtis --- examples/positioning/logfilepositionsource/logfile.qrc | 5 +++++ .../positioning/logfilepositionsource/logfilepositionsource.cpp | 3 +-- .../positioning/logfilepositionsource/logfilepositionsource.pro | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 examples/positioning/logfilepositionsource/logfile.qrc (limited to 'examples/positioning') diff --git a/examples/positioning/logfilepositionsource/logfile.qrc b/examples/positioning/logfilepositionsource/logfile.qrc new file mode 100644 index 00000000..61213949 --- /dev/null +++ b/examples/positioning/logfilepositionsource/logfile.qrc @@ -0,0 +1,5 @@ + + + simplelog.txt + + diff --git a/examples/positioning/logfilepositionsource/logfilepositionsource.cpp b/examples/positioning/logfilepositionsource/logfilepositionsource.cpp index 0f3c45dd..73001712 100644 --- a/examples/positioning/logfilepositionsource/logfilepositionsource.cpp +++ b/examples/positioning/logfilepositionsource/logfilepositionsource.cpp @@ -48,8 +48,7 @@ LogFilePositionSource::LogFilePositionSource(QObject *parent) { connect(timer, SIGNAL(timeout()), this, SLOT(readNextPosition())); - logFile->setFileName(QCoreApplication::applicationDirPath() - + QDir::separator() + "simplelog.txt"); + logFile->setFileName(":/simplelog.txt"); if (!logFile->open(QIODevice::ReadOnly)) qWarning() << "Error: cannot open source file" << logFile->fileName(); } diff --git a/examples/positioning/logfilepositionsource/logfilepositionsource.pro b/examples/positioning/logfilepositionsource/logfilepositionsource.pro index eb492340..cb9e30ae 100644 --- a/examples/positioning/logfilepositionsource/logfilepositionsource.pro +++ b/examples/positioning/logfilepositionsource/logfilepositionsource.pro @@ -9,8 +9,8 @@ SOURCES = logfilepositionsource.cpp \ clientapplication.cpp \ main.cpp +RESOURCES += \ + logfile.qrc target.path = $$[QT_INSTALL_EXAMPLES]/positioning/logfilepositionsource -log.files = simplelog.txt -log.path = $$[QT_INSTALL_EXAMPLES]/positioning/logfilepositionsource -INSTALLS += target log +INSTALLS += target -- cgit v1.2.1