-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
public class RemoveFileDialogFragment extends ConfirmationDialogFragment
implements ConfirmationDialogFragmentListener {
public class RemoveFileDialogFragment extends ConfirmationDialogFragment
implements ConfirmationDialogFragmentListener {
int messageStringId = R.string.confirmation_remove_alert;
int posBtn = R.string.confirmation_remove_remote;
int messageStringId = R.string.confirmation_remove_alert;
int posBtn = R.string.confirmation_remove_remote;
if (file.isFolder()) {
messageStringId = R.string.confirmation_remove_folder_alert;
posBtn = R.string.confirmation_remove_remote_and_local;
if (file.isFolder()) {
messageStringId = R.string.confirmation_remove_folder_alert;
posBtn = R.string.confirmation_remove_remote_and_local;
args.putInt(ARG_CONF_RESOURCE_ID, messageStringId);
args.putStringArray(ARG_CONF_ARGUMENTS, new String[]{file.getFileName()});
args.putInt(ARG_POSITIVE_BTN_RES, posBtn);
args.putInt(ARG_CONF_RESOURCE_ID, messageStringId);
args.putStringArray(ARG_CONF_ARGUMENTS, new String[]{file.getFileName()});
args.putInt(ARG_POSITIVE_BTN_RES, posBtn);
- args.putInt(ARG_NEUTRAL_BTN_RES, neuBtn);
- args.putInt(ARG_NEGATIVE_BTN_RES, R.string.common_cancel);
+ args.putInt(ARG_NEUTRAL_BTN_RES, R.string.common_no);
+ args.putInt(ARG_NEGATIVE_BTN_RES, negBtn);
FileDataStorageManager storageManager = cg.getStorageManager();
if (storageManager.getFileById(mTargetFile.getFileId()) != null) {
cg.getFileOperationsHelper().removeFile(mTargetFile, false);
FileDataStorageManager storageManager = cg.getStorageManager();
if (storageManager.getFileById(mTargetFile.getFileId()) != null) {
cg.getFileOperationsHelper().removeFile(mTargetFile, false);
- public void onNeutral(String callerTag) {
- String path = mTargetFile.getStoragePath();
- ComponentsGetter cg = (ComponentsGetter)getSherlockActivity();
+ public void onCancel(String callerTag) {
+ ComponentsGetter cg = (ComponentsGetter)getActivity();
cg.getFileOperationsHelper().removeFile(mTargetFile, true);
FileDataStorageManager storageManager = cg.getStorageManager();
cg.getFileOperationsHelper().removeFile(mTargetFile, true);
FileDataStorageManager storageManager = cg.getStorageManager();
- // Remove etag for parent, if file is a keep_in_sync
- // or is a folder and contains keep_in_sync
- if (mTargetFile.keepInSync() || containsKeepInSync) {
+ // Remove etag for parent, if file is a favorite
+ // or is a folder and contains favorite
+ if (mTargetFile.isFavorite() || containsFavorite) {