mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-14 22:51:13 +02:00
2020-05-22 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDListView::NumericSort' to the 'RDListView::SortType' enumeration. * Fixed a bug in rdlibrary(1) that caused cuts to be incorrectly sorted when scheduled 'By Specified Order'.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A color-selectable QListViewItem class for Rivendell
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -174,6 +174,8 @@ int RDListViewItem::compare(Q3ListViewItem *i,int col,bool ascending) const
|
||||
int length;
|
||||
QStringList fields;
|
||||
QStringList prev_fields;
|
||||
int this_num;
|
||||
int that_num;
|
||||
|
||||
if((hard_column=list_parent->hardSortColumn())<0) {
|
||||
switch(list_parent->columnSortType(col)) {
|
||||
@@ -207,6 +209,17 @@ int RDListViewItem::compare(Q3ListViewItem *i,int col,bool ascending) const
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case RDListView::NumericSort:
|
||||
this_num=text(col).toInt();
|
||||
that_num=i->text(col).toInt();
|
||||
if(this_num>that_num) {
|
||||
return 1;
|
||||
}
|
||||
if(this_num<that_num) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case RDListView::NormalSort:
|
||||
return Q3ListViewItem::compare(i,col,ascending);
|
||||
|
Reference in New Issue
Block a user