summaryrefslogtreecommitdiffstats
path: root/kshowmail/filterlogviewdeleteditem.cpp
blob: 45e5bf42d7e6400f30aff2a79e0df4c7e6d8ae6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// C++ Implementation: filterlogviewdeleteditem
//
// Description:
//
//
// Author: Ulrich Weigelt <ulrich.weigelt@gmx.de>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "filterlogviewdeleteditem.h"

FilterLogViewDeletedItem::FilterLogViewDeletedItem( TDEListView* parent )
 : TDEListViewItem( parent )
{
}


FilterLogViewDeletedItem::~FilterLogViewDeletedItem()
{
}

void FilterLogViewDeletedItem::setValues( TQDateTime date, TQString sender, TQString account, TQString subject )
{
  //store values
  this->date = date;
  this->sender = sender;
  this->account = account;
  this->subject = subject;

  //set column text
  setText( ColDate, date.toString( TQt::LocalDate ) );
  setText( ColSender, sender );
  setText( ColAccount, account );
  setText( ColSubject, subject );
}

int FilterLogViewDeletedItem::compare( TQListViewItem * i, int col, bool ascending ) const
{
  if( col == ColDate )
  {
    if( this->date < ((FilterLogViewDeletedItem*)i)->getDate() ) return -1;
    if( this->date > ((FilterLogViewDeletedItem*)i)->getDate() ) return 1;
    else return 0;
  }
  else
    return key( col, ascending ).compare( i->key( col, ascending) );

}

TQDateTime FilterLogViewDeletedItem::getDate( )
{
  return date;
}