Skip to content

Commit

Permalink
Code analytic fixes
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Dec 4, 2023
1 parent d18cf20 commit f6ee552
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import com.owncloud.android.db.ProviderMeta
AutoMigration(from = 71, to = 72),
AutoMigration(from = 72, to = 73),
AutoMigration(from = 73, to = 74, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 74, to = 75),
AutoMigration(from = 74, to = 75)
],
exportSchema = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import android.os.RemoteException;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
Expand Down Expand Up @@ -463,7 +462,7 @@ private ContentValues createContentValuesBase(OCFile fileOrFolder) {
cv.put(ProviderTableMeta.FILE_REMOTE_ID, fileOrFolder.getRemoteId());
cv.put(ProviderTableMeta.FILE_LOCAL_ID, fileOrFolder.getLocalId());
cv.put(ProviderTableMeta.FILE_FAVORITE, fileOrFolder.isFavorite());
cv.put(ProviderTableMeta.FILE_HIDDEN, fileOrFolder.getHidden());
cv.put(ProviderTableMeta.FILE_HIDDEN, fileOrFolder.shouldHide());
cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, fileOrFolder.getUnreadCommentsCount());
cv.put(ProviderTableMeta.FILE_OWNER_ID, fileOrFolder.getOwnerId());
cv.put(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME, fileOrFolder.getOwnerDisplayName());
Expand Down Expand Up @@ -503,7 +502,7 @@ private ContentValues createContentValuesForFile(OCFile file) {
cv.put(ProviderTableMeta.FILE_LOCKED, file.isLocked());
final FileLockType lockType = file.getLockType();
cv.put(ProviderTableMeta.FILE_LOCK_TYPE, lockType != null ? lockType.getValue() : -1);
cv.put(ProviderTableMeta.FILE_HIDDEN, file.getHidden());
cv.put(ProviderTableMeta.FILE_HIDDEN, file.shouldHide());
cv.put(ProviderTableMeta.FILE_LOCK_OWNER, file.getLockOwnerId());
cv.put(ProviderTableMeta.FILE_LOCK_OWNER_DISPLAY_NAME, file.getLockOwnerDisplayName());
cv.put(ProviderTableMeta.FILE_LOCK_OWNER_EDITOR, file.getLockOwnerEditor());
Expand Down
10 changes: 1 addition & 9 deletions app/src/main/java/com/owncloud/android/datamodel/OCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;

import com.owncloud.android.R;
import com.owncloud.android.lib.common.network.WebdavEntry;
Expand Down Expand Up @@ -369,13 +368,6 @@ public String getFileNameWithoutExtension(String fileName) {
}
}

public String getFileNameWithExtension(int fileNameLength) {
String fileName = getFileName();
String shortFileName = fileName.substring(0, Math.min(fileName.length(), fileNameLength));
String extension = "." + fileName.substring(fileName.lastIndexOf('.') + 1);
return shortFileName + extension;
}

/**
* The path, where the file is stored locally
*
Expand Down Expand Up @@ -804,7 +796,7 @@ public boolean isFavorite() {
return this.favorite;
}

public boolean getHidden() {
public boolean shouldHide() {
return this.hidden;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
} else {
// TODO CHECK: is this really useful in some point in the code?
mServerFile.setFavorite(mLocalFile.isFavorite());
mServerFile.setHidden(mLocalFile.getHidden());
mServerFile.setHidden(mLocalFile.shouldHide());
mServerFile.setLastSyncDateForData(mLocalFile.getLastSyncDateForData());
mServerFile.setStoragePath(mLocalFile.getStoragePath());
mServerFile.setParentId(mLocalFile.getParentId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -950,7 +949,7 @@ private void prepareListOfHiddenFiles() {
listOfHiddenFiles.clear();

mFiles.forEach(file -> {
if (file.getHidden()) {
if (file.shouldHide()) {
listOfHiddenFiles.add(file.getFileName());
}
});
Expand Down

0 comments on commit f6ee552

Please sign in to comment.