mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
ReceiveExternalFiles:
- fix no upload possible after creation new folder - obey canWrite permission for folder creation Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
dbad1aa991
commit
f99c7f2ddd
2 changed files with 20 additions and 18 deletions
|
@ -118,6 +118,7 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
|
||||||
newDir.setRemoteId(createdRemoteFolder.getRemoteId());
|
newDir.setRemoteId(createdRemoteFolder.getRemoteId());
|
||||||
newDir.setModificationTimestamp(System.currentTimeMillis());
|
newDir.setModificationTimestamp(System.currentTimeMillis());
|
||||||
newDir.setEncrypted(FileStorageUtils.checkEncryptionStatus(newDir, getStorageManager()));
|
newDir.setEncrypted(FileStorageUtils.checkEncryptionStatus(newDir, getStorageManager()));
|
||||||
|
newDir.setPermissions(createdRemoteFolder.getPermissions());
|
||||||
getStorageManager().saveFile(newDir);
|
getStorageManager().saveFile(newDir);
|
||||||
|
|
||||||
Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
|
Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
|
||||||
|
|
|
@ -59,12 +59,24 @@ import android.widget.ListView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.DrawableRes;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.StringRes;
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.appcompat.app.AlertDialog.Builder;
|
||||||
|
import androidx.appcompat.widget.SearchView;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
|
import androidx.core.view.MenuItemCompat;
|
||||||
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
import com.nextcloud.client.preferences.AppPreferences;
|
import com.nextcloud.client.preferences.AppPreferences;
|
||||||
|
import com.nextcloud.client.preferences.PreferenceManager;
|
||||||
import com.owncloud.android.MainApp;
|
import com.owncloud.android.MainApp;
|
||||||
import com.owncloud.android.R;
|
import com.owncloud.android.R;
|
||||||
import com.owncloud.android.datamodel.OCFile;
|
import com.owncloud.android.datamodel.OCFile;
|
||||||
import com.nextcloud.client.preferences.PreferenceManager;
|
|
||||||
import com.owncloud.android.files.services.FileUploader;
|
import com.owncloud.android.files.services.FileUploader;
|
||||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||||
|
@ -104,20 +116,6 @@ import java.util.List;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.annotation.StringRes;
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import androidx.appcompat.app.AlertDialog.Builder;
|
|
||||||
import androidx.appcompat.widget.SearchView;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
|
||||||
import androidx.core.view.MenuItemCompat;
|
|
||||||
import androidx.fragment.app.DialogFragment;
|
|
||||||
import androidx.fragment.app.FragmentManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This can be used to upload things to an ownCloud instance.
|
* This can be used to upload things to an ownCloud instance.
|
||||||
*/
|
*/
|
||||||
|
@ -1064,8 +1062,11 @@ public class ReceiveExternalFilesActivity extends FileActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
// tint search event
|
// tint search event
|
||||||
final MenuItem item = menu.findItem(R.id.action_search);
|
final MenuItem searchMenuItem = menu.findItem(R.id.action_search);
|
||||||
SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
|
SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchMenuItem);
|
||||||
|
|
||||||
|
MenuItem newFolderMenuItem = menu.findItem(R.id.action_create_dir);
|
||||||
|
newFolderMenuItem.setEnabled(mFile.canWrite());
|
||||||
|
|
||||||
// hacky as no default way is provided
|
// hacky as no default way is provided
|
||||||
int fontColor = ThemeUtils.fontColor(this);
|
int fontColor = ThemeUtils.fontColor(this);
|
||||||
|
|
Loading…
Reference in a new issue