Skip to content

Commit

Permalink
Merge pull request owncloud#1082 from owncloud/ignoreHiddenFiles
Browse files Browse the repository at this point in the history
ignore hidden files also if they are images for counting
  • Loading branch information
masensio committed Aug 24, 2015
2 parents e836fd6 + e9ca430 commit 8c9270e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/com/owncloud/android/datamodel/OCFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@ public boolean isImage() {
FileStorageUtils.getMimeTypeFromName(mRemotePath).startsWith("image/"));
}

/**
* @return 'True' if the file is hidden
*/
public boolean isHidden() {
return getFileName().startsWith(".");
}

public String getPermissions() {
return mPermissions;
}
Expand Down
9 changes: 6 additions & 3 deletions src/com/owncloud/android/ui/fragment/OCFileListFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,12 @@ private void updateLayout() {
if (file.isFolder()) {
foldersCount++;
} else {
filesCount++;
if (file.isImage()){
imagesCount++;
if (!file.isHidden()) {
filesCount++;

if (file.isImage()) {
imagesCount++;
}
}
}
}
Expand Down

0 comments on commit 8c9270e

Please sign in to comment.