summaryrefslogtreecommitdiffstats
path: root/kshowmail/filterlogviewmoveditem.cpp
blob: a68a1ae663f35e87573919457a51878f524ba199 (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: filterlogviewmoveditem
//
// Description:
//
//
// Author: Ulrich Weigelt <ulrich.weigelt@gmx.de>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "filterlogviewmoveditem.h"

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


FilterLogViewMovedItem::~FilterLogViewMovedItem()
{
}

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

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

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

}

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