author | zecke <zecke> | 2002-10-05 20:49:38 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-05 20:49:38 (UTC) |
commit | 19c0a4610292a95281a64655cef9c2d695a214dc (patch) (side-by-side diff) | |
tree | dde4afda2629a6e10d545d9492ada7b43e431ee7 /libopie/ofileselector/ofilelistview.cpp | |
parent | d7f9d00fcc9261db9c4af4f1b4afde9d50e8a2a2 (diff) | |
download | opie-19c0a4610292a95281a64655cef9c2d695a214dc.zip opie-19c0a4610292a95281a64655cef9c2d695a214dc.tar.gz opie-19c0a4610292a95281a64655cef9c2d695a214dc.tar.bz2 |
more steps to make ofileselector modular
We now got the API for a factory so switching should work in future
and we now got a OPixmapProvider which provides us with pixmaps....
So an ImageViewer could install a differen OPixmapProvider
and a different OFileView to make Previewing
work
Diffstat (limited to 'libopie/ofileselector/ofilelistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofilelistview.cpp | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/libopie/ofileselector/ofilelistview.cpp b/libopie/ofileselector/ofilelistview.cpp index bb15764..691bf42 100644 --- a/libopie/ofileselector/ofilelistview.cpp +++ b/libopie/ofileselector/ofilelistview.cpp @@ -43,18 +43,14 @@ OFileListView::~OFileListView() { void OFileListView::clear() { QListView::clear(); } -void OFileListView::addFile( const QString&, +void OFileListView::addFile( const QPixmap& pix, + const QString&, QFileInfo* info, bool isSymlink ) { - MimeType type( info->absFilePath() ); - QPixmap pix = type.pixmap(); QString dir; QString name; bool locked = false; - if( pix.isNull() ) - pix = Resource::loadPixmap( "UnknownDocument-14"); - dir = info->dirPath( true ); if( isSymlink ) @@ -64,7 +60,7 @@ void OFileListView::addFile( const QString&, if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ - locked = true; pix = Resource::loadPixmap("locked"); + locked = true; } } new OFileSelectorItem( this, pix, name, @@ -72,30 +68,16 @@ void OFileListView::addFile( const QString&, QString::number( info->size() ), dir, locked ); } -void OFileListView::addFile( const QString& /*mime*/, const QString& /*dir*/, +void OFileListView::addFile( const QPixmap&, + const QString& /*mime*/, const QString& /*dir*/, const QString& /*file*/, bool /*isSyml*/ ) { } -void OFileListView::addDir( const QString&, +void OFileListView::addDir( const QPixmap& pix, const QString&, QFileInfo* info, bool symlink ) { bool locked = false; QString name; - QPixmap pix; - - if( ( selector()->mode() == OFileSelector::Open && !info->isReadable() ) || - ( selector()->mode() == OFileSelector::Save && !info->isWritable() ) ){ - - locked = true; - - if( symlink ) - pix = selector()->pixmap("symlinkedlocked"); - else - pix = Resource::loadPixmap("lockedfolder"); - - }else { // readable - pix = symlink ? selector()->pixmap("dirsymlink") : Resource::loadPixmap("folder") ; - } name = symlink ? info->fileName() + "->" + info->dirPath(true) + "/" +info->readLink() : info->fileName() ; @@ -106,16 +88,19 @@ void OFileListView::addDir( const QString&, true ); } -void OFileListView::addDir( const QString& /*mime*/, const QString& /*dir*/, +void OFileListView::addDir( const QPixmap&, + const QString& /*mime*/, const QString& /*dir*/, const QString& /*file*/, bool ) { } -void OFileListView::addSymlink( const QString& /*mime*/, +void OFileListView::addSymlink( const QPixmap&, + const QString& /*mime*/, QFileInfo* /*info*/, bool /*isSym*/ ) { } -void OFileListView::addSymlink( const QString& /*mime*/, const QString& /*path*/, +void OFileListView::addSymlink(const QPixmap&, + const QString& /*m*/, const QString& /*path*/, const QString& /*file*/, bool /*isSym*/ ) { } |