Diffstat (limited to 'libopie/ofileselector/ofilelistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofilelistview.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/libopie/ofileselector/ofilelistview.cpp b/libopie/ofileselector/ofilelistview.cpp index 0c7d45b..7108a5b 100644 --- a/libopie/ofileselector/ofilelistview.cpp +++ b/libopie/ofileselector/ofilelistview.cpp | |||
@@ -1,7 +1,10 @@ | |||
1 | 1 | ||
2 | #include <qpe/mimetype.h> | ||
3 | #include <qpe/resource.h> | ||
4 | |||
2 | #include "ofileselector.h" | 5 | #include "ofileselector.h" |
3 | #include "ofileselectoritem.h" | 6 | #include "ofileselectoritem.h" |
4 | #include "ofilelistview.h" | 7 | #include "ofilelistview.h" |
5 | 8 | ||
6 | 9 | ||
7 | OFileListView::OFileListView( QWidget* parent, OFileSelector* sel) | 10 | OFileListView::OFileListView( QWidget* parent, OFileSelector* sel) |
@@ -12,13 +15,13 @@ OFileListView::OFileListView( QWidget* parent, OFileSelector* sel) | |||
12 | OFileListView::~OFileListView() { | 15 | OFileListView::~OFileListView() { |
13 | 16 | ||
14 | } | 17 | } |
15 | void OFileListView::clear() { | 18 | void OFileListView::clear() { |
16 | QListView::clear(); | 19 | QListView::clear(); |
17 | } | 20 | } |
18 | void OFileListView::addFile( const QString& mime, | 21 | void OFileListView::addFile( const QString&, |
19 | QFileInfo* info, | 22 | QFileInfo* info, |
20 | bool isSymlink ) { | 23 | bool isSymlink ) { |
21 | MimeType type( info->absFilePath() ); | 24 | MimeType type( info->absFilePath() ); |
22 | QPixmap pix = type.pixmap(); | 25 | QPixmap pix = type.pixmap(); |
23 | QString dir; | 26 | QString dir; |
24 | QString name; | 27 | QString name; |
@@ -30,14 +33,14 @@ void OFileListView::addFile( const QString& mime, | |||
30 | dir = info->dirPath( true ); | 33 | dir = info->dirPath( true ); |
31 | 34 | ||
32 | if( isSymlink ) | 35 | if( isSymlink ) |
33 | name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); | 36 | name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); |
34 | else { | 37 | else { |
35 | name = info->fileName(); | 38 | name = info->fileName(); |
36 | if( ( selector()->mode() == Open && !info->isReadable() )|| | 39 | if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || |
37 | ( selector()->mode() == Save && !info->isWritable() ) ){ | 40 | ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ |
38 | 41 | ||
39 | locked = true; pix = Resource::loadPixmap("locked"); | 42 | locked = true; pix = Resource::loadPixmap("locked"); |
40 | } | 43 | } |
41 | } | 44 | } |
42 | new OFileSelectorItem( this, pix, name, | 45 | new OFileSelectorItem( this, pix, name, |
43 | info->lastModified().toString(), | 46 | info->lastModified().toString(), |
@@ -45,21 +48,21 @@ void OFileListView::addFile( const QString& mime, | |||
45 | dir, locked ); | 48 | dir, locked ); |
46 | } | 49 | } |
47 | void OFileListView::addFile( const QString& /*mime*/, const QString& /*dir*/, | 50 | void OFileListView::addFile( const QString& /*mime*/, const QString& /*dir*/, |
48 | const QString& /*file*/, bool /*isSyml*/ ) { | 51 | const QString& /*file*/, bool /*isSyml*/ ) { |
49 | 52 | ||
50 | } | 53 | } |
51 | void OFileListView::addDir( const QString& mime, | 54 | void OFileListView::addDir( const QString&, |
52 | QFileInfo* info, bool isSym ) { | 55 | QFileInfo* info, bool symlink ) { |
53 | 56 | ||
54 | bool locked = false; | 57 | bool locked = false; |
55 | QString name; | 58 | QString name; |
56 | QPixmap pix; | 59 | QPixmap pix; |
57 | 60 | ||
58 | if( ( selector()->mode() == Open && !info->isReadable() ) || | 61 | if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || |
59 | ( selector()->mode() == Save && !info->isWritable() ) ){ | 62 | ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ |
60 | 63 | ||
61 | locked = true; | 64 | locked = true; |
62 | 65 | ||
63 | if( symlink ) | 66 | if( symlink ) |
64 | pix = selector()->pixmap("symlinkedlocked"); | 67 | pix = selector()->pixmap("symlinkedlocked"); |
65 | else | 68 | else |
@@ -75,23 +78,23 @@ void OFileListView::addDir( const QString& mime, | |||
75 | info->lastModified().toString(), | 78 | info->lastModified().toString(), |
76 | QString::number( info->size() ), | 79 | QString::number( info->size() ), |
77 | info->dirPath( true ), locked, | 80 | info->dirPath( true ), locked, |
78 | true ); | 81 | true ); |
79 | 82 | ||
80 | } | 83 | } |
81 | void OFileListView::addDir( const QString& mime, const QString& dir, | 84 | void OFileListView::addDir( const QString& /*mime*/, const QString& /*dir*/, |
82 | const QString& file, bool ) { | 85 | const QString& /*file*/, bool ) { |
83 | 86 | ||
84 | } | 87 | } |
85 | void OFileListView::addSymlink( const QString& mime, | 88 | void OFileListView::addSymlink( const QString& /*mime*/, |
86 | QFileInfo* info, | 89 | QFileInfo* /*info*/, |
87 | bool isSym ) { | 90 | bool /*isSym*/ ) { |
88 | 91 | ||
89 | } | 92 | } |
90 | void OFileListView::addSymlink( const QString& mime, const QString& path, | 93 | void OFileListView::addSymlink( const QString& /*mime*/, const QString& /*path*/, |
91 | const QString& file, bool isSym ) { | 94 | const QString& /*file*/, bool /*isSym*/ ) { |
92 | 95 | ||
93 | } | 96 | } |
94 | void OFileListView::cd( const QString& ) { | 97 | void OFileListView::cd( const QString& ) { |
95 | 98 | ||
96 | } | 99 | } |
97 | QWidget* OFileListView::widget() { | 100 | QWidget* OFileListView::widget() { |
@@ -102,17 +105,21 @@ QString OFileListView::selectedName()const{ | |||
102 | if (!item ) | 105 | if (!item ) |
103 | return QString::null; | 106 | return QString::null; |
104 | 107 | ||
105 | return item->text( 1 ); | 108 | return item->text( 1 ); |
106 | } | 109 | } |
107 | QStringList OFileListView::selectedNames()const { | 110 | QStringList OFileListView::selectedNames()const { |
108 | 111 | QStringList list; | |
112 | list << selectedName(); | ||
113 | return list; | ||
109 | } | 114 | } |
110 | QString OFileListView::selectedPath()const { | 115 | QString OFileListView::selectedPath()const { |
111 | 116 | return QString::null; | |
112 | } | 117 | } |
113 | QString OFileListView::selectedPaths()const { | 118 | QStringList OFileListView::selectedPaths()const { |
114 | 119 | QStringList list; | |
120 | list << selectedPath(); | ||
121 | return list; | ||
115 | } | 122 | } |
116 | int OFileListView::fileCount() { | 123 | int OFileListView::fileCount() { |
117 | return childCount(); | 124 | return childCount(); |
118 | } | 125 | } |