Diffstat (limited to 'libopie/ofileselector/ofilelistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofilelistview.cpp | 32 |
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 @@ -47,5 +47,5 @@ void OFileListView::addFile( const QPixmap& pix, const QString&, QFileInfo* info, - const QString& /*extra*/, + const QString& extra, bool isSymlink ) { QString dir; @@ -68,5 +68,5 @@ void OFileListView::addFile( const QPixmap& pix, info->lastModified().toString(), QString::number( info->size() ), - dir, locked ); + dir, locked, extra ); } void OFileListView::addFile( const QPixmap&, @@ -79,5 +79,5 @@ void OFileListView::addFile( const QPixmap&, void OFileListView::addDir( const QPixmap& pix, const QString&, QFileInfo* info, - const QString& /*extra */, + const QString& extra , bool symlink ) { @@ -90,5 +90,5 @@ void OFileListView::addDir( const QPixmap& pix, const QString&, info->lastModified().toString(), QString::number( info->size() ), - info->dirPath( true ), locked, + info->dirPath( true ), locked, extra, true ); @@ -128,4 +128,11 @@ QString OFileListView::selectedName()const{ return item->text( 1 ); } +QString OFileListView::selectedExtra()const{ + QListViewItem* item = currentItem(); + if (!item) return QString::null; + OFileSelectorItem* fit = (OFileSelectorItem*)fit; + + return fit->extra(); +} QStringList OFileListView::selectedNames()const { QStringList list; @@ -138,5 +145,5 @@ QString OFileListView::selectedPath()const { QStringList OFileListView::selectedPaths()const { QStringList list; -b list << selectedPath(); + list << selectedPath(); return list; } @@ -162,8 +169,5 @@ void OFileListView::slotCurrentChanged( QListViewItem* item) { if (selector()->mode() == OFileSelector::Fileselector ) { QStringList str = QStringList::split("->", sel->text(1) ); - QString path =sel->directory() + "/" + str[0].stripWhiteSpace(); - DocLnk lnk( path ); - fileSelected(lnk ); - fileSelected( path ); + fileSelected(sel->directory(), str[0].stripWhiteSpace(),sel->extra() ); } } @@ -182,14 +186,8 @@ void OFileListView::slotClicked( int button, QListViewItem* item, QStringList str = QStringList::split("->", sel->text(1) ); if( sel->isDir() ){ - changedDir( sel->directory() + "/" + str[0].stripWhiteSpace() ); + changedDir( sel->directory(), str[0].stripWhiteSpace(),sel->extra() ); }else{ updateLine( str[0].stripWhiteSpace() ); - QString path = sel->directory(); - path += "/"; - path += str[0].stripWhiteSpace(); - - DocLnk lnk( path ); - fileSelected( path ); - fileSelected( lnk ); + fileSelected( sel->directory(),str[0].stripWhiteSpace(), sel->extra() ); } } |