summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/opixmapprovider.cpp
Side-by-side diff
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");
-}