summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-12-03 22:29:56 +0100
committerGravatar waker <wakeroid@gmail.com>2010-12-03 22:29:56 +0100
commite8e2944e4b492b194b3c0f7dcfd5026c386fc30f (patch)
tree1732d19e749b72f10cb0dfbe0363979c20630464 /playlist.c
parentf45c578fb976909ec550032a0f4b77f5ba7efcf9 (diff)
fixed pl_sort bug; fixed inconsistency in ddblistview vs pl_sort; reset column sort indicators after Edit->Sort By
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/playlist.c b/playlist.c
index cf8d259a..c16df84b 100644
--- a/playlist.c
+++ b/playlist.c
@@ -2867,7 +2867,7 @@ static const char *pl_sort_format;
static int
pl_sort_compare_str (playItem_t *a, playItem_t *b) {
if (pl_sort_is_duration) {
- return pl_sort_ascending ? b->_duration * 100000 - a->_duration * 100000 : a->_duration * 100000 - b->_duration * 100000;
+ return !pl_sort_ascending ? b->_duration * 100000 - a->_duration * 100000 : a->_duration * 100000 - b->_duration * 100000;
}
else if (pl_sort_is_track) {
int t1;
@@ -2887,14 +2887,14 @@ pl_sort_compare_str (playItem_t *a, playItem_t *b) {
else {
t2 = t ? atoi (t) : -1;
}
- return pl_sort_ascending ? t2 - t1 : t1 - t2;
+ return !pl_sort_ascending ? t2 - t1 : t1 - t2;
}
else {
char tmp1[1024];
char tmp2[1024];
pl_format_title (a, -1, tmp1, sizeof (tmp1), pl_sort_id, pl_sort_format);
pl_format_title (b, -1, tmp2, sizeof (tmp2), pl_sort_id, pl_sort_format);
- return pl_sort_ascending ? strcmp (tmp2, tmp1) : strcmp (tmp1, tmp2);
+ return !pl_sort_ascending ? strcmp (tmp2, tmp1) : strcmp (tmp1, tmp2);
}
}