summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/lib
Side-by-side diff
Diffstat (limited to 'noncore/graphics/opie-eye/lib') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/lib/slavemaster.cpp26
-rw-r--r--noncore/graphics/opie-eye/lib/slavemaster.h10
2 files changed, 31 insertions, 5 deletions
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
@@ -24,13 +24,13 @@ 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 ) {
s >> inf.file >> inf.pixmap >> inf.width >> inf.height;
return s;
}
@@ -79,16 +79,16 @@ void SlaveMaster::imageInfo( const QString& str ) {
m_started = true;
}
}
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();
m_inThumbNail.append( item );
if ( !m_started ) {
@@ -106,13 +106,13 @@ void SlaveMaster::recieve( const QCString& str, const QByteArray& at) {
QDataStream stream( at, IO_ReadOnly );
if ( str == "pixmapsHandled(PixmapList)" )
stream >> pixinfos;
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 ) {
emit sig_start();
for ( ImageInfos::Iterator _it = infos.begin(); _it != infos.end(); ++_it ) {
if ( (*_it).kind )
@@ -146,9 +146,25 @@ void SlaveMaster::slotTimerStart() {
m_inThumbInfo.clear();
m_inImageInfo.clear();
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
@@ -5,12 +5,22 @@
#include <iface/slaveiface.h>
#include <qobject.h>
#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;
typedef QValueList<PixmapInfo> PixmapInfos;
public:
static SlaveMaster *self();