Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/qtlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Bottou <leon@bottou.org>2013-11-24 02:59:25 +0400
committerLeon Bottou <leon@bottou.org>2013-11-24 03:02:16 +0400
commit32de303572d8b06fc20f01e858d53df44ada440b (patch)
tree160b831c5286db9a8406f0fb52004bf32c8ffe09
parent65cf3ef76008ff9c3dc0de8f90e25560663dc133 (diff)
avoid qurl::islocalfile for qt<4.7.0
-rw-r--r--packages/qtcore/qtcore.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/qtcore/qtcore.cpp b/packages/qtcore/qtcore.cpp
index e995af5..073d545 100644
--- a/packages/qtcore/qtcore.cpp
+++ b/packages/qtcore/qtcore.cpp
@@ -547,10 +547,12 @@ static int
qurl_tolocalfile(lua_State *L)
{
QUrl url = luaQ_checkqvariant<QUrl>(L, 1);
- if (url.isLocalFile())
- lua_pushstring(L, url.toLocalFile().toLocal8Bit().constData());
- else
+#if QT_VERSION >= 0x040700
+ if (!url.isLocalFile())
lua_pushnil(L);
+ else
+#endif
+ lua_pushstring(L, url.toLocalFile().toLocal8Bit().constData());
return 1;
}