Merge pull request #9802 from JosJuice/android-game-file-cache-path

Android: Stop using custom path for GameFileCache
This commit is contained in:
Léo Lam 2021-06-13 12:53:49 +02:00 committed by GitHub
commit 90a994f937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 13 deletions

View File

@ -17,12 +17,12 @@ public class GameFileCache
@Keep @Keep
private long mPointer; private long mPointer;
public GameFileCache(String path) public GameFileCache()
{ {
mPointer = newGameFileCache(path); mPointer = newGameFileCache();
} }
private static native long newGameFileCache(String path); private static native long newGameFileCache();
@Override @Override
public native void finalize(); public native void finalize();

View File

@ -172,7 +172,7 @@ public final class GameFileCacheService extends IntentService
// Load the game list cache if it isn't already loaded, otherwise do nothing // Load the game list cache if it isn't already loaded, otherwise do nothing
if (ACTION_LOAD.equals(intent.getAction()) && gameFileCache == null) if (ACTION_LOAD.equals(intent.getAction()) && gameFileCache == null)
{ {
GameFileCache temp = new GameFileCache(getCacheDir() + File.separator + "gamelist.cache"); GameFileCache temp = new GameFileCache();
synchronized (temp) synchronized (temp)
{ {
gameFileCache = temp; gameFileCache = temp;

View File

@ -27,10 +27,10 @@ static UICommon::GameFileCache* GetPointer(JNIEnv* env, jobject obj)
extern "C" { extern "C" {
#endif #endif
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_newGameFileCache( JNIEXPORT jlong JNICALL
JNIEnv* env, jclass, jstring path) Java_org_dolphinemu_dolphinemu_model_GameFileCache_newGameFileCache(JNIEnv* env, jclass)
{ {
return reinterpret_cast<jlong>(new UICommon::GameFileCache(GetJString(env, path))); return reinterpret_cast<jlong>(new UICommon::GameFileCache());
} }
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_finalize(JNIEnv* env, JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_finalize(JNIEnv* env,

View File

@ -43,10 +43,6 @@ GameFileCache::GameFileCache() : m_path(File::GetUserPath(D_CACHE_IDX) + "gameli
{ {
} }
GameFileCache::GameFileCache(std::string path) : m_path(std::move(path))
{
}
void GameFileCache::ForEach(std::function<void(const std::shared_ptr<const GameFile>&)> f) const void GameFileCache::ForEach(std::function<void(const std::shared_ptr<const GameFile>&)> f) const
{ {
for (const std::shared_ptr<const GameFile>& item : m_cached_files) for (const std::shared_ptr<const GameFile>& item : m_cached_files)

View File

@ -31,8 +31,7 @@ public:
Yes = 1, Yes = 1,
}; };
GameFileCache(); // Uses the default path GameFileCache();
explicit GameFileCache(std::string path);
void ForEach(std::function<void(const std::shared_ptr<const GameFile>&)> f) const; void ForEach(std::function<void(const std::shared_ptr<const GameFile>&)> f) const;