summaryrefslogtreecommitdiffstats
path: root/k9author/k9lvitemimport.cpp
blob: 38b18557930f5e97760cbb95f1a1015ad17a3f80 (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
//
// C++ Implementation: k9lvitemimport
//
// Description: 
//
//
// Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "k9lvitemimport.h"


k9LvItemImport::k9LvItemImport( TQListViewItem *tqparent,eObjectType _objectType)
            : TQListViewItem( tqparent) {
        m_objectType=_objectType;
        m_title=NULL;
        m_aviFile=NULL;
}

int k9LvItemImport::rtti () const { 
    switch(m_objectType) {
        case TITLE:
            return 1001;
        case CHAPTER:
            return 1002;
        default:
            return 1000;
    }
}

int k9LvItemImport::compare(TQListViewItem *i,int col,bool ascending) const {
 int res;
 if (i->rtti()== 1001) {
     k9LvItemImport *item2=(k9LvItemImport*)i;
     return   this->getTitle()->getNum()-item2->getTitle()->getNum();
 }
 if (i->rtti()== 1002) {
     k9LvItemImport *item2=(k9LvItemImport*)i;
     return  this->getAviFile()->getNum() - item2->getAviFile()->getNum()  ;
 }
  return TQListViewItem::compare(i,col,ascending);
}


void k9LvItemImport::setTitle(k9Title* _value) {
    m_title = _value;
    TQPixmap pix(m_title->getButton()->getImage());
    setPixmap(0,pix);
}

k9LvItemImport::~k9LvItemImport() {
}