author | zecke <zecke> | 2002-09-15 17:52:30 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-15 17:52:30 (UTC) |
commit | 1c5780f34ec9b4dc004714488b46997fe1a0909b (patch) (unidiff) | |
tree | 524719fe92e4738dbcebf4bc792d6901cf215df9 /libopie/ofileselector/ofileselectoritem.cpp | |
parent | 8c161a2699a842e527ade4410189fd18964d1c31 (diff) | |
download | opie-1c5780f34ec9b4dc004714488b46997fe1a0909b.zip opie-1c5780f34ec9b4dc004714488b46997fe1a0909b.tar.gz opie-1c5780f34ec9b4dc004714488b46997fe1a0909b.tar.bz2 |
Ok the demand for filters, listers and views were great so I'm currently
implementing it
This OFileSelector will be in a different subdir but it'll be still
linked into libopie. This makes it more easy to find all files which
belong to the OFileSelector
an OLister is able to list
for example files and dirs ( OLocalLister )
a ftp lister
a bluetooth lister whcich would show available devices
a DocLnkSet lister for the Documents Tab
a CrossReference lister
a View is responsible for showing files to the user...
and I renamed *.cc to *.cpp
Diffstat (limited to 'libopie/ofileselector/ofileselectoritem.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofileselectoritem.cpp | 53 |
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 | |||
3 | OFileSelectorItem::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 | } | ||
21 | OFileSelectorItem::~OFileSelectorItem() { | ||
22 | } | ||
23 | bool OFileSelectorItem::isLocked()const { | ||
24 | return m_locked; | ||
25 | } | ||
26 | QString OFileSelectorItem::directory()const { | ||
27 | return m_dirStr; | ||
28 | } | ||
29 | bool OFileSelectorItem::isDir()const { | ||
30 | return m_dir; | ||
31 | } | ||
32 | QString OFileSelectorItem::path() const { | ||
33 | return text(1); | ||
34 | } | ||
35 | QString 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 | } | ||