summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/ofileselectoritem.cpp
Unidiff
Diffstat (limited to 'libopie/ofileselector/ofileselectoritem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/ofileselectoritem.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/libopie/ofileselector/ofileselectoritem.cpp b/libopie/ofileselector/ofileselectoritem.cpp
new file mode 100644
index 0000000..1e745a1
--- a/dev/null
+++ b/libopie/ofileselector/ofileselectoritem.cpp
@@ -0,0 +1,53 @@
1#include "ofileselectoritem.h"
2
3OFileSelectorItem::OFileSelectorItem( QListView*view,
4 const QPixmap& pix,
5 const QString& path,
6 const QString& date,
7 const QString& size,
8 const QString& dir,
9 bool isLocked,
10 bool isDir )
11 : QListViewItem( view )
12{
13 setPixmap( 0, pix );
14 setText( 1, path );
15 setText( 2, size );
16 setText( 3, date );
17 m_dir = isDir;
18 m_locked = isLocked;
19 m_dirStr = dir;
20}
21OFileSelectorItem::~OFileSelectorItem() {
22}
23bool OFileSelectorItem::isLocked()const {
24 return m_locked;
25}
26QString OFileSelectorItem::directory()const {
27 return m_dirStr;
28}
29bool OFileSelectorItem::isDir()const {
30 return m_dir;
31}
32QString OFileSelectorItem::path() const {
33 return text(1);
34}
35QString OFileSelectorItem::key( int id, bool ) {
36 QString ke;
37
38 if( id == 0 || id == 1 ){ // name
39 if( m_dir ){
40 ke.append("0" );
41 ke.append( text(1) );
42 }else{
43 ke.append("1" );
44 ke.append( text(1) );
45 }
46 }else if( id == 2 ){ // size
47 return text(2);
48 }else if( id == 3 ){ // date
49 return text(3);
50 }
51
52 return ke;
53}