Bug 260333 - collection "edit filter" dialog should be "append" filter dialog.
Summary: collection "edit filter" dialog should be "append" filter dialog.
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collection Browser (show other bugs)
Version: 2.4-GIT
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2010-12-17 00:21 UTC by Alan Ezust
Modified: 2011-01-21 10:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Ezust 2010-12-17 00:21:09 UTC
Version:           2.3.1 (using KDE 4.4.3) 
OS:                Linux

I had a couple of questions about filtering in the library.

If I decide to filter on "rating" and I choose a "attribute value is between", and I 
choose a range of 1 to 7, and then check "invert", what I expect is for it to show me
unrated songs (0 stars) as well as tracks that are above 7. 

What happens is I click "OK" and nothing is entered into the filter at all.

So I go back there and do the same steps, only this time I also click on "append". 
Then it asks me for "appending condition". I'm not sure what to put here, so I say "AND".
For some reason I would expect to see something else I can append to this, but the only thing it lets me do is select and/or.
Then I click OK and I see this in the lineedit:

rating:<0 OR rating:>8 rating:<0 OR rating:>8

it should be rating<1 or rating> 7 so both boundaries are off-by-1.

Second, it duplicates the expression. 

So the bugs are:

1. The inverted expression is not correct (off-by-1 errors)
2. It only inserts something if I click APPEND
3. It duplicates the expression. 

Finally, if I edit the filter again, I would hope to see the same things selected in the comboboxes, etc. but not even the "rating" is selected in the combobox.



Reproducible: Always

Steps to Reproduce:
make an inverted filter of ratings of tracks where the range is between 1 and 7.
notice you don't get what you want.
Comment 1 Myriam Schweingruber 2010-12-17 09:38:37 UTC
Please upgrade to the latest stable, Amarok 2.3.2 or try 2,4 beta. The filter works correctly here (besides the numbering being wrong, but that is another bug)
Comment 2 Myriam Schweingruber 2010-12-17 09:46:28 UTC
Oops, I was completely wrong, it even is worse now in 2.4-git:

Choosing a rating between 1 (half a star) and 7 (3.5 stars) produces this result:

rating:>0.5 OR rating:<3.5

So it takes half the values and this is clearly a regression, the stars were always 1 star = 2 rating points
Comment 3 Sergey Ivanov 2010-12-17 11:37:24 UTC
"Semi-star" values seems not bug but feature (http://gitweb.kde.org/amarok.git/commit/c9966b25e259568de09688d32db7ee7ae6ef8795). Reporter's problem looks strange, need to look up more.
Comment 4 Sergey Ivanov 2010-12-17 12:16:35 UTC
Nope nothing wrong. Can't reproduce that. Probably you should really just try newer version.
Comment 5 Alan Ezust 2010-12-17 18:23:57 UTC
> Choosing a rating between 1 (half a star) and 7 (3.5 stars) produces this
> result:
> rating:>0.5 OR rating:<3.5

First, my report was about INVERTED expressions and yours
is not inverted. But just looking at what you pasted, it is not correct!
I would expect to see something like this:
rating: >= 0.5 AND rating =< 3.5
Although between is ambiguous, so I would also accept 
rating: > 0.5 AND rating < 3.5

What does between mean?  Does it mean inclusive or non-inclusive?
Because an "inverted between" should NOT include those values, that is for sure.
Does that mean a "between" *does* include those values? I don't know!
I hate that word.

What expression does it show when you invert it?
Comment 6 Alan Ezust 2010-12-17 18:49:14 UTC
PS: Ignore the other stuff I said about nothing being done unless I click "Append". 

I didn't realize that by clicking append, I see an expression immediately in the filter lineedit, that's cool! But clicking "ok" and not seeing anything at all is confusing. What is the difference between ok/cancel? 

The dialog title: "Edit Filter" is confusing. It is not editing my existing filter at all. It is just appending expressions to the existing filter field.

So the dialog title should be "create/append filter", and the instructions which currently say "edit the filter for finding tracks" should say "click append to see your expression appended to the filter lineedit" or something.
And then I would not expect to see my previous filter already populating the fields in the dialog form as I do now. 

Further, the "edit" button next to the filter field should perhaps be a "+" add filter button.
Comment 7 Alan Ezust 2010-12-17 20:37:46 UTC
And now that I've tried the latest git checkout, I see that the expressions are indeed translated correctly when you click "append"

So I guess the only issue left on this ticket is the confusion between what 
"edit filter" means, when it should be "append", and the ok/cancel that should be merged into a single  "close" button.
Comment 8 Myriam Schweingruber 2010-12-19 14:11:12 UTC
Please do not remove the keywords until this is fixed. Also the filtering is still wrong, as it doesn't filter by full points but by half only.
Comment 9 Ralf Engels 2010-12-20 23:51:51 UTC
I don't see writing 3 stars as "3" as a bug.

However I see a wish that the edit dialog would remember the last selected values.
Also I see the problem with the append button since I fell into the same trap a couple of times myself.
Comment 10 Sergey Ivanov 2011-01-09 10:24:12 UTC
Well, initial problem already fixed, current could be solved by http://git.reviewboard.kde.org/r/100250/, but It couldn't be accepted before 2.4 release because of string freeze (at least). And It's impossible to rename Edit filter button before 2.4 also. So I think, this bug can not be release_blocker.
Comment 11 Sergey Ivanov 2011-01-20 19:58:14 UTC
Git commit 944febeac820d90b4f47e70f2a51500b0eb4f45f by Sergey Ivanov
Pushed by ivanov into branch master

Filter Editor restyling. (RR: 100250)
BUG: 260333

M  +1    -0    ChangeLog     
M  +44   -40   src/core/meta/support/MetaConstants.cpp     
M  +257  -132  src/dialogs/EditFilterDialog.cpp     
M  +25   -11   src/dialogs/EditFilterDialog.h     
M  +162  -259  src/dialogs/EditFilterDialog.ui     
M  +22   -1    src/widgets/MetaQueryWidget.cpp     
M  +22   -15   src/widgets/MetaQueryWidget.h     
M  +3    -3    src/widgets/Token.cpp     
M  +4    -4    src/widgets/Token.h     
M  +3    -4    src/widgets/TokenDropTarget.cpp     
M  +2    -1    src/widgets/TokenPool.cpp     
M  +2    -2    src/widgets/TokenWithLayout.cpp     
M  +2    -2    src/widgets/TokenWithLayout.h     

http://commits.kde.org/amarok/944febeac820d90b4f47e70f2a51500b0eb4f45f