Added sorting by name, date or size ascending/descending#624
Added sorting by name, date or size ascending/descending#624tobiasKaminsky wants to merge 12 commits intoowncloud:developfrom tobiasKaminsky:sortingFiles
Conversation
|
This is something to discuss with @jancborchardt . An screenshot would be appreciated. Forget about translations, we only define English in development. Translations are done in and pulled from Transifex , synchronized daily with the branch 'develop'. |
|
Nice, this look good! @tobiasKaminsky one thing: The words »ascending« and »descending« are quite confusing. Instead use the more understandable labels:
|
|
cc @MTRichards |
|
I have added a small change: One thing left: When "Sorting by size" all folders stay in A-Z order as there is no information how big/many files they have. One could iterate over every folder and sum up its content, but this is maybe too much, or? |
|
@davivel don’t we have the folder size info by now? The web client displays it with no problems. cc @icewind1991 on how we do that there. |
|
@tobiasKaminsky in the list of the sorting options – let’s actually cut it down to 3:
The reverse orders are of little use and clutter up the list. |
|
And if we don’t have the folder size info for now, we can start out with the »A - Z« and »Newest - Oldest« sorting options. |
|
By the way, they should be styled as radio buttons so it’s obvious which one is currently active. |
|
|
Great stuff here. @jancborchardt the issue with folder size was one of performance, if I remember. I don't know if we can get folder size directly from the server, or if we have to create it locally - if I remember, the issue was that we had to calculate it, which takes time with each sub folder query of the server - and gets worse the bigger the tree. @davivel Is this still the case? |
I do like the reverse order - and your thought removes clutter. |
For test reasons I have added recursive function I have found on stackoverflow. It is only calculating the local folder size. But it seems very quick. |
|
Let’s start small with just the one order and leave out the reverse, ok? Small steps please, we can always add it later if we feel it is necessary. |
- Folder size is computed locally (therefore only downloaded files are obeyed)
Right. I have removed the other options. |
|
Sorry for coming late. About the size of folders, I think it is currently returned by the server in the property < d:quota-used-bytes > , but I am not sure, the name is a bit confusing. I would appreciate confirmation about this. CC @DeepDiver1975 @PVince81 . @tobiasKaminsky , about your solution with local size of folders, probably won't work. The primary reason why we removed in the past the size of folders was not performance, but lack of synchrony with the real size in the server until the user browses down through all the tree of files or a full account synchronization is performed. With the local folder size the lack of synchrony is bigger, since will only match the server when all the files are downloaded (and synchronized). |
|
@tobiasKaminsky by the way, you should join us on IRC in #owncloud-android (freenode IRC)! :) |
|
Yes, now I have a bouncer, so should not lost any more messages :$ |
Regarding the difference between local and server folder size: |
Folder size does not exist in the webdav standard |
but there is an owncloud extension to the standard: 😉 🚀 |
|
That's cool!!! But I still do not understand what < d:quota-used-bytes > is. I cannot find it in Webdav standards, but seem to match the value of folders size. |
|
@tobiasKaminsky , that removed code is the one I mentioned before that does not work fine; it is calculating the folder size from size of descendent files -- but with the current known value of that sizes. If a file several levels down the way of the current file changed, that size won't be synchronized until the user browses down, and the size of its folder ancestor in the current folder will be calculated from a not synchronized value. |
|
Yup, let’s move fast and iterate. No need to wait for folder size calculation, sorting by date and name is already great! :) |
|
Ok. In order to get things clear it should exist a new issue for sorting by size, which refers to the "server-side folder size calculation" task. Otherwise it will maybe get forgotten? |
|
I'm on it. |
There was a problem hiding this comment.
Is there any specific reason to pass getApplicationContext() instead of 'this' ? If the answer is 'no', 'this' should be prefered.
|
Sorry for the delay, I had to swtich to other tasks. Finished the code review, please, check my comments. Additionally, a rebase on develop is needed before testing, BUT not before we merge the release-1.6.0 branch into master & develop. We will do this on Monday. |
|
I have committed all your requested changes. |
There was a problem hiding this comment.
Did you enable auto formatting? We'd rather it's disabled until we unify an official formatter. This makes harder the reviews.
There was a problem hiding this comment.
Yes. It was a try to get automatically lines < 120 characters.
But it has changed to much, so I disabled it.
|
Thanks for the updates. The code review is fine for me now. Please, rebase on 'develop' branch so that @purigarcia may validate the functionality. |
|
We wanted to push this a bit up, so we rebased on 'develop' ourselves, in the branch 'sort_files'. I close this PR to replace it with a #676 |



Hello,
I have added the possibility to sort files/folders by name, date or size.
The option is stored temporary, so it is obeyed if the directory is changed.
Filename sorting fixes also #379
Sorting by size: Folder are sorted by name, as there is no information about the number of files containing the directory.
Sorting is, like dolphin or windows explorer, separated between folder and files.
TODO: Translate to other languages.