summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/ofilelistview.cpp
authorzecke <zecke>2002-10-28 21:47:58 (UTC)
committer zecke <zecke>2002-10-28 21:47:58 (UTC)
commit98d46aa752026d53b4cf4ea8572fdf7c89f4c6c0 (patch) (unidiff)
tree3e4a873011de405e5402d7eb53ae1c5c2867246a /libopie/ofileselector/ofilelistview.cpp
parentb963230163fc8069731374a19390fd0e5cb42532 (diff)
downloadopie-98d46aa752026d53b4cf4ea8572fdf7c89f4c6c0.zip
opie-98d46aa752026d53b4cf4ea8572fdf7c89f4c6c0.tar.gz
opie-98d46aa752026d53b4cf4ea8572fdf7c89f4c6c0.tar.bz2
Almost done with the new data flow
only OFileSelector needs to adapt it now... Besides that make it compile with the new api Add a configure and a libopie.pro to actually build ofileselector and a MANIFEST to explain some basics of the now a days a bit bigger interface
Diffstat (limited to 'libopie/ofileselector/ofilelistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/ofilelistview.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/libopie/ofileselector/ofilelistview.cpp b/libopie/ofileselector/ofilelistview.cpp
index 9cfdc48..fe8acf0 100644
--- a/libopie/ofileselector/ofilelistview.cpp
+++ b/libopie/ofileselector/ofilelistview.cpp
@@ -46,7 +46,7 @@ void OFileListView::clear() {
46void OFileListView::addFile( const QPixmap& pix, 46void OFileListView::addFile( const QPixmap& pix,
47 const QString&, 47 const QString&,
48 QFileInfo* info, 48 QFileInfo* info,
49 const QString& /*extra*/, 49 const QString& extra,
50 bool isSymlink ) { 50 bool isSymlink ) {
51 QString dir; 51 QString dir;
52 QString name; 52 QString name;
@@ -67,7 +67,7 @@ void OFileListView::addFile( const QPixmap& pix,
67 new OFileSelectorItem( this, pix, name, 67 new OFileSelectorItem( this, pix, name,
68 info->lastModified().toString(), 68 info->lastModified().toString(),
69 QString::number( info->size() ), 69 QString::number( info->size() ),
70 dir, locked ); 70 dir, locked, extra );
71} 71}
72void OFileListView::addFile( const QPixmap&, 72void OFileListView::addFile( const QPixmap&,
73 const QString& /*mime*/, const QString& /*dir*/, 73 const QString& /*mime*/, const QString& /*dir*/,
@@ -78,7 +78,7 @@ void OFileListView::addFile( const QPixmap&,
78} 78}
79void OFileListView::addDir( const QPixmap& pix, const QString&, 79void OFileListView::addDir( const QPixmap& pix, const QString&,
80 QFileInfo* info, 80 QFileInfo* info,
81 const QString& /*extra */, 81 const QString& extra ,
82 bool symlink ) { 82 bool symlink ) {
83 83
84 bool locked = false; 84 bool locked = false;
@@ -89,7 +89,7 @@ void OFileListView::addDir( const QPixmap& pix, const QString&,
89 new OFileSelectorItem( this, pix, name, 89 new OFileSelectorItem( this, pix, name,
90 info->lastModified().toString(), 90 info->lastModified().toString(),
91 QString::number( info->size() ), 91 QString::number( info->size() ),
92 info->dirPath( true ), locked, 92 info->dirPath( true ), locked, extra,
93 true ); 93 true );
94 94
95} 95}
@@ -127,6 +127,13 @@ QString OFileListView::selectedName()const{
127 127
128 return item->text( 1 ); 128 return item->text( 1 );
129} 129}
130QString OFileListView::selectedExtra()const{
131 QListViewItem* item = currentItem();
132 if (!item) return QString::null;
133 OFileSelectorItem* fit = (OFileSelectorItem*)fit;
134
135 return fit->extra();
136}
130QStringList OFileListView::selectedNames()const { 137QStringList OFileListView::selectedNames()const {
131 QStringList list; 138 QStringList list;
132 list << selectedName(); 139 list << selectedName();
@@ -137,7 +144,7 @@ QString OFileListView::selectedPath()const {
137} 144}
138QStringList OFileListView::selectedPaths()const { 145QStringList OFileListView::selectedPaths()const {
139 QStringList list; 146 QStringList list;
140b list << selectedPath(); 147 list << selectedPath();
141 return list; 148 return list;
142} 149}
143int OFileListView::fileCount() { 150int OFileListView::fileCount() {
@@ -161,10 +168,7 @@ void OFileListView::slotCurrentChanged( QListViewItem* item) {
161 168
162 if (selector()->mode() == OFileSelector::Fileselector ) { 169 if (selector()->mode() == OFileSelector::Fileselector ) {
163 QStringList str = QStringList::split("->", sel->text(1) ); 170 QStringList str = QStringList::split("->", sel->text(1) );
164 QString path =sel->directory() + "/" + str[0].stripWhiteSpace(); 171 fileSelected(sel->directory(), str[0].stripWhiteSpace(),sel->extra() );
165 DocLnk lnk( path );
166 fileSelected(lnk );
167 fileSelected( path );
168 } 172 }
169 } 173 }
170} 174}
@@ -181,16 +185,10 @@ void OFileListView::slotClicked( int button, QListViewItem* item,
181 if(!sel->isLocked() ){ 185 if(!sel->isLocked() ){
182 QStringList str = QStringList::split("->", sel->text(1) ); 186 QStringList str = QStringList::split("->", sel->text(1) );
183 if( sel->isDir() ){ 187 if( sel->isDir() ){
184 changedDir( sel->directory() + "/" + str[0].stripWhiteSpace() ); 188 changedDir( sel->directory(), str[0].stripWhiteSpace(),sel->extra() );
185 }else{ 189 }else{
186 updateLine( str[0].stripWhiteSpace() ); 190 updateLine( str[0].stripWhiteSpace() );
187 QString path = sel->directory(); 191 fileSelected( sel->directory(),str[0].stripWhiteSpace(), sel->extra() );
188 path += "/";
189 path += str[0].stripWhiteSpace();
190
191 DocLnk lnk( path );
192 fileSelected( path );
193 fileSelected( lnk );
194 } 192 }
195 } 193 }
196} 194}