Diffstat (limited to 'libopie/ofileselector/ofilelistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofilelistview.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libopie/ofileselector/ofilelistview.cpp b/libopie/ofileselector/ofilelistview.cpp index 691bf42..9cfdc48 100644 --- a/libopie/ofileselector/ofilelistview.cpp +++ b/libopie/ofileselector/ofilelistview.cpp | |||
@@ -37,80 +37,90 @@ OFileListView::OFileListView( QWidget* parent, OFileSelector* sel) | |||
37 | connect(this, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )), | 37 | connect(this, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )), |
38 | this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) ); | 38 | this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) ); |
39 | } | 39 | } |
40 | OFileListView::~OFileListView() { | 40 | OFileListView::~OFileListView() { |
41 | 41 | ||
42 | } | 42 | } |
43 | void OFileListView::clear() { | 43 | void OFileListView::clear() { |
44 | QListView::clear(); | 44 | QListView::clear(); |
45 | } | 45 | } |
46 | void OFileListView::addFile( const QPixmap& pix, | 46 | void OFileListView::addFile( const QPixmap& pix, |
47 | const QString&, | 47 | const QString&, |
48 | QFileInfo* info, | 48 | QFileInfo* info, |
49 | const QString& /*extra*/, | ||
49 | bool isSymlink ) { | 50 | bool isSymlink ) { |
50 | QString dir; | 51 | QString dir; |
51 | QString name; | 52 | QString name; |
52 | bool locked = false; | 53 | bool locked = false; |
53 | 54 | ||
54 | dir = info->dirPath( true ); | 55 | dir = info->dirPath( true ); |
55 | 56 | ||
56 | if( isSymlink ) | 57 | if( isSymlink ) |
57 | name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); | 58 | name = info->fileName() + " -> " +info->dirPath() + "/" + info->readLink(); |
58 | else { | 59 | else { |
59 | name = info->fileName(); | 60 | name = info->fileName(); |
60 | if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || | 61 | if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || |
61 | ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ | 62 | ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ |
62 | 63 | ||
63 | locked = true; | 64 | locked = true; |
64 | } | 65 | } |
65 | } | 66 | } |
66 | new OFileSelectorItem( this, pix, name, | 67 | new OFileSelectorItem( this, pix, name, |
67 | info->lastModified().toString(), | 68 | info->lastModified().toString(), |
68 | QString::number( info->size() ), | 69 | QString::number( info->size() ), |
69 | dir, locked ); | 70 | dir, locked ); |
70 | } | 71 | } |
71 | void OFileListView::addFile( const QPixmap&, | 72 | void OFileListView::addFile( const QPixmap&, |
72 | const QString& /*mime*/, const QString& /*dir*/, | 73 | const QString& /*mime*/, const QString& /*dir*/, |
73 | const QString& /*file*/, bool /*isSyml*/ ) { | 74 | const QString& /*file*/, |
75 | const QString& /*extra*/, | ||
76 | bool /*isSyml*/ ) { | ||
74 | 77 | ||
75 | } | 78 | } |
76 | void OFileListView::addDir( const QPixmap& pix, const QString&, | 79 | void OFileListView::addDir( const QPixmap& pix, const QString&, |
77 | QFileInfo* info, bool symlink ) { | 80 | QFileInfo* info, |
81 | const QString& /*extra */, | ||
82 | bool symlink ) { | ||
78 | 83 | ||
79 | bool locked = false; | 84 | bool locked = false; |
80 | QString name; | 85 | QString name; |
81 | 86 | ||
82 | name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ; | 87 | name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ; |
83 | 88 | ||
84 | new OFileSelectorItem( this, pix, name, | 89 | new OFileSelectorItem( this, pix, name, |
85 | info->lastModified().toString(), | 90 | info->lastModified().toString(), |
86 | QString::number( info->size() ), | 91 | QString::number( info->size() ), |
87 | info->dirPath( true ), locked, | 92 | info->dirPath( true ), locked, |
88 | true ); | 93 | true ); |
89 | 94 | ||
90 | } | 95 | } |
91 | void OFileListView::addDir( const QPixmap&, | 96 | void OFileListView::addDir( const QPixmap&, |
92 | const QString& /*mime*/, const QString& /*dir*/, | 97 | const QString& /*mime*/, const QString& /*dir*/, |
93 | const QString& /*file*/, bool ) { | 98 | const QString& /*file*/, |
99 | const QString& /*extra*/, | ||
100 | bool ) { | ||
94 | 101 | ||
95 | } | 102 | } |
96 | void OFileListView::addSymlink( const QPixmap&, | 103 | void OFileListView::addSymlink( const QPixmap&, |
97 | const QString& /*mime*/, | 104 | const QString& /*mime*/, |
98 | QFileInfo* /*info*/, | 105 | QFileInfo* /*info*/, |
106 | const QString& /*extra*/, | ||
99 | bool /*isSym*/ ) { | 107 | bool /*isSym*/ ) { |
100 | 108 | ||
101 | } | 109 | } |
102 | void OFileListView::addSymlink(const QPixmap&, | 110 | void OFileListView::addSymlink(const QPixmap&, |
103 | const QString& /*m*/, const QString& /*path*/, | 111 | const QString& /*m*/, const QString& /*path*/, |
104 | const QString& /*file*/, bool /*isSym*/ ) { | 112 | const QString& /*file*/, |
113 | const QString& /*extra*/, | ||
114 | bool /*isSym*/ ) { | ||
105 | 115 | ||
106 | } | 116 | } |
107 | void OFileListView::cd( const QString& ) { | 117 | void OFileListView::cd( const QString& ) { |
108 | 118 | ||
109 | } | 119 | } |
110 | QWidget* OFileListView::widget() { | 120 | QWidget* OFileListView::widget() { |
111 | return this; | 121 | return this; |
112 | } | 122 | } |
113 | QString OFileListView::selectedName()const{ | 123 | QString OFileListView::selectedName()const{ |
114 | QListViewItem *item = currentItem(); | 124 | QListViewItem *item = currentItem(); |
115 | if (!item ) | 125 | if (!item ) |
116 | return QString::null; | 126 | return QString::null; |
@@ -118,25 +128,25 @@ QString OFileListView::selectedName()const{ | |||
118 | return item->text( 1 ); | 128 | return item->text( 1 ); |
119 | } | 129 | } |
120 | QStringList OFileListView::selectedNames()const { | 130 | QStringList OFileListView::selectedNames()const { |
121 | QStringList list; | 131 | QStringList list; |
122 | list << selectedName(); | 132 | list << selectedName(); |
123 | return list; | 133 | return list; |
124 | } | 134 | } |
125 | QString OFileListView::selectedPath()const { | 135 | QString OFileListView::selectedPath()const { |
126 | return QString::null; | 136 | return QString::null; |
127 | } | 137 | } |
128 | QStringList OFileListView::selectedPaths()const { | 138 | QStringList OFileListView::selectedPaths()const { |
129 | QStringList list; | 139 | QStringList list; |
130 | list << selectedPath(); | 140 | b list << selectedPath(); |
131 | return list; | 141 | return list; |
132 | } | 142 | } |
133 | int OFileListView::fileCount() { | 143 | int OFileListView::fileCount() { |
134 | return childCount(); | 144 | return childCount(); |
135 | } | 145 | } |
136 | void OFileListView::sort() { | 146 | void OFileListView::sort() { |
137 | QListView::sort(); | 147 | QListView::sort(); |
138 | } | 148 | } |
139 | void OFileListView::slotSelectionChanged() { | 149 | void OFileListView::slotSelectionChanged() { |
140 | 150 | ||
141 | } | 151 | } |
142 | void OFileListView::slotCurrentChanged( QListViewItem* item) { | 152 | void OFileListView::slotCurrentChanged( QListViewItem* item) { |