Bug 158267 - data grouping weeks days,etc
Summary: data grouping weeks days,etc
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Rafael Fernández López
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-23 14:28 UTC by Alexandre Pereira
Modified: 2008-02-26 07:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch (22.88 KB, patch)
2008-02-25 20:28 UTC, Peter Penz
Details
Sample screenshot after the patch (106.04 KB, image/png)
2008-02-25 20:29 UTC, Peter Penz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Pereira 2008-02-23 14:28:51 UTC
Version:           4.0.1 (using KDE 4.0.1)
Installed from:    SuSE RPMs
OS:                Linux

i really like the idea of grouping files.

i would like to use date sort grouping , but not only for months , but for weeks and days or any other specified time.

the reason is that almost every month i have so many files , that sorting is completly helpless.

sorting by weeks or days could help alot.

also , it would be nice that double clicking in the group title ( or maybe a button or something ) would "shade" that group ( or hide that grup )

thanks
Comment 1 Peter Penz 2008-02-23 14:34:16 UTC
Thanks for the input! I've reassigned this issue to Rafael, who is responsible for the categorization view.

> also , it would be nice that double clicking in the group title
> ( or maybe a button or something ) would "shade" that group
> ( or hide that grup ) 

Please only one bug per bug report ;-) The shade feature was already requested AFAIK, I'm not sure whether it is on the TODO list for Rafael.
Comment 2 Rafael Fernández López 2008-02-23 15:34:33 UTC
Actually this bug report crashes directly with bug #149655, which I fixed some time ago.

Maybe we can do this configurable Peter?
Comment 3 Peter Penz 2008-02-23 16:23:29 UTC
> Maybe we can do this configurable Peter?

Hm, I think as there is no "one granularity" for all the needs of users making this configurable might make sense. But I'd see this as a global configuration (Configure Dolphin -> View Modes -> General or Icon), not a setting that is remembered for each directory.

But I think we should carefully think about such a setting, as we have the same problem for "Sort by size" (e. g. is "Small", "Medium" and "Large" enough?).
Comment 4 Alexandre Pereira 2008-02-23 19:38:24 UTC
i am not sure it should not be a each directory setting.

the reason for this , is that i have folders that group by day is very handy ( i have files being added to that folder on a daily basis ) and i have folders that dont have new files for months.

this is basicly because i have an "archive" folder , where all the new files go. it can be sometimes very frustrating to browse this folder
Comment 5 Alexandre Pereira 2008-02-23 19:54:37 UTC
basicly , this would be my ideal setting :

if there are files from today in that folder , make a today group ( if not, dont show a today group )

if there are files from this week , make a this week group ( if not , dont show a this week group )

if there are files from this month , make a this month group

i am going to say something that may make you guys hate me , but , vista does this perfectly ( and also windows outlook sorting emails by date )
Comment 6 Peter Penz 2008-02-23 20:29:56 UTC
> i am going to say something that may make you guys hate me,
> but , vista does this perfectly

I don't have any problems with Microsoft, so nobody is gonna hate you ;-) I'm open for any good input from whatever system it comes.

@Rafael: the last suggestion really sounds a very good option for me. As we know the current date we can apply the group directly without scanning the whole content first. This would also prevent us for adding configuration options...
Comment 7 Rafael Fernández López 2008-02-24 00:17:46 UTC
We should be extremely careful at this point. For me, on the other hand, makes sense to make this per-folder (as the rest of view settings, that you can select to be applied to all and new folders).

About the solution Iori proposes, I am sceptical. That organization could result dinamited if for instance we have tons of files from months ago (we copied a DVD with tons of jpeg images, for instance), and we have 3 files from today for example.

The solution Iori proposes also, can have some implementation issues, but those could be resolved when getting hands to work anyway. My vote goes for making this configurable in the view settings dialog. Probably same for size categories. Your size categories are different in an image folders than in a ISOs folder, for example.
Comment 8 Peter Penz 2008-02-24 11:43:56 UTC
> About the solution Iori proposes, I am sceptical.

It works quite well in MS Outlook for organizing e-mails. For sure this does not mean that it must be the perfect solution ;-)

Rafael, I've the following suggestion: before we start to add any settings, I'd like to implement a patch for Iori's proposal. I'd send this patch to you and if you love it we are all happy, otherwise we discuss the settings option again. Would this be fine for you? I've added this bug to my TODO-list now...
Comment 9 Rafael Fernández López 2008-02-24 13:41:29 UTC
Yeah, of course. Go on, I guess we only need changes at dolphinmodel. Feel free to post the patch here if you want.
Comment 10 Peter Penz 2008-02-25 20:28:23 UTC
I've attached a patch and I'm quite pleased with the result :-) Rafael, I really hope you'll like it ;-)

The default grouping is - like until now - grouping by month. Only for the last month a finer granularity is chosen. 
- First items are grouped be weeks: Last Week/Two Weeks Ago/Three Weeks Ago/Earlier this Month
- Within the current week the grouping is done by days: Today/Yesterday/...name of day...

The namings are inspired from MS Outlook, where I use this feature quite often. I've attached a screenshot so that you get a quick impression.

Regarding the patch: I did some cosmetic cleanup of the code, as the method DolphinModel::data() was too long already -> I introduced to private methods displayRoleData(...) and sortRoleData(...), but did not change old code.

The interesting parts are the
  case KDirModel::ModifiedTime:
parts. As you can see the code is rather straight forward.

I personally would be quite happy if I could commit this patch. As said above this approach is used in MS Outlook too and whatever someone may think from MS: I think this works quite nice and (at least about that we can be sure) has been tested by a huge user base already.

Please let me know what you think :-) Thanks!
  
Comment 11 Peter Penz 2008-02-25 20:28:57 UTC
Created attachment 23708 [details]
Patch
Comment 12 Peter Penz 2008-02-25 20:29:33 UTC
Created attachment 23709 [details]
Sample screenshot after the patch
Comment 13 Alexandre Pereira 2008-02-25 23:37:52 UTC
great :) 

you guys rock ! really ! totally impressed :)
Comment 14 Rafael Fernández López 2008-02-26 00:03:31 UTC
@Iori: :)

@Peter: Yes, as I have seen apart from cosmetic changes, the changes are on KDirModel::ModifiedTime as you already said. I really agree with the patch. Please have in mind this is only committable on trunk, and thus, it will come with 4.1. It is not possible to be backported, since it introduces new strings for translation. So, please commit when you can, and thanks for having a look.
Comment 15 Peter Penz 2008-02-26 07:33:45 UTC
SVN commit 779438 by ppenz:

When a grouping per date is done, per default the granularity is one month. This patch increases the granularity for the last month:
- "Weeks" are used for the last 4 weeks excluding the current week.
- "Days" are used for the current week.

Additionally some cleanups of the code has been done, as the method DolphinModel::data() was too long already.

No backport will be done as new strings are introduced. The patch has been reviewed by Rafael Fernández López.

BUG: 158267

 M  +298 -251  dolphinmodel.cpp  
 M  +7 -3      dolphinmodel.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=779438