summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/opixmapprovider.cpp
authorzecke <zecke>2003-05-25 17:51:52 (UTC)
committer zecke <zecke>2003-05-25 17:51:52 (UTC)
commit7e1dce1560e45ef7fad91a8da2d0d96c1b166df9 (patch) (side-by-side diff)
treec896c8ab6129414fa80df712a3a5794fa933716f /libopie/ofileselector/opixmapprovider.cpp
parentf1773ad179cb68b8e7777f3d43667ed5ebf1968d (diff)
downloadopie-7e1dce1560e45ef7fad91a8da2d0d96c1b166df9.zip
opie-7e1dce1560e45ef7fad91a8da2d0d96c1b166df9.tar.gz
opie-7e1dce1560e45ef7fad91a8da2d0d96c1b166df9.tar.bz2
die here too
Diffstat (limited to 'libopie/ofileselector/opixmapprovider.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/opixmapprovider.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/libopie/ofileselector/opixmapprovider.cpp b/libopie/ofileselector/opixmapprovider.cpp
deleted file mode 100644
index b363e01..0000000
--- a/libopie/ofileselector/opixmapprovider.cpp
+++ b/dev/null
@@ -1,83 +0,0 @@
-#include <qfileinfo.h>
-
-#include <qpe/mimetype.h>
-#include <qpe/resource.h>
-
-#include "opixmapprovider.h"
-
-
-
-OPixmapProvider::OPixmapProvider( OFileSelector* sel )
- : m_sel( sel ){
-}
-OPixmapProvider::~OPixmapProvider() {
-}
-QPixmap OPixmapProvider::pixmap( int t, const QString& ,
- QFileInfo* info, bool isL ) {
- QPixmap pix;
- bool sy = t & Symlink ? true : false;
- switch (t ) {
- case File:
- pix = file( info, sy, isL );
- break;
- case Dir:
- pix = dir( info, sy, isL );
- break;
- case Symlink:
- pix = sym( info, isL );
- break;
- }
- return pix;
-
-}
-QPixmap OPixmapProvider::pixmap( int t, const QString& mime,
- const QString& dir, const QString& file,
- bool isL) {
- QFileInfo *inf = new QFileInfo( dir + "/" + file );
- QPixmap pix = pixmap( t, mime, inf, isL );
- delete inf;
- return pix;
-}
-OFileSelector* OPixmapProvider::selector() {
- return m_sel;
-}
-QPixmap OPixmapProvider::file( QFileInfo* inf, bool , bool ) {
- MimeType type( inf->absFilePath() );
- QPixmap pix = type.pixmap();
-
- if ( pix.isNull() )
- pix = Resource::loadPixmap( "UnknownDocument-14");
-
- if ( (selector()->mode() == OFileSelector::Open &&
- !inf->isReadable() ) ||
- (selector()->mode() == OFileSelector::Save &&
- !inf->isWritable() ) ) {
- pix = Resource::loadPixmap( "locked" );
- }
- return pix;
-
-}
-QPixmap OPixmapProvider::dir( QFileInfo* inf, bool sym, bool ) {
- QPixmap pix;
- /*
- * look at selector()->mode() and determine
- * if a dir is locked
- */
- if ( (selector()->mode() == OFileSelector::Open &&
- !inf->isReadable() ) ||
- (selector()->mode() == OFileSelector::Save &&
- !inf->isWritable() ) ) {
- if ( sym )
- pix = selector()->pixmap("symlinkedlocked");
- else
- pix = Resource::loadPixmap("lockedfolder");
- }else {
- pix = sym ? selector()->pixmap("lockedfolder") :
- Resource::loadPixmap("folder");
-
- }
- return pix;
-}
-QPixmap OPixmapProvider::sym( QFileInfo* , bool ) {
- return Resource::loadPixmap("opie/symlink");
-}