mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
- cleaned up
This commit is contained in:
parent
b6f773bf8c
commit
fd12caf9ae
7 changed files with 5 additions and 39 deletions
|
@ -31,6 +31,7 @@ import com.owncloud.android.R;
|
|||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
|
||||
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
|
||||
|
||||
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
|
||||
import com.owncloud.android.lib.common.network.WebdavUtils;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
|
@ -292,4 +293,6 @@ public class FileOperationsHelper {
|
|||
public void setOpIdWaitingFor(long waitingForOpId) {
|
||||
mWaitingForOpId = waitingForOpId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import com.owncloud.android.utils.FileStorageUtils;
|
|||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.MediaScannerConnection;
|
||||
|
||||
/**
|
||||
* Remote operation performing the read of remote file in the ownCloud server.
|
||||
|
@ -195,6 +194,7 @@ public class SynchronizeFileOperation extends SyncOperation {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
Log_OC.i(TAG, "Synchronizing " + mAccount.name + ", file " + mLocalFile.getRemotePath() + ": " + result.getLogMessage());
|
||||
|
||||
return result;
|
||||
|
|
|
@ -30,12 +30,10 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.database.Cursor;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.os.IBinder;
|
||||
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
|
||||
import com.owncloud.android.files.services.FileDownloader;
|
||||
|
|
|
@ -19,7 +19,6 @@ package com.owncloud.android.ui.fragment;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.media.MediaScannerConnection;
|
||||
|
@ -34,15 +33,10 @@ import android.widget.AdapterView;
|
|||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.datamodel.FileDataStorageManager;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.files.FileMenuFilter;
|
||||
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
|
||||
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.operations.RemoveFileOperation;
|
||||
import com.owncloud.android.operations.RenameFileOperation;
|
||||
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
||||
import com.owncloud.android.ui.activity.MoveActivity;
|
||||
import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
|
||||
|
@ -79,7 +73,6 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|||
private OCFile mFile = null;
|
||||
private FileListListAdapter mAdapter;
|
||||
|
||||
private Handler mHandler;
|
||||
private OCFile mTargetFile;
|
||||
|
||||
|
||||
|
@ -308,13 +301,6 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|||
case R.id.action_download_file:
|
||||
case R.id.action_sync_file: {
|
||||
mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile);
|
||||
|
||||
Log_OC.d("mediascan", "path: " + mTargetFile.getRemotePath());
|
||||
|
||||
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
|
||||
Log_OC.d("mediaScan", "path: "+ storageManager.getFileByPath(mTargetFile.getRemotePath()).getStoragePath());
|
||||
// TODO triggerMediaScan
|
||||
|
||||
return true;
|
||||
}
|
||||
case R.id.action_cancel_download:
|
||||
|
@ -351,7 +337,6 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Use this to query the {@link OCFile} that is currently
|
||||
* being displayed by this fragment
|
||||
|
@ -404,10 +389,4 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|||
}
|
||||
}
|
||||
|
||||
private void triggerMediaScan(String path){
|
||||
MediaScannerConnection.scanFile(
|
||||
getActivity().getApplicationContext(),
|
||||
new String[]{path},
|
||||
null,null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,6 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.media.MediaScannerConnection.OnScanCompletedListener;
|
||||
import android.net.Uri;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
@ -435,9 +433,6 @@ ViewPager.OnPageChangeListener, OnRemoteOperationListener {
|
|||
public void onReceive(Context context, Intent intent) {
|
||||
String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);
|
||||
String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);
|
||||
|
||||
|
||||
|
||||
if (getAccount().name.equals(accountName) &&
|
||||
downloadedRemotePath != null) {
|
||||
|
||||
|
@ -446,14 +441,6 @@ ViewPager.OnPageChangeListener, OnRemoteOperationListener {
|
|||
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
|
||||
//boolean isOffscreen = Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();
|
||||
|
||||
if (downloadWasFine){
|
||||
// Trigger Mediascan
|
||||
MediaScannerConnection.scanFile(
|
||||
context,
|
||||
new String[]{file.getStoragePath()},
|
||||
null,null);
|
||||
}
|
||||
|
||||
if (position >= 0 && intent.getAction().equals(FileDownloader.getDownloadFinishMessage())) {
|
||||
if (downloadWasFine) {
|
||||
mPreviewImagePagerAdapter.updateFile(position, file);
|
||||
|
|
|
@ -328,7 +328,6 @@ public class PreviewImageFragment extends FileFragment {
|
|||
finish();
|
||||
}
|
||||
|
||||
|
||||
private class BitmapLoader extends AsyncTask<String, Void, Bitmap> {
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue