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) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofilelistview.cpp | 41 |
1 files changed, 13 insertions, 28 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 @@ -45,7 +45,6 @@ void OFileListView::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; @@ -54,5 +53,2 @@ void OFileListView::addFile( const QString&, - if( pix.isNull() ) - pix = Resource::loadPixmap( "UnknownDocument-14"); - dir = info->dirPath( true ); @@ -66,3 +62,3 @@ void OFileListView::addFile( const QString&, - locked = true; pix = Resource::loadPixmap("locked"); + locked = true; } @@ -74,3 +70,4 @@ void OFileListView::addFile( const QString&, } -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*/ ) { @@ -78,3 +75,3 @@ void OFileListView::addFile( const QString& /*mime*/, const QString& /*dir*/, } -void OFileListView::addDir( const QString&, +void OFileListView::addDir( const QPixmap& pix, const QString&, QFileInfo* info, bool symlink ) { @@ -83,17 +80,2 @@ void OFileListView::addDir( const QString&, 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") ; - } @@ -108,3 +90,4 @@ void OFileListView::addDir( const QString&, } -void OFileListView::addDir( const QString& /*mime*/, const QString& /*dir*/, +void OFileListView::addDir( const QPixmap&, + const QString& /*mime*/, const QString& /*dir*/, const QString& /*file*/, bool ) { @@ -112,3 +95,4 @@ void OFileListView::addDir( const QString& /*mime*/, const QString& /*dir*/, } -void OFileListView::addSymlink( const QString& /*mime*/, +void OFileListView::addSymlink( const QPixmap&, + const QString& /*mime*/, QFileInfo* /*info*/, @@ -117,4 +101,5 @@ void OFileListView::addSymlink( const QString& /*mime*/, } -void OFileListView::addSymlink( const QString& /*mime*/, const QString& /*path*/, - const QString& /*file*/, bool /*isSym*/ ) { +void OFileListView::addSymlink(const QPixmap&, + const QString& /*m*/, const QString& /*path*/, + const QString& /*file*/, bool /*isSym*/ ) { |