Commit 45a6c34a authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Remove harmful optimization

parent d8aebfd9
......@@ -614,10 +614,6 @@ void AndroidMediaLibrary::onDiscoveryStarted( const std::string& entryPoint )
JNIEnv *env = getEnv();
if (env == NULL)
return;
if (mainStorage.empty()) {
discoveryEnded = false;
mainStorage = entryPoint;
}
jstring ep = env->NewStringUTF(entryPoint.c_str());
jobject thiz = getWeakReference(env);
if (thiz != NULL)
......@@ -652,10 +648,6 @@ void AndroidMediaLibrary::onDiscoveryCompleted( const std::string& entryPoint )
JNIEnv *env = getEnv();
if (env == NULL)
return;
if (!entryPoint.compare(mainStorage)) {
discoveryEnded = true;
mainStorage.clear();
}
jstring ep = env->NewStringUTF(entryPoint.c_str());
jobject thiz = getWeakReference(env);
if (thiz) {
......@@ -688,7 +680,6 @@ void AndroidMediaLibrary::onReloadCompleted( const std::string& entryPoint )
JNIEnv *env = getEnv();
if (env == NULL)
return;
discoveryEnded = true;
jstring ep = env->NewStringUTF(entryPoint.c_str());
jobject thiz = getWeakReference(env);
if (thiz) {
......@@ -749,8 +740,6 @@ void AndroidMediaLibrary::onEntryPointRemoved( const std::string& entryPoint, bo
void AndroidMediaLibrary::onParsingStatsUpdated( uint32_t percent)
{
m_progress = percent;
if (!discoveryEnded)
return;
JNIEnv *env = getEnv();
if (env == NULL)
return;
......
......@@ -128,8 +128,6 @@ private:
medialibrary::IMediaLibrary* p_ml;
std::shared_ptr<AndroidDeviceLister> p_lister;
medialibrary::IDeviceListerCb* p_DeviceListerCb = nullptr;
std::string mainStorage = "";
bool discoveryEnded = false;
bool m_paused = false;
uint32_t m_nbDiscovery = 0, m_progress = 0, m_mediaAddedType = 0, m_mediaUpdatedType = 0;
};
......
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