QTfrontend/util/FileEngine.cpp
changeset 12724 d47ab9245259
parent 10235 bafca1686867
child 13869 bd796e4d8920
--- a/QTfrontend/util/FileEngine.cpp	Fri Oct 20 23:49:52 2017 +0200
+++ b/QTfrontend/util/FileEngine.cpp	Sat Oct 21 00:58:01 2017 +0200
@@ -295,7 +295,11 @@
 
 QString FileEngine::errorString() const
 {
+#if PHYSFS_VER_MAJOR >= 3
+    return PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode());
+#else
     return PHYSFS_getLastError();
+#endif
 }
 
 bool FileEngine::supportsExtension(Extension extension) const
@@ -352,7 +356,12 @@
 
 QString FileEngineHandler::errorStr()
 {
-    QString s = QString::fromUtf8(PHYSFS_getLastError());
+    QString s;
+#if PHYSFS_VER_MAJOR >= 3
+    s = QString::fromUtf8(PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()));
+#else
+    s = QString::fromUtf8(PHYSFS_getLastError());
+#endif
     return s.isEmpty() ? "ok" : s;
 }