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

Add namespace for Android Asset Handler

parent 300d34a2
......@@ -42,6 +42,10 @@
#include <QtCore/QVector>
#include "AndroidAssetsFileEngineHandler_p.h"
namespace QtAndroidAssets {
typedef QVector<QString> FilesList;
struct AndroidAssetDir
......@@ -393,3 +397,4 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file
}
} // namespace QtAndroidAssets
......@@ -66,6 +66,10 @@
#include <QtCore/QSharedPointer>
#include <android/asset_manager.h>
namespace QtAndroidAssets {
struct AndroidAssetDir;
class AndroidAssetsFileEngineHandler: public QObject, public QAbstractFileEngineHandler
......@@ -86,3 +90,5 @@ private:
mutable bool m_hasTriedPrepopulatingCache;
};
} // namespace QtAndroidAssets
......@@ -29,9 +29,9 @@
#if defined(QTANDROIDASSETS_STATIC)
#define QTANDROIDASSETS_EXPORT
#define QTANDROIDASSETS_EXPORT
#else
#define QTANDROIDASSETS_EXPORT Q_DECL_EXPORT
#define QTANDROIDASSETS_EXPORT Q_DECL_EXPORT
#endif
......@@ -39,12 +39,12 @@ QTANDROIDASSETS_EXPORT void installQAndroidAssetHandler(QJniObject & context);
QTANDROIDASSETS_EXPORT void installQAndroidAssetHandler(QJniObject & context)
{
static QScopedPointer<QObject> manager;
if (!manager)
{
QScopedPointer<QJniObject> assetmanager(context.callObject("getAssets", "android/content/res/AssetManager"));
QJniEnvPtr jep;
AAssetManager * assetManager = AAssetManager_fromJava(jep.env(), assetmanager->jObject());
manager.reset(new AndroidAssetsFileEngineHandler(assetManager));
}
static QScopedPointer<QObject> manager;
if (!manager)
{
QScopedPointer<QJniObject> assetmanager(context.callObject("getAssets", "android/content/res/AssetManager"));
QJniEnvPtr jep;
AAssetManager * assetManager = AAssetManager_fromJava(jep.env(), assetmanager->jObject());
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