Review Request: Add an absolute date filter

Daniel Faust hessijames at gmail.com
Mon Jan 16 16:21:19 UTC 2012



> On Jan. 15, 2012, 10:56 p.m., Ralf Engels wrote:
> > Sorry, not working for me.
> > that works:
> > geändert:>04.01.2012
> > geändert:<04.01.2010
> > It does show only a subset of the whole collection.
> > 
> > that doesn't work:
> > geändert:04.01.2012
> > It always seem to show the whole collection.
> > 
> > Also I think the localization problem has not been covered.
> > Does an English date (e.g. 01/04/2012) work? The regular expression seems to be static.

I noticed queries like geändert:04.01.2012 aren't working in the current git version either (probably it never worked at all).
I added an:
qm->endAndOr();
qm->beginAnd();

right before the two:
qm->addNumberFilter(...);

I copied it from the file size filter above and now it works.

Even though I expected something like:
qm->beginAnd();
qm->addNumberFilter(...);
qm->addNumberFilter(...);
qm->endAndOr();


And localization is covered, it depends on your KDE settings for the short date format. This is also the format used by the EditFilterDialog, the two regex are only fallbacks.


- Daniel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103546/#review9847
-----------------------------------------------------------


On Jan. 16, 2012, 4:21 p.m., Daniel Faust wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103546/
> -----------------------------------------------------------
> 
> (Updated Jan. 16, 2012, 4:21 p.m.)
> 
> 
> Review request for Amarok.
> 
> 
> Description
> -------
> 
> This patch adds a collection filter (including gui) to filter using an absolute date (e.g. 26.11.2011). It's an addition to the current time difference mode (e.g. 1 month ago).
> Currently filtering the collection by date is a bit confusing and even though there is a gui (in the EditFilterDialog) to select a certain date it gets instantly converted to a time difference. This patch make a clear difference between these two modes (absolute and relative time specification).
> 
> The date can be formatted in tree ways, default is the local short format (KLocale::ShortFormat) following regex are also possible:
> (\d{1,2})[-.](\d{1,2})
> (\d{1,2})[-.](\d{1,2})[-.](\d{4})
> 
> The way time differences are handled gets unified though that leads to some code duplication that should also be dealt with.
> A new filter condition 'NewerThan' (opposide of 'OlderThan') gets added.
> 
> I hope that I didn't forget anything important.
> 
> 
> Diffs
> -----
> 
>   src/core-impl/collections/support/TextualQueryFilter.h 31860a3 
>   src/core-impl/collections/support/TextualQueryFilter.cpp 2374dbd 
>   src/dialogs/EditFilterDialog.cpp 58c2956 
>   src/widgets/MetaQueryWidget.h 3974fb7 
>   src/widgets/MetaQueryWidget.cpp 57b622f 
>   src/widgets/TokenPool.cpp 2889442 
> 
> Diff: http://git.reviewboard.kde.org/r/103546/diff/diff
> 
> 
> Testing
> -------
> 
> I tested filtering the collection and editing the filters with the EditFilterDialog.
> 
> 
> Thanks,
> 
> Daniel Faust
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20120116/0c4b4b1f/attachment.html>


More information about the Amarok-devel mailing list