mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-07 01:13:50 +02:00
2022-06-23 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDListView::DateTimeSort' to the 'RDListView::SortType enumeration. * Fixed a bug in rdcastmanager(1) that caused incorrect ordering when sorting by the 'Start' and 'Expiration' columns in the 'Podcast Item List' dialog. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
613dcc2b46
commit
72fce600bf
@ -20883,3 +20883,9 @@
|
||||
2022-06-23 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Changed the default '--process-interval=' value from 60 seconds
|
||||
to 30 seconds in rdrssd(8).
|
||||
2022-06-23 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'RDListView::DateTimeSort' to the 'RDListView::SortType
|
||||
enumeration.
|
||||
* Fixed a bug in rdcastmanager(1) that caused incorrect ordering
|
||||
when sorting by the 'Start' and 'Expiration' columns in the
|
||||
'Podcast Item List' dialog.
|
||||
|
@ -31,7 +31,8 @@ class RDListView : public Q3ListView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum SortType {NormalSort=0,TimeSort=1,LineSort=2,GpioSort=3,NumericSort=4};
|
||||
enum SortType {NormalSort=0,TimeSort=1,LineSort=2,GpioSort=3,NumericSort=4,
|
||||
DateTimeSort=5};
|
||||
RDListView(QWidget *parent);
|
||||
int hardSortColumn() const;
|
||||
void setHardSortColumn(int col);
|
||||
|
@ -176,6 +176,8 @@ int RDListViewItem::compare(Q3ListViewItem *i,int col,bool ascending) const
|
||||
QStringList prev_fields;
|
||||
int this_num;
|
||||
int that_num;
|
||||
QDateTime this_dt;
|
||||
QDateTime that_dt;
|
||||
|
||||
if((hard_column=list_parent->hardSortColumn())<0) {
|
||||
switch(list_parent->columnSortType(col)) {
|
||||
@ -220,7 +222,29 @@ int RDListViewItem::compare(Q3ListViewItem *i,int col,bool ascending) const
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
case RDListView::DateTimeSort:
|
||||
this_dt=QDateTime::fromString(text(col),"MM/dd/yyyy hh:mm:ss");
|
||||
that_dt=QDateTime::fromString(i->text(col),"MM/dd/yyyy hh:mm:ss");
|
||||
if(this_dt.isValid()) {
|
||||
if(that_dt.isValid()) {
|
||||
if(this_dt>that_dt) {
|
||||
return 1;
|
||||
}
|
||||
if(this_dt<that_dt) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case RDListView::NormalSort:
|
||||
return Q3ListViewItem::compare(i,col,ascending);
|
||||
}
|
||||
|
@ -133,8 +133,10 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent)
|
||||
|
||||
list_casts_view->addColumn(tr("Start"));
|
||||
list_casts_view->setColumnAlignment(3,Qt::AlignLeft);
|
||||
list_casts_view->setColumnSortType(3,RDListView::DateTimeSort);
|
||||
list_casts_view->addColumn(tr("Expiration"));
|
||||
list_casts_view->setColumnAlignment(4,Qt::AlignCenter);
|
||||
list_casts_view->setColumnSortType(4,RDListView::DateTimeSort);
|
||||
list_casts_view->addColumn(tr("Length"));
|
||||
list_casts_view->setColumnAlignment(5,Qt::AlignRight);
|
||||
list_casts_view->addColumn(tr("Feed"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user