author | zecke <zecke> | 2004-03-22 23:32:41 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-22 23:32:41 (UTC) |
commit | 428b687982966dc2efabaf6dbcc55ad0ea30aa10 (patch) (side-by-side diff) | |
tree | 86da20abd2e4b97a59dc32e17996bde5ee74cc91 /noncore/graphics/opie-eye/impl/dir/dir_lister.cpp | |
parent | 7ce623c6351646ce738a81e103632d73c5454ecc (diff) | |
download | opie-428b687982966dc2efabaf6dbcc55ad0ea30aa10.zip opie-428b687982966dc2efabaf6dbcc55ad0ea30aa10.tar.gz opie-428b687982966dc2efabaf6dbcc55ad0ea30aa10.tar.bz2 |
Initial Check in of the Eye Of Zilla. This ImageViewer features
Image Infos, EXIF, Jpeg,Png,Gif support. It supports scaled loading
of Jpegs. an smart image cache....
GUI needs some work and we need to find a bug in QCOP as well.
TODO:
Add Image Service for example Mailer
Add ImageCanvas/Zoomer/Display
Diffstat (limited to 'noncore/graphics/opie-eye/impl/dir/dir_lister.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/impl/dir/dir_lister.cpp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp new file mode 100644 index 0000000..ffea29e --- a/dev/null +++ b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp @@ -0,0 +1,94 @@ +/* + * GPLv2 zecke@handhelds.org + */ + +#include "dir_lister.h" + +#include <lib/slavemaster.h> + + +#include <qpe/config.h> +#include <qpe/qpeapplication.h> + +#include <qdir.h> +#include <qfileinfo.h> + + +Dir_DirLister::Dir_DirLister( bool list ) + : PDirLister( "dir_dir_lister" ) +{ + m_allFiles = list; + qWarning("All Files %d", m_allFiles ); + + SlaveMaster* master = SlaveMaster::self(); + connect( master, SIGNAL(sig_start()), this, SIGNAL(sig_start()) ); + connect( master, SIGNAL(sig_end()), this, SIGNAL(sig_end()) ); + connect( master, SIGNAL(sig_thumbInfo(const QString&, const QString&)), + this, SIGNAL(sig_thumbInfo(const QString&, const QString&)) ); + connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)), + this, SIGNAL(sig_fullInfo(const QString&, const QString&)) ); + connect( master, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)), + this, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)) ); + +} + +QString Dir_DirLister::defaultPath()const { + return QPEApplication::documentDir(); +} + +QString Dir_DirLister::setStartPath( const QString& path ) { + m_currentDir.cd( path ); + if (!m_currentDir.exists() ) + m_currentDir.cd(defaultPath()); + + + return m_currentDir.absPath(); +} + +QString Dir_DirLister::currentPath()const { + return m_currentDir.absPath(); +} + + +QStringList Dir_DirLister::folders()const { + return m_currentDir.entryList( QDir::Dirs ); +} + +QStringList Dir_DirLister::files()const { + if ( m_allFiles ) + return m_currentDir.entryList( QDir::Files ); + else { + QStringList out; + QStringList list = m_currentDir.entryList( QDir::Files | QDir::Readable ); + for (QStringList::Iterator it = list.begin(); it != list.end();++it ) { + QFileInfo inf( *it ); + QString ext = inf.extension(false).lower(); + if( ext == QString::fromLatin1("jpg") || + ext == QString::fromLatin1("jpeg" ) || + ext == QString::fromLatin1("png" ) || + ext == QString::fromLatin1("gif" ) ) + out.append( *it ); + } + return out; + } +} + +void Dir_DirLister::deleteImage( const QString& fl) { + QFile::remove( fl ); +} + +void Dir_DirLister::thumbNail( const QString& str, int w, int h) { + SlaveMaster::self()->thumbNail( str, w, h ); +} + +QImage Dir_DirLister::image( const QString& str, Factor f, int m) { + return SlaveMaster::self()->image( str, f, m ); +} + +void Dir_DirLister::imageInfo( const QString& str) { + SlaveMaster::self()->thumbInfo( str ); +} + +void Dir_DirLister::fullImageInfo( const QString& str) { + SlaveMaster::self()->imageInfo( str ); +} |