Commit 6aefaa1d authored by Sergey Galin's avatar Sergey Galin

Add namespace for Android Asset Handler

parent 300d34a2
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
#include <QtCore/QVector> #include <QtCore/QVector>
#include "AndroidAssetsFileEngineHandler_p.h" #include "AndroidAssetsFileEngineHandler_p.h"
namespace QtAndroidAssets {
typedef QVector<QString> FilesList; typedef QVector<QString> FilesList;
struct AndroidAssetDir struct AndroidAssetDir
...@@ -393,3 +397,4 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file ...@@ -393,3 +397,4 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file
} }
} // namespace QtAndroidAssets
...@@ -66,6 +66,10 @@ ...@@ -66,6 +66,10 @@
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
#include <android/asset_manager.h> #include <android/asset_manager.h>
namespace QtAndroidAssets {
struct AndroidAssetDir; struct AndroidAssetDir;
class AndroidAssetsFileEngineHandler: public QObject, public QAbstractFileEngineHandler class AndroidAssetsFileEngineHandler: public QObject, public QAbstractFileEngineHandler
...@@ -86,3 +90,5 @@ private: ...@@ -86,3 +90,5 @@ private:
mutable bool m_hasTriedPrepopulatingCache; mutable bool m_hasTriedPrepopulatingCache;
}; };
} // namespace QtAndroidAssets
...@@ -45,6 +45,6 @@ QTANDROIDASSETS_EXPORT void installQAndroidAssetHandler(QJniObject & context) ...@@ -45,6 +45,6 @@ QTANDROIDASSETS_EXPORT void installQAndroidAssetHandler(QJniObject & context)
QScopedPointer<QJniObject> assetmanager(context.callObject("getAssets", "android/content/res/AssetManager")); QScopedPointer<QJniObject> assetmanager(context.callObject("getAssets", "android/content/res/AssetManager"));
QJniEnvPtr jep; QJniEnvPtr jep;
AAssetManager * assetManager = AAssetManager_fromJava(jep.env(), assetmanager->jObject()); AAssetManager * assetManager = AAssetManager_fromJava(jep.env(), assetmanager->jObject());
manager.reset(new AndroidAssetsFileEngineHandler(assetManager)); manager.reset(new QtAndroidAssets::AndroidAssetsFileEngineHandler(assetManager));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment