From: masensio Date: Mon, 5 Oct 2015 13:17:39 +0000 (+0200) Subject: Add new attribute to OCFile to know if this file is shared with users/groups X-Git-Tag: oc-android-1.9^2~30^2~66 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/e50bc09321426513ad9a12267de066b131cb1017?ds=inline Add new attribute to OCFile to know if this file is shared with users/groups --- diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index fcde054a..4b689860 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -75,6 +75,7 @@ public class OCFile implements Parcelable, Comparable { private boolean mIsDownloading; private String mEtagInConflict; // Save file etag in the server, when there is a conflict. No conflict = null + private boolean mShareWithUser; /** @@ -120,6 +121,7 @@ public class OCFile implements Parcelable, Comparable { mNeedsUpdateThumbnail = source.readInt() == 1; mIsDownloading = source.readInt() == 1; mEtagInConflict = source.readString(); + mShareWithUser = source.readInt() == 1; } @@ -146,6 +148,7 @@ public class OCFile implements Parcelable, Comparable { dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0); dest.writeInt(mIsDownloading ? 1 : 0); dest.writeString(mEtagInConflict); + dest.writeInt(mShareWithUser ? 1 : 0); } /** @@ -344,6 +347,7 @@ public class OCFile implements Parcelable, Comparable { mNeedsUpdateThumbnail = false; mIsDownloading = false; mEtagInConflict = null; + mShareWithUser = false; } /** @@ -591,4 +595,12 @@ public class OCFile implements Parcelable, Comparable { public void setEtagInConflict(String etagInConflict) { mEtagInConflict = etagInConflict; } + + public boolean isShareWithUser() { + return mShareWithUser; + } + + public void setShareWithUser(boolean shareWithUser) { + this.mShareWithUser = shareWithUser; + } } diff --git a/src/com/owncloud/android/files/FileMenuFilter.java b/src/com/owncloud/android/files/FileMenuFilter.java index 6d53c997..01ca41fd 100644 --- a/src/com/owncloud/android/files/FileMenuFilter.java +++ b/src/com/owncloud/android/files/FileMenuFilter.java @@ -209,7 +209,7 @@ public class FileMenuFilter { } // UNSHARE FILE, with Users - if ( !shareAllowed || !shareWithUsersEnable || (mFile == null || !mFile.isShareByLink())) { + if ( !shareAllowed || !shareWithUsersEnable || (mFile == null || !mFile.isShareWithUser())) { toHide.add(R.id.action_unshare_with_users); } else { toShow.add(R.id.action_unshare_with_users);