From: masensio Date: Mon, 22 Jun 2015 13:37:38 +0000 (+0200) Subject: Fixed upload of files into non-root folders X-Git-Tag: oc-android-1.7.2~1^2~5^2^2~1 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/a818aaca47831f10d4843d56c598047dbd31e01a?ds=inline;hp=--cc Fixed upload of files into non-root folders Fixed condition selecting grid or list mode - at least an image! --- a818aaca47831f10d4843d56c598047dbd31e01a diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 0734b576..7c3f6f50 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -620,10 +620,7 @@ public class FileDisplayActivity extends HookActivity String[] filePaths = data.getStringArrayExtra(UploadFilesActivity.EXTRA_CHOSEN_FILES); if (filePaths != null) { String[] remotePaths = new String[filePaths.length]; - String remotePathBase = ""; - - if (!remotePathBase.endsWith(OCFile.PATH_SEPARATOR)) - remotePathBase += OCFile.PATH_SEPARATOR; + String remotePathBase = getCurrentDir().getRemotePath(); for (int j = 0; j< remotePaths.length; j++) { remotePaths[j] = remotePathBase + (new File(filePaths[j])).getName(); } diff --git a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 2432380f..941654b2 100644 --- a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -397,8 +397,8 @@ public class ExtendedListFragment extends Fragment mListFooterView.invalidate(); } else { -// mGridView.removeFooterView(mGridFooterView); -// mListView.removeFooterView(mListFooterView); + mGridView.removeFooterView(mGridFooterView); + mListView.removeFooterView(mListFooterView); } } diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index e56c6e8b..68deb031 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -430,9 +430,10 @@ public class OCFileListFragment extends ExtendedListFragment { setFooterText(generateFooterText(filesCount, foldersCount)); // decide grid vs list view - OwnCloudVersion version = AccountUtils.getServerVersion(((FileActivity)mContainerActivity).getAccount()); + OwnCloudVersion version = AccountUtils.getServerVersion( + ((FileActivity)mContainerActivity).getAccount()); if (version != null && version.supportsRemoteThumbnails() && - imagesCount == filesCount) { + imagesCount > 0 && imagesCount == filesCount) { switchToGridView(); } else { switchToListView();