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) (side-by-side diff)
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
@@ -43,13 +43,13 @@ OFileListView::~OFileListView() {
void OFileListView::clear() {
QListView::clear();
}
void OFileListView::addFile( const QPixmap& pix,
const QString&,
QFileInfo* info,
- const QString& /*extra*/,
+ const QString& extra,
bool isSymlink ) {
QString dir;
QString name;
bool locked = false;
dir = info->dirPath( true );
@@ -64,35 +64,35 @@ void OFileListView::addFile( const QPixmap& pix,
locked = true;
}
}
new OFileSelectorItem( this, pix, name,
info->lastModified().toString(),
QString::number( info->size() ),
- dir, locked );
+ dir, locked, extra );
}
void OFileListView::addFile( const QPixmap&,
const QString& /*mime*/, const QString& /*dir*/,
const QString& /*file*/,
const QString& /*extra*/,
bool /*isSyml*/ ) {
}
void OFileListView::addDir( const QPixmap& pix, const QString&,
QFileInfo* info,
- const QString& /*extra */,
+ const QString& extra ,
bool symlink ) {
bool locked = false;
QString name;
name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ;
new OFileSelectorItem( this, pix, name,
info->lastModified().toString(),
QString::number( info->size() ),
- info->dirPath( true ), locked,
+ info->dirPath( true ), locked, extra,
true );
}
void OFileListView::addDir( const QPixmap&,
const QString& /*mime*/, const QString& /*dir*/,
const QString& /*file*/,
@@ -124,23 +124,30 @@ QString OFileListView::selectedName()const{
QListViewItem *item = currentItem();
if (!item )
return QString::null;
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;
list << selectedName();
return list;
}
QString OFileListView::selectedPath()const {
return QString::null;
}
QStringList OFileListView::selectedPaths()const {
QStringList list;
-b list << selectedPath();
+ list << selectedPath();
return list;
}
int OFileListView::fileCount() {
return childCount();
}
void OFileListView::sort() {
@@ -158,16 +165,13 @@ void OFileListView::slotCurrentChanged( QListViewItem* item) {
qWarning("current changed");
if(!sel->isDir() ){
updateLine( sel->text(1) );
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() );
}
}
}
void OFileListView::slotClicked( int button, QListViewItem* item,
const QPoint&, int ) {
if ( !item )
@@ -178,22 +182,16 @@ void OFileListView::slotClicked( int button, QListViewItem* item,
OFileSelectorItem *sel = (OFileSelectorItem*)item;
if(!sel->isLocked() ){
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() );
}
}
}
void OFileListView::slotRightButton( int button, QListViewItem* item,
const QPoint&, int ) {
if (!item || (button != Qt::RightButton ))