summaryrefslogtreecommitdiff
authorzecke <zecke>2004-08-27 22:22:44 (UTC)
committer zecke <zecke>2004-08-27 22:22:44 (UTC)
commit7d1ca5dba4cab829d9f7a8c79fb772dc3b643eac (patch) (side-by-side diff)
tree1d189e90585190465233a67c7c9a2a740cb1d98a
parenta6e7ebcee38719a9f33ede08ed4c8a364c2ecb20 (diff)
downloadopie-7d1ca5dba4cab829d9f7a8c79fb772dc3b643eac.zip
opie-7d1ca5dba4cab829d9f7a8c79fb772dc3b643eac.tar.gz
opie-7d1ca5dba4cab829d9f7a8c79fb772dc3b643eac.tar.bz2
-Removal of debug messages
-Cleanups of .pro files -Cleanups of source code And finally the long awaited DigiCam (dcim) Backend
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/.cvsignore2
-rw-r--r--noncore/graphics/opie-eye/gui/gui.pro15
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp23
-rw-r--r--noncore/graphics/opie-eye/iface/dirlister.cpp13
-rw-r--r--noncore/graphics/opie-eye/iface/dirlister.h6
-rw-r--r--noncore/graphics/opie-eye/iface/iface.pro7
-rw-r--r--noncore/graphics/opie-eye/iface/ifaceinfo.h2
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim.pro10
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim_dirview.cpp28
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim_dirview.h26
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.cpp22
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.h22
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim_lister.cpp181
-rw-r--r--noncore/graphics/opie-eye/impl/dcim/dcim_lister.h71
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir.pro10
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp5
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_lister.cpp12
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc.pro7
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_ifaceinfo.cpp4
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_lister.cpp17
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_lister.h1
-rw-r--r--noncore/graphics/opie-eye/lib/slavemaster.cpp26
-rw-r--r--noncore/graphics/opie-eye/lib/slavemaster.h10
-rw-r--r--noncore/graphics/opie-eye/phunk_view.pro37
-rw-r--r--noncore/graphics/opie-eye/slave/.cvsignore2
25 files changed, 487 insertions, 72 deletions
diff --git a/noncore/graphics/opie-eye/.cvsignore b/noncore/graphics/opie-eye/.cvsignore
new file mode 100644
index 0000000..52494fb
--- a/dev/null
+++ b/noncore/graphics/opie-eye/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+*.moc
diff --git a/noncore/graphics/opie-eye/gui/gui.pro b/noncore/graphics/opie-eye/gui/gui.pro
new file mode 100644
index 0000000..b9f0bf8
--- a/dev/null
+++ b/noncore/graphics/opie-eye/gui/gui.pro
@@ -0,0 +1,15 @@
+HEADERS += gui/filesystem.h \
+ gui/iconview.h \
+ gui/imageinfoui.h \
+ gui/imageview.h \
+ gui/mainwindow.h \
+ gui/viewmodebutton.h
+
+SOURCES += gui/filesystem.cpp \
+ gui/iconview.cpp \
+ gui/imageinfoui.cpp \
+ gui/imageview.cpp \
+ gui/mainwindow.cpp \
+ gui/viewmodebutton.cpp
+
+
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 652acc9..7196aba 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -41,7 +41,6 @@ using Opie::Core::OKeyConfigItem;
namespace {
static QPixmap* _dirPix = 0;
static QPixmap* _unkPix = 0;
- static QPixmap* _picPix = 0;
static QPixmap* _emptyPix = 0;
class IconViewItem : public QIconViewItem {
public:
@@ -98,12 +97,12 @@ namespace {
_unkPix = new QPixmap( Resource::loadPixmap( "UnknownDocument" ) );
}
- inline void IconViewItem::setPixmap( const QPixmap & icon, bool recalc, bool redraw)
+ inline void IconViewItem::setPixmap( const QPixmap & , bool, bool )
{
m_Pixset = true;
calcRect(text());
}
- inline void IconViewItem::setPixmap( const QPixmap & icon)
+ inline void IconViewItem::setPixmap( const QPixmap & )
{
m_Pixset = true;
calcRect(text());
@@ -253,10 +252,7 @@ void PIconView::initKeys() {
*/
void PIconView::slotDirUp()
{
- if (m_path.isEmpty()) return;
- QDir dir( m_path );
- dir.cdUp();
- slotChangeDir( dir.absPath() );
+ slotChangeDir( currentView()->dirLister()->dirUp( m_path ) );
}
/*
@@ -379,11 +375,17 @@ void PIconView::slotViewChanged( int i) {
if (cur) delete cur;
QString str = m_views->text(i);
ViewMap* map = viewMap();
- if (!map) {setCurrentView(0l); return;}
+ if (!map) {
+ setCurrentView(0l);
+ return;
+ }
+
if (map->find(str) == map->end()) {
owarn << "Key not found" << oendl;
- setCurrentView(0l); return;
+ setCurrentView(0l);
+ return;
}
+
m_cfg->writeEntry("LastView",str);
m_cfg->write();
cur = (*(*map)[str])(*m_cfg);
@@ -401,7 +403,8 @@ void PIconView::slotViewChanged( int i) {
this, SLOT(slotEnd()) );
- /* reload now */
+ /* reload now with default Path*/
+ m_path = lis->defaultPath();
QTimer::singleShot( 0, this, SLOT(slotReloadDir()));
}
diff --git a/noncore/graphics/opie-eye/iface/dirlister.cpp b/noncore/graphics/opie-eye/iface/dirlister.cpp
index 7cf4361..e0ae63b 100644
--- a/noncore/graphics/opie-eye/iface/dirlister.cpp
+++ b/noncore/graphics/opie-eye/iface/dirlister.cpp
@@ -1,5 +1,6 @@
#include "dirlister.h"
+#include <qdir.h>
PDirLister::PDirLister( const char* name )
: QObject( 0, name )
@@ -7,3 +8,15 @@ PDirLister::PDirLister( const char* name )
PDirLister::~PDirLister()
{}
+
+/**
+ * Change dir one level up. The default implementation
+ * is to use QDir to change the dir.
+ * If you've a flat filesystem return \par path immediately.
+ */
+QString PDirLister::dirUp( const QString& path )const {
+ QDir dir( path );
+ dir.cdUp();
+
+ return dir.absPath();
+}
diff --git a/noncore/graphics/opie-eye/iface/dirlister.h b/noncore/graphics/opie-eye/iface/dirlister.h
index 9c7b2a9..68e8495 100644
--- a/noncore/graphics/opie-eye/iface/dirlister.h
+++ b/noncore/graphics/opie-eye/iface/dirlister.h
@@ -23,13 +23,17 @@ public:
virtual QString currentPath()const = 0;
virtual QStringList folders()const = 0;
virtual QStringList files()const = 0;
+ virtual QString nameToFname(const QString&name)const = 0;
+ virtual QString dirUp(const QString&)const ;
+
+
public slots:
virtual void deleteImage( const QString& ) = 0;
virtual void imageInfo( const QString&) = 0;
virtual void fullImageInfo( const QString& ) = 0;
virtual void thumbNail( const QString&, int max_wid, int max_h ) = 0;
virtual QImage image( const QString&, Factor, int max = 0) = 0;
- virtual QString nameToFname(const QString&name)const = 0;
+
signals:
void sig_dirchanged();
diff --git a/noncore/graphics/opie-eye/iface/iface.pro b/noncore/graphics/opie-eye/iface/iface.pro
new file mode 100644
index 0000000..2ec499a
--- a/dev/null
+++ b/noncore/graphics/opie-eye/iface/iface.pro
@@ -0,0 +1,7 @@
+HEADERS += iface/dirlister.h \
+ iface/dirview.h \
+ iface/ifaceinfo.h \
+ iface/slaveiface.h
+
+SOURCES += iface/dirlister.cpp \
+ iface/dirview.cpp
diff --git a/noncore/graphics/opie-eye/iface/ifaceinfo.h b/noncore/graphics/opie-eye/iface/ifaceinfo.h
index 74e0db6..3af2fce 100644
--- a/noncore/graphics/opie-eye/iface/ifaceinfo.h
+++ b/noncore/graphics/opie-eye/iface/ifaceinfo.h
@@ -10,7 +10,7 @@
class QWidget;
class Config;
-struct PInterfaceInfo {
+struct PInterfaceInfo {
virtual QString name()const = 0;
virtual QWidget* configWidget( const Config& ) = 0;
virtual void writeConfig( QWidget* wid, Config& ) = 0;
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim.pro b/noncore/graphics/opie-eye/impl/dcim/dcim.pro
new file mode 100644
index 0000000..a8e8f05
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim.pro
@@ -0,0 +1,10 @@
+HEADERS += impl/dcim/dcim_dirview.h \
+ impl/dcim/dcim_ifaceinfo.h \
+ impl/dcim/dcim_lister.h
+
+
+
+SOURCES += impl/dcim/dcim_dirview.cpp \
+ impl/dcim/dcim_ifaceinfo.cpp \
+ impl/dcim/dcim_lister.cpp
+
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim_dirview.cpp b/noncore/graphics/opie-eye/impl/dcim/dcim_dirview.cpp
new file mode 100644
index 0000000..e55c27a
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim_dirview.cpp
@@ -0,0 +1,28 @@
+#include "dcim_dirview.h"
+
+#include "dcim_lister.h"
+#include "dcim_ifaceinfo.h"
+
+PHUNK_VIEW_INTERFACE( "Digital Camera", DCIM_DirView );
+
+DCIM_DirView::DCIM_DirView( const Config& cfg )
+ : PDirView( cfg ), m_lister( 0l ), m_info( 0l )
+{}
+
+DCIM_DirView::~DCIM_DirView()
+{}
+
+PInterfaceInfo* DCIM_DirView::interfaceInfo()const {
+ if ( !m_info )
+ m_info = new DCIM_InterfaceInfo;
+
+ return m_info;
+}
+
+
+PDirLister* DCIM_DirView::dirLister()const {
+ if ( !m_lister )
+ m_lister = new DCIM_DirLister();
+
+ return m_lister;
+}
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim_dirview.h b/noncore/graphics/opie-eye/impl/dcim/dcim_dirview.h
new file mode 100644
index 0000000..7fc38ec
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim_dirview.h
@@ -0,0 +1,26 @@
+/*
+ * GPLv2 only zecke@handhelds.org
+ */
+
+#ifndef DCIM_DIR_VIEW_H
+#define DCIM_DIR_VIEW_H
+
+#include <iface/dirview.h>
+
+/*
+ * Implementation for USB Host Digital Cameras
+ * like my Casio QV 500 and boring Yakumo
+ */
+struct DCIM_DirView : public PDirView {
+ DCIM_DirView( const Config& );
+ ~DCIM_DirView();
+
+ PInterfaceInfo* interfaceInfo()const;
+ PDirLister * dirLister ()const;
+
+private:
+ mutable PDirLister *m_lister;
+ mutable PInterfaceInfo *m_info ;
+};
+
+#endif
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.cpp
new file mode 100644
index 0000000..ca94dc5
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.cpp
@@ -0,0 +1,22 @@
+/*
+ * GPLv2
+ * zecke@handhelds.org
+ */
+
+
+#include "dcim_ifaceinfo.h"
+
+#include <qobject.h>
+
+DCIM_InterfaceInfo::DCIM_InterfaceInfo() {}
+DCIM_InterfaceInfo::~DCIM_InterfaceInfo() {}
+
+QString DCIM_InterfaceInfo::name()const {
+ return QObject::tr( "Digital Camera View" );
+}
+
+QWidget* DCIM_InterfaceInfo::configWidget( const Config& ) {
+ return 0l;
+}
+
+void DCIM_InterfaceInfo::writeConfig( QWidget*, Config& ) {}
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.h b/noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.h
new file mode 100644
index 0000000..6396047
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim_ifaceinfo.h
@@ -0,0 +1,22 @@
+/*
+ * GPLv2
+ * zecke@handhelds.org
+ */
+
+#ifndef DCIM_IFACE_INFO_H
+#define DCIM_IFACE_INFO_H
+
+#include <iface/ifaceinfo.h>
+
+class DCIM_InterfaceInfo : public PInterfaceInfo {
+public:
+ DCIM_InterfaceInfo();
+ virtual ~DCIM_InterfaceInfo();
+
+ QString name()const;
+ QWidget* configWidget( const Config& );
+ void writeConfig( QWidget* wid, Config& );
+};
+
+
+#endif
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim_lister.cpp b/noncore/graphics/opie-eye/impl/dcim/dcim_lister.cpp
new file mode 100644
index 0000000..3c3d702
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim_lister.cpp
@@ -0,0 +1,181 @@
+/*
+ * GPLv2 zecke@handhelds.org
+ */
+
+#include "dcim_lister.h"
+#include <lib/slavemaster.h>
+
+#include <opie2/odebug.h>
+#include <qpe/storage.h>
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qimage.h>
+
+DCIM_DirLister::DCIM_DirLister()
+ : PDirLister( "dcim_dirlister" )
+{
+
+ /*
+ * create a SlaveMaster and lets connect the signal of
+ * it to our interface
+ */
+ SlaveHelper::slaveConnectSignals( this );
+ m_mode = ListingUnknown;
+}
+
+DCIM_DirLister::~DCIM_DirLister() {}
+
+QString DCIM_DirLister::defaultPath()const {
+ m_mode = ListingStart;
+ return QString::null;
+}
+
+QString DCIM_DirLister::setStartPath( const QString& str) {
+ /**
+ * IconView adds a '/' to path. Lets strip
+ * that.
+ */
+ QString st = str.mid( 1 );
+ if ( ListingStart == m_mode && m_map.contains( st ) ) {
+ m_path = m_map[st]+ "/dcim";
+ m_mode = ListingFolder;
+ }else if ( m_mode == ListingFolder ) {
+ m_mode = ListingFiles;
+ m_path = str;
+ }else if ( m_mode == ListingReFolder ) {
+ m_mode = ListingFolder;
+ }
+
+ owarn << " StartPath2 " << str << " " << m_path << oendl;
+
+ return m_path;
+}
+
+
+QString DCIM_DirLister::currentPath()const {
+ return m_path;
+}
+
+/*
+ * depending on the mode we will either
+ * Find Digital Cameras
+ */
+QStringList DCIM_DirLister::folders()const {
+ QStringList lst;
+
+ switch( m_mode ) {
+ case ListingUnknown:
+ case ListingStart:
+ lst = findCameras();
+ break;
+ case ListingFolder:
+ lst = findAlbums();
+ break;
+ case ListingFiles:
+ default:
+ break;
+ }
+
+ return lst;
+}
+
+QStringList DCIM_DirLister::files()const {
+ if ( m_mode != ListingFiles )
+ return QStringList();
+ else
+ return findImages();
+}
+
+QString DCIM_DirLister::dirUp( const QString& p )const {
+ QString str;
+
+ switch( m_mode ) {
+ case ListingFiles:
+ m_mode = ListingReFolder;
+ str = PDirLister::dirUp( p );
+ break;
+ case ListingFolder:
+ m_mode = ListingStart;
+ break;
+ case ListingUnknown:
+ case ListingStart:
+ default:
+ break;
+ }
+
+ /* down cases */
+ owarn << " New String " << str << " old path " << m_mode << oendl;
+ m_path = str;
+ return str;
+}
+
+
+QStringList DCIM_DirLister::findCameras()const {
+ QStringList lst;
+ StorageInfo inf;
+
+ m_map.clear();
+
+ const QList<FileSystem> &list = inf.fileSystems();
+ QListIterator<FileSystem> it( list );
+
+
+ FileSystem *sys;
+ for ( sys = it.current(); (sys=it.current())!=0 ; ++it )
+ if ( QFileInfo( sys->path() + "/dcim/" ).exists() ) {
+ lst << sys->name();
+ m_map.insert( sys->name(), sys->path() );
+ }
+
+ if ( lst.isEmpty() ) {
+ m_mode = ListingUnknown;
+ lst << QObject::tr("Error no Camera Dir found");
+ }else
+ m_mode = ListingStart;
+
+ return lst;
+}
+
+QStringList DCIM_DirLister::findAlbums()const {
+ QStringList lst = QDir( m_path ).entryList( QDir::Dirs );
+ lst.remove( "." );
+ lst.remove( ".." );
+
+ return lst;
+}
+
+QStringList DCIM_DirLister::findImages()const {
+ return QDir( m_path ).entryList("*.jpg *.jpeg *.png", QDir::Files );
+}
+
+void DCIM_DirLister::deleteImage( const QString& fl ) {
+ QFileInfo inf( fl );
+ QFile::remove( fl );
+ QFile::remove( inf.dirPath ()+"/preview"+
+ inf.fileName() );
+}
+
+void DCIM_DirLister::thumbNail( const QString& _str, int w, int h ) {
+ QFileInfo inf( _str );
+ QString str = QFileInfo( inf.dirPath()+"/preview"+ inf.fileName() ).exists() ?
+ inf.dirPath()+"/preview"+ inf.fileName() : _str;
+
+ SlaveMaster::self()->thumbNail( str, w, h );
+}
+
+QImage DCIM_DirLister::image( const QString& str, Factor f, int m ) {
+ return SlaveMaster::self()->image( str, f, m );
+}
+
+void DCIM_DirLister::imageInfo( const QString& str ) {
+ SlaveMaster::self()->thumbInfo( str );
+}
+
+void DCIM_DirLister::fullImageInfo( const QString& str ) {
+ SlaveMaster::self()->imageInfo( str );
+}
+
+QString DCIM_DirLister::nameToFname( const QString& name )const {
+ return name;
+}
diff --git a/noncore/graphics/opie-eye/impl/dcim/dcim_lister.h b/noncore/graphics/opie-eye/impl/dcim/dcim_lister.h
new file mode 100644
index 0000000..d0a2031
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dcim/dcim_lister.h
@@ -0,0 +1,71 @@
+/*
+ * GPLv2 zecke@handhelds.org
+ */
+
+#ifndef DCIM_LISTER_H
+#define DCIM_LISTER_H
+
+#include <iface/dirlister.h>
+
+#include <qmap.h>
+
+class Config;
+
+/**
+ * The DirLister is responsible for
+ * telling the GUI about files and folders
+ * and to load them.
+ * The DCIM is a special FileSystem lister
+ * in the that it starts with an overview
+ * of available 'Cameras'. It looks via 'Storage'
+ * for paths including a 'dcim' directory.
+ * And offers these as folders.
+ * Then it only lists Images. It tries to use
+ * the 'preview' directory to generate a thumbnail
+ * but will use the full image for the QImage
+ * call.
+ *
+ */
+class DCIM_DirLister : public PDirLister {
+ Q_OBJECT
+public:
+ enum ListMode{
+ ListingUnknown = -1,
+ ListingStart=1, /* give an overview over files */
+ ListingFolder, /* give access to albums */
+ ListingFiles, /* list the content of the album */
+ ListingReFolder
+ };
+ DCIM_DirLister();
+ ~DCIM_DirLister();
+
+ QString defaultPath()const;
+ QString setStartPath( const QString& );
+
+ QString currentPath()const;
+ QStringList folders()const;
+ QStringList files() const;
+
+ void deleteImage( const QString& );
+
+ void thumbNail( const QString&, int, int );
+ QImage image( const QString&, Factor, int );
+ void imageInfo( const QString& );
+ void fullImageInfo( const QString& );
+
+
+ virtual QString nameToFname( const QString& )const;
+ virtual QString dirUp(const QString& )const;
+
+private:
+ QStringList findCameras()const;
+ QStringList findAlbums ()const;
+ QStringList findImages ()const;
+
+private:
+ mutable QString m_path;
+ mutable ListMode m_mode;
+ mutable QMap<QString, QString> m_map;
+};
+
+#endif
diff --git a/noncore/graphics/opie-eye/impl/dir/dir.pro b/noncore/graphics/opie-eye/impl/dir/dir.pro
new file mode 100644
index 0000000..675c327
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/dir/dir.pro
@@ -0,0 +1,10 @@
+HEADERS += impl/dir/dir_dirview.h \
+ impl/dir/dir_ifaceinfo.h \
+ impl/dir/dir_lister.h
+
+
+
+SOURCES += impl/dir/dir_dirview.cpp \
+ impl/dir/dir_ifaceinfo.cpp \
+ impl/dir/dir_lister.cpp
+
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
index 5599ad1..f4a6a87 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
@@ -8,7 +8,6 @@
/* OPIE */
#include <opie2/odebug.h>
#include <qpe/config.h>
-using namespace Opie::Core;
/* QT */
#include <qwidget.h>
@@ -34,7 +33,7 @@ DirInterfaceInfo::~DirInterfaceInfo() {
}
QString DirInterfaceInfo::name()const {
- return QString::fromLatin1(QObject::tr("DirView" ));
+ return QObject::tr("Directory View" );
}
QWidget* DirInterfaceInfo::configWidget(const Config& cfg) {
@@ -45,7 +44,7 @@ QWidget* DirInterfaceInfo::configWidget(const Config& cfg) {
}
void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) {
- owarn << "Write Config" << oendl;
+ owarn << "Write Config" << oendl;
DirImageWidget* wid = static_cast<DirImageWidget*>(_wid);
cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked() );
}
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
index 3717297..d8b332a 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
@@ -21,17 +21,7 @@ Dir_DirLister::Dir_DirLister( bool list )
{
m_allFiles = list;
owarn << "All Files " << m_allFiles << "" << oendl;
-
- 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&)) );
-
+ SlaveHelper::slaveConnectSignals( this );
}
QString Dir_DirLister::defaultPath()const {
diff --git a/noncore/graphics/opie-eye/impl/doc/doc.pro b/noncore/graphics/opie-eye/impl/doc/doc.pro
new file mode 100644
index 0000000..076aa3b
--- a/dev/null
+++ b/noncore/graphics/opie-eye/impl/doc/doc.pro
@@ -0,0 +1,7 @@
+HEADERS += impl/doc/doc_dirview.h \
+ impl/doc/doc_ifaceinfo.h \
+ impl/doc/doc_lister.h
+
+SOURCES += impl/doc/doc_dirview.cpp \
+ impl/doc/doc_ifaceinfo.cpp \
+ impl/doc/doc_lister.cpp
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/doc/doc_ifaceinfo.cpp
index a6d6f3c..356a4b6 100644
--- a/noncore/graphics/opie-eye/impl/doc/doc_ifaceinfo.cpp
+++ b/noncore/graphics/opie-eye/impl/doc/doc_ifaceinfo.cpp
@@ -38,7 +38,7 @@ QString DocInterfaceInfo::name()const {
return QString::fromLatin1(QObject::tr("DocView" ));
}
-QWidget* DocInterfaceInfo::configWidget(const Config& cfg) {
+QWidget* DocInterfaceInfo::configWidget(const Config& ) {
#if 0
DirImageWidget* wid = new DirImageWidget();
wid->chkbox->setChecked( cfg.readBoolEntry("Dir_Check_All_Files", true) );
@@ -50,7 +50,7 @@ QWidget* DocInterfaceInfo::configWidget(const Config& cfg) {
void DocInterfaceInfo::writeConfig( QWidget* , Config& ) {
#if 0
- owarn << "Write Config" << oendl;
+ owarn << "Write Config" << oendl;
DirImageWidget* wid = static_cast<DirImageWidget*>(_wid);
cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked() );
#endif
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
index d4d1831..722fb95 100644
--- a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
+++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
@@ -21,9 +21,10 @@ using namespace Opie::Core;
Doc_DirLister::Doc_DirLister()
: PDirLister( "doc_dir_lister" )
{
+ /* connect the signals */
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_end()), this, SIGNAL(sig_end()) );
connect( master, SIGNAL(sig_thumbInfo(const QString&, const QString&)),
this, SLOT(slotThumbInfo(const QString&, const QString&)) );
connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)),
@@ -36,7 +37,7 @@ Doc_DirLister::Doc_DirLister()
}
QString Doc_DirLister::defaultPath()const {
- return ""; QPEApplication::documentDir();
+ return QString::null;
}
QString Doc_DirLister::setStartPath(const QString&) {
@@ -78,7 +79,6 @@ void Doc_DirLister::deleteImage( const QString& )
void Doc_DirLister::thumbNail( const QString& str, int w, int h) {
if (m_namemap.find(str)==m_namemap.end()) {
- owarn << "Item " << str << " not found" << oendl;
return;
}
QString fname = m_namemap[str];
@@ -87,7 +87,6 @@ void Doc_DirLister::thumbNail( const QString& str, int w, int h) {
QImage Doc_DirLister::image( const QString& str, Factor f, int m) {
if (m_namemap.find(str)==m_namemap.end()) {
- owarn << "Item " << str << " not found" << oendl;
return QImage();
}
QString fname = m_namemap[str];
@@ -96,7 +95,6 @@ QImage Doc_DirLister::image( const QString& str, Factor f, int m) {
void Doc_DirLister::imageInfo( const QString& str) {
if (m_namemap.find(str)==m_namemap.end()) {
- owarn << "Item " << str << " not found" << oendl;
return;
}
QString fname = m_namemap[str];
@@ -105,7 +103,6 @@ void Doc_DirLister::imageInfo( const QString& str) {
void Doc_DirLister::fullImageInfo( const QString& str) {
if (m_namemap.find(str)==m_namemap.end()) {
- owarn << "Item " << str << " not found" << oendl;
return;
}
QString fname = m_namemap[str];
@@ -115,7 +112,6 @@ void Doc_DirLister::fullImageInfo( const QString& str) {
void Doc_DirLister::slotFullInfo(const QString&f, const QString&t)
{
if (m_filemap.find(f)==m_filemap.end()) {
- owarn << "Item " << f << " not found" << oendl;
return;
}
QString name = m_filemap[f];
@@ -125,7 +121,6 @@ void Doc_DirLister::slotFullInfo(const QString&f, const QString&t)
void Doc_DirLister::slotThumbInfo(const QString&f, const QString&t)
{
if (m_filemap.find(f)==m_filemap.end()) {
- owarn << "Item " << f << " not found" << oendl;
return;
}
QString name = m_filemap[f];
@@ -135,7 +130,6 @@ void Doc_DirLister::slotThumbInfo(const QString&f, const QString&t)
void Doc_DirLister::slotThumbNail(const QString&f, const QPixmap&p)
{
if (m_filemap.find(f)==m_filemap.end()) {
- owarn << "Item " << f << " not found" << oendl;
return;
}
QString name = m_filemap[f];
@@ -145,8 +139,11 @@ void Doc_DirLister::slotThumbNail(const QString&f, const QPixmap&p)
QString Doc_DirLister::nameToFname(const QString&name)const
{
if (m_namemap.find(name)==m_namemap.end()) {
- owarn << "Item " << name << " not found" << oendl;
return QString::null;
}
return m_namemap[name];
}
+
+QString Doc_DirLister::dirUp( const QString& p ) const{
+ return p;
+}
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.h b/noncore/graphics/opie-eye/impl/doc/doc_lister.h
index a65b616..5884a35 100644
--- a/noncore/graphics/opie-eye/impl/doc/doc_lister.h
+++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.h
@@ -29,6 +29,7 @@ public:
void imageInfo( const QString& );
void fullImageInfo( const QString& );
virtual QString nameToFname(const QString&name)const;
+ QString dirUp( const QString& )const;
private:
QMap<QString,QString> m_namemap,m_filemap;
diff --git a/noncore/graphics/opie-eye/lib/slavemaster.cpp b/noncore/graphics/opie-eye/lib/slavemaster.cpp
index 5bb7ab8..d7165cc 100644
--- a/noncore/graphics/opie-eye/lib/slavemaster.cpp
+++ b/noncore/graphics/opie-eye/lib/slavemaster.cpp
@@ -27,7 +27,7 @@ QDataStream & operator >> (QDataStream & str, bool & b)
* ! We don't put a Pixmap in!!!!
*/
QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) {
- owarn << "Image request is " << inf.file.latin1() << " " << inf.width << " " << inf.height << "" << oendl;
+ owarn << "Image request is " << inf.file.latin1() << " " << inf.width << " " << inf.height << "" << oendl;
return s << inf.file << inf.width << inf.height;
}
QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) {
@@ -82,10 +82,10 @@ void SlaveMaster::imageInfo( const QString& str ) {
void SlaveMaster::thumbNail( const QString& str, int w, int h ) {
if ( str.isEmpty() ) {
- owarn << "Asking for empty nail" << oendl;
+ owarn << "Asking for empty nail" << oendl;
return;
}
- owarn << "Asking for thumbNail in size " << w << " " << h << "" + str << oendl;
+ owarn << "Asking for thumbNail in size " << w << " " << h << "" + str << oendl;
PixmapInfo item;
item.file = str; item.width = w; item.height = h;
item.pixmap = QPixmap();
@@ -109,7 +109,7 @@ void SlaveMaster::recieve( const QCString& str, const QByteArray& at) {
else if ( str == "pixmapsHandled(StringList)" )
stream >> infos;
- owarn << "PixInfos " << pixinfos.count() << "" << oendl;
+ owarn << "PixInfos " << pixinfos.count() << "" << oendl;
bool got_data = ( !infos.isEmpty() || !pixinfos.isEmpty() );
if ( got_data ) {
@@ -149,6 +149,22 @@ void SlaveMaster::slotTimerStart() {
m_inThumbNail.clear();
}
-QImage SlaveMaster::image( const QString& str, PDirLister::Factor, int ) {
+QImage SlaveMaster::image( const QString& , PDirLister::Factor, int ) {
return QImage();
}
+
+
+namespace SlaveHelper {
+void slaveConnectSignals( QObject* target ) {
+ SlaveMaster* master = SlaveMaster::self();
+
+ QObject::connect( master, SIGNAL(sig_start()), target, SIGNAL(sig_start()) );
+ QObject::connect( master, SIGNAL(sig_end()), target, SIGNAL(sig_end()) );
+ QObject::connect( master, SIGNAL(sig_thumbInfo(const QString&, const QString&)),
+ target, SIGNAL(sig_thumbInfo(const QString&, const QString&)) );
+ QObject::connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)),
+ target, SIGNAL(sig_fullInfo(const QString&, const QString&)) );
+ QObject::connect( master, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)),
+ target, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)) );
+}
+}
diff --git a/noncore/graphics/opie-eye/lib/slavemaster.h b/noncore/graphics/opie-eye/lib/slavemaster.h
index f5284a6..98c3403 100644
--- a/noncore/graphics/opie-eye/lib/slavemaster.h
+++ b/noncore/graphics/opie-eye/lib/slavemaster.h
@@ -8,6 +8,16 @@
#include <qstring.h>
#include <qsize.h>
+namespace SlaveHelper {
+/**
+ * Small Helper to create a SlaveMaster
+ * and to connect its' signals to the
+ * object. To use the object as a proxy
+ */
+void slaveConnectSignals( QObject* );
+}
+
+
class SlaveMaster : public QObject {
Q_OBJECT
typedef QValueList<ImageInfo> ImageInfos;
diff --git a/noncore/graphics/opie-eye/phunk_view.pro b/noncore/graphics/opie-eye/phunk_view.pro
index 0a57a0f..b266f9a 100644
--- a/noncore/graphics/opie-eye/phunk_view.pro
+++ b/noncore/graphics/opie-eye/phunk_view.pro
@@ -4,35 +4,14 @@ TEMPLATE = app
TARGET = opie-eye
# the name of the resulting object
-HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.h \
- lib/imagecache.h impl/dir/dir_dirview.h \
- iface/dirview.h iface/dirlister.h iface/ifaceinfo.h \
- impl/dir/dir_lister.h impl/dir/dir_ifaceinfo.h \
- lib/slavemaster.h \
- iface/slaveiface.h \
- gui/imageinfoui.h \
- gui/imageview.h \
- gui/viewmodebutton.h \
- impl/doc/doc_lister.h impl/doc/doc_dirview.h \
- impl/doc/doc_ifaceinfo.h
-
-# A list header files
-
-
-SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.cpp \
- lib/imagecache.cpp lib/viewmap.cpp \
- impl/dir/dir_dirview.cpp iface/dirlister.cpp \
- iface/dirview.cpp impl/dir/dir_lister.cpp \
- impl/dir/dir_ifaceinfo.cpp lib/slavemaster.cpp \
- gui/imageinfoui.cpp \
- gui/imageview.cpp \
- gui/viewmodebutton.cpp \
- impl/doc/doc_lister.cpp impl/doc/doc_dirview.cpp \
- impl/doc/doc_ifaceinfo.cpp
-# A list of source files
-
-INTERFACES =
-# list of ui files
+
+include( gui/gui.pro )
+include( lib/lib.pro )
+include( iface/iface.pro )
+include( impl/doc/doc.pro )
+include( impl/dir/dir.pro )
+include( impl/dcim/dcim.pro )
+
INCLUDEPATH += . $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
diff --git a/noncore/graphics/opie-eye/slave/.cvsignore b/noncore/graphics/opie-eye/slave/.cvsignore
new file mode 100644
index 0000000..52494fb
--- a/dev/null
+++ b/noncore/graphics/opie-eye/slave/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+*.moc