Skip to content
Snippets Groups Projects
Commit 1233e5b7 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Revert "Disable medialibrary options during scan"

This reverts commit 5b218c17.
parent 653066db
No related branches found
No related tags found
No related merge requests found
......@@ -41,20 +41,10 @@ class StorageBrowserAdapter extends BaseBrowserAdapter {
private static ArrayList<String> mMediaDirsLocation;
private static ArrayList<String> mCustomDirsLocation;
private boolean mParsing = false;
StorageBrowserAdapter(BaseBrowserFragment fragment) {
super(fragment);
updateMediaDirs();
mParsing = VLCApplication.getMLInstance().isWorking();
}
// Deactivate checkboxes while ML is scanning to avoid ML undefined states
void setServiceActive(boolean started) {
if (started != mParsing) {
mParsing = started;
notifyDataSetChanged();
}
}
@Override
......@@ -77,7 +67,7 @@ class StorageBrowserAdapter extends BaseBrowserAdapter {
vh.binding.browserCheckbox.setState(ThreeStatesCheckbox.STATE_PARTIAL);
else
vh.binding.browserCheckbox.setState(ThreeStatesCheckbox.STATE_UNCHECKED);
vh.binding.setCheckEnabled(!mParsing && !((StorageBrowserFragment) fragment).mScannedDirectory);
vh.binding.setCheckEnabled(!((StorageBrowserFragment) fragment).mScannedDirectory);
if (hasContextMenu)
vh.setContextMenuListener();
}
......
......@@ -23,7 +23,6 @@
package org.videolan.vlc.gui.browser;
import android.content.IntentFilter;
import android.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
......@@ -31,7 +30,6 @@ import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.util.SimpleArrayMap;
import android.text.TextUtils;
import android.view.Menu;
......@@ -44,7 +42,6 @@ import org.videolan.medialibrary.interfaces.EntryPointsEventsCb;
import org.videolan.medialibrary.media.MediaLibraryItem;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.medialibrary.media.Storage;
import org.videolan.vlc.MediaParsingService;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.databinding.BrowserItemBinding;
......@@ -79,8 +76,9 @@ public class StorageBrowserFragment extends FileBrowserFragment implements Entry
mAdapter = new StorageBrowserAdapter(this);
if (bundle == null)
bundle = getArguments();
if (bundle != null)
if (bundle != null){
mScannedDirectory = bundle.getBoolean(KEY_IN_MEDIALIB);
}
}
@Override
......@@ -103,15 +101,6 @@ public class StorageBrowserFragment extends FileBrowserFragment implements Entry
mSnack.show();
}
@Override
public void onResume() {
super.onResume();
final IntentFilter filter = new IntentFilter(MediaParsingService.ACTION_SERVICE_STARTED);
filter.addAction(MediaParsingService.ACTION_SERVICE_ENDED);
LocalBroadcastManager.getInstance(VLCApplication.getAppContext()).registerReceiver(mParsingServiceReceiver, filter);
((StorageBrowserAdapter)mAdapter).setServiceActive(mMediaLibrary.isWorking());
}
@Override
public void onStop() {
super.onStop();
......@@ -260,16 +249,4 @@ public class StorageBrowserFragment extends FileBrowserFragment implements Entry
((StorageBrowserAdapter)mAdapter).updateMediaDirs();
}
}
@Override
protected void onParsingServiceFinished() {
super.onParsingServiceFinished();
((StorageBrowserAdapter)mAdapter).setServiceActive(false);
}
@Override
protected void onParsingServiceStarted() {
super.onParsingServiceStarted();
((StorageBrowserAdapter)mAdapter).setServiceActive(true);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment