Skip to content

Commit

Permalink
Fix use of QV8Engine on Qt 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
iBelieve committed Mar 26, 2016
1 parent 82d050e commit b7af2bf
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ script:
- mkdir build; pushd build
- qmake .. && make && sudo make install
- popd
- qmlify -d test/build test
- qmlify -d test/build test; cp -r test/assets test/build/
- xvfb-run -a -s "-screen 0 800x600x24" qmltestrunner -input test/build -import qml_imports

- source /opt/qt56/bin/qt56-env.sh
- rm -r build/*; pushd build
- qmake .. && make && sudo make install
- popd
- qmlify -d test/build test
- qmlify -d test/build test; cp -r test/assets test/build/
- xvfb-run -a -s "-screen 0 800x600x24" qmltestrunner -input test/build -import qml_imports

notifications:
Expand Down
2 changes: 1 addition & 1 deletion quickly/quickly.pri
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QT += qml quick quick_private
QT += core-private qml qml-private

HEADERS += $$PWD/src/plugin.h \
$$PWD/src/nodejs/filesystem.h \
Expand Down
2 changes: 1 addition & 1 deletion quickly/quickly.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VERSION = 0.1

CONFIG += c++11

QT += qml quick quick_private
QT += core-private qml qml-private

HEADERS += $$PWD/src/plugin.h \
$$PWD/src/nodejs/filesystem.h \
Expand Down
2 changes: 1 addition & 1 deletion quickly/src/nodejs/basemodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <QTextStream>
#include <private/qv8engine_p.h>

void BaseModule::throwException(const QString &message) const
void BaseModule::throwError(const QString &message) const
{
QV8Engine::getV4(m_engine)->throwError(message);
}
2 changes: 1 addition & 1 deletion quickly/src/nodejs/basemodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BaseModule : public QObject
BaseModule(QQmlEngine *engine = nullptr) : QObject(engine), m_engine(engine) {}

protected:
void throwException(const QString &message) const;
void throwError(const QString &message) const;

private:
QQmlEngine *m_engine;
Expand Down
3 changes: 1 addition & 2 deletions quickly/src/nodejs/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@

#include <QFile>
#include <QTextStream>
#include <private/qv8engine_p.h>

QString FileSystem::readFile(const QString &path) const
{
QString resolvedPath = resolve(path);

QFile file(resolvedPath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
throwException(QStringLiteral("File does not exist or is not readable: %1").arg(resolvedPath));
throwError(QStringLiteral("File does not exist or is not readable: %1").arg(resolvedPath));
return "";
}

Expand Down

0 comments on commit b7af2bf

Please sign in to comment.