Merge pull request #5711 from ZappoMan/fixEntityScriptIncludes

fix a bug in entity script includes and file based includes on windows
This commit is contained in:
Brad Davis 2015-09-03 21:21:42 -07:00
commit 0f70797ab4
2 changed files with 7 additions and 6 deletions

View file

@ -58,11 +58,13 @@ void BatchLoader::start() {
connect(this, &QObject::destroyed, reply, &QObject::deleteLater);
} else {
#ifdef _WIN32
QString fileName = url.toString();
#else
QString fileName = url.toLocalFile();
#endif
// sometimes on windows, we see the toLocalFile() return null,
// in this case we will attempt to simply use the url as a string
if (fileName.isEmpty()) {
fileName = url.toString();
}
qCDebug(scriptengine) << "Reading file at " << fileName;

View file

@ -26,8 +26,7 @@ static int quatMetaTypeId = qRegisterMetaType<glm::quat>();
static int xColorMetaTypeId = qRegisterMetaType<xColor>();
static int pickRayMetaTypeId = qRegisterMetaType<PickRay>();
static int collisionMetaTypeId = qRegisterMetaType<Collision>();
static int qMapURLStringMetaTypeId = qRegisterMetaType<QMap<QUrl,QString>>();
void registerMetaTypes(QScriptEngine* engine) {
qScriptRegisterMetaType(engine, vec4toScriptValue, vec4FromScriptValue);