blob: 4ef8fe3a6a41cef17f05e4c708a003d2e36297b7 (
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
|
#include "ofileselectoritem.h"
OFileSelectorItem::OFileSelectorItem( QListView*view,
const QPixmap& pix,
const QString& path,
const QString& date,
const QString& size,
const QString& dir,
bool isLocked,
const QString& extra,
bool isDir )
: QListViewItem( view )
{
setPixmap( 0, pix );
setText( 1, path );
setText( 2, size );
setText( 3, date );
m_dir = isDir;
m_locked = isLocked;
m_dirStr = dir;
m_extra = extra;
}
OFileSelectorItem::~OFileSelectorItem() {
}
bool OFileSelectorItem::isLocked()const {
return m_locked;
}
QString OFileSelectorItem::directory()const {
return m_dirStr;
}
bool OFileSelectorItem::isDir()const {
return m_dir;
}
QString OFileSelectorItem::path() const {
return text(1);
}
QString OFileSelectorItem::key( int id, bool ) {
QString ke;
if( id == 0 || id == 1 ){ // name
if( m_dir ){
ke.append("0" );
ke.append( text(1) );
}else{
ke.append("1" );
ke.append( text(1) );
}
}else if( id == 2 ){ // size
return text(2);
}else if( id == 3 ){ // date
return text(3);
}
return ke;
}
QString OFileSelectorItem::extra()const {
return m_extra;
}
|