|
@@ -401,7 +401,7 @@ public class FileOperationsHelper {
|
|
|
/**
|
|
|
* @return 'True' if the server supports the Search Users API
|
|
|
*/
|
|
|
- public boolean isSearchUsersSupportedSupported() {
|
|
|
+ public boolean isSearchUserSupportedSupported() {
|
|
|
if (mFileActivity.getAccount() != null) {
|
|
|
OwnCloudVersion serverVersion = AccountUtils.getServerVersion(mFileActivity.getAccount());
|
|
|
return (serverVersion != null && serverVersion.isSearchUsersSupported());
|
|
@@ -494,22 +494,29 @@ public class FileOperationsHelper {
|
|
|
service.putExtra(OperationsService.EXTRA_NEWNAME, newFilename);
|
|
|
mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
|
|
|
- mFileActivity.showLoadingDialog(mFileActivity.getApplicationContext().
|
|
|
- getString(R.string.wait_a_moment));
|
|
|
+ mFileActivity.showLoadingDialog(mFileActivity.getString(R.string.wait_a_moment));
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void removeFile(OCFile file, boolean onlyLocalCopy) {
|
|
|
- // RemoveFile
|
|
|
- Intent service = new Intent(mFileActivity, OperationsService.class);
|
|
|
- service.setAction(OperationsService.ACTION_REMOVE);
|
|
|
- service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
|
|
|
- service.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath());
|
|
|
- service.putExtra(OperationsService.EXTRA_REMOVE_ONLY_LOCAL, onlyLocalCopy);
|
|
|
- mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
+ /**
|
|
|
+ * Start operations to delete one or several files
|
|
|
+ *
|
|
|
+ * @param files Files to delete
|
|
|
+ * @param onlyLocalCopy When 'true' only local copy of the files is removed; otherwise files are also deleted
|
|
|
+ * in the server.
|
|
|
+ */
|
|
|
+ public void removeFiles(Collection<OCFile> files, boolean onlyLocalCopy) {
|
|
|
+ for (OCFile file : files) {
|
|
|
+ // RemoveFile
|
|
|
+ Intent service = new Intent(mFileActivity, OperationsService.class);
|
|
|
+ service.setAction(OperationsService.ACTION_REMOVE);
|
|
|
+ service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
|
|
|
+ service.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath());
|
|
|
+ service.putExtra(OperationsService.EXTRA_REMOVE_ONLY_LOCAL, onlyLocalCopy);
|
|
|
+ mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
+ }
|
|
|
|
|
|
- mFileActivity.showLoadingDialog(mFileActivity.getApplicationContext().
|
|
|
- getString(R.string.wait_a_moment));
|
|
|
+ mFileActivity.showLoadingDialog(mFileActivity.getString(R.string.wait_a_moment));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -522,8 +529,7 @@ public class FileOperationsHelper {
|
|
|
service.putExtra(OperationsService.EXTRA_CREATE_FULL_PATH, createFullPath);
|
|
|
mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
|
|
|
- mFileActivity.showLoadingDialog(mFileActivity.getApplicationContext().
|
|
|
- getString(R.string.wait_a_moment));
|
|
|
+ mFileActivity.showLoadingDialog(mFileActivity.getString(R.string.wait_a_moment));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -552,7 +558,7 @@ public class FileOperationsHelper {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Start operations to move on or several files
|
|
|
+ * Start operations to move one or several files
|
|
|
*
|
|
|
* @param files Files to move
|
|
|
* @param targetFolder Folder where the files while be moved into
|
|
@@ -566,12 +572,13 @@ public class FileOperationsHelper {
|
|
|
service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
|
|
|
mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
}
|
|
|
+ mFileActivity.showLoadingDialog(mFileActivity.getString(R.string.wait_a_moment));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Start copy file operation
|
|
|
+ * Start operations to copy one or several files
|
|
|
*
|
|
|
- * @param files Files to move
|
|
|
+ * @param files Files to copy
|
|
|
* @param targetFolder Folder where the files while be copied into
|
|
|
*/
|
|
|
public void copyFiles(Collection<OCFile> files, OCFile targetFolder) {
|
|
@@ -583,9 +590,7 @@ public class FileOperationsHelper {
|
|
|
service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
|
|
|
mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
}
|
|
|
-
|
|
|
- mFileActivity.showLoadingDialog(mFileActivity.getApplicationContext().
|
|
|
- getString(R.string.wait_a_moment));
|
|
|
+ mFileActivity.showLoadingDialog(mFileActivity.getString(R.string.wait_a_moment));
|
|
|
}
|
|
|
|
|
|
public long getOpIdWaitingFor() {
|
|
@@ -621,7 +626,7 @@ public class FileOperationsHelper {
|
|
|
mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service);
|
|
|
|
|
|
mFileActivity.showLoadingDialog(
|
|
|
- mFileActivity.getApplicationContext().getString(R.string.wait_checking_credentials)
|
|
|
+ mFileActivity.getString(R.string.wait_checking_credentials)
|
|
|
);
|
|
|
}
|
|
|
}
|