Diffstat (limited to 'noncore/graphics/opie-eye/lib/slavemaster.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/lib/slavemaster.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/lib/slavemaster.cpp b/noncore/graphics/opie-eye/lib/slavemaster.cpp index 18dc883..4e28535 100644 --- a/noncore/graphics/opie-eye/lib/slavemaster.cpp +++ b/noncore/graphics/opie-eye/lib/slavemaster.cpp | |||
@@ -1,70 +1,75 @@ | |||
1 | #include "slavemaster.h" | 1 | #include "slavemaster.h" |
2 | 2 | ||
3 | #include <qpe/qpeapplication.h> | 3 | #include <qpe/qpeapplication.h> |
4 | #include <qpe/qcopenvelope_qws.h> | 4 | #include <qpe/qcopenvelope_qws.h> |
5 | 5 | ||
6 | #include <qcopchannel_qws.h> | 6 | #include <qcopchannel_qws.h> |
7 | #include <qtimer.h> | 7 | #include <qtimer.h> |
8 | 8 | ||
9 | QDataStream & operator << (QDataStream & str, bool b) | 9 | QDataStream & operator << (QDataStream & str, bool b) |
10 | { | 10 | { |
11 | str << Q_INT8(b); | 11 | str << Q_INT8(b); |
12 | return str; | 12 | return str; |
13 | } | 13 | } |
14 | QDataStream & operator >> (QDataStream & str, bool & b) | 14 | QDataStream & operator >> (QDataStream & str, bool & b) |
15 | { | 15 | { |
16 | Q_INT8 l; | 16 | Q_INT8 l; |
17 | str >> l; | 17 | str >> l; |
18 | b = bool(l); | 18 | b = bool(l); |
19 | return str; | 19 | return str; |
20 | } | 20 | } |
21 | |||
22 | /* | ||
23 | * ! We don't put a Pixmap in!!!! | ||
24 | */ | ||
21 | QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { | 25 | QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { |
22 | return s << inf.file << inf.pixmap << inf.width << inf.height; | 26 | qWarning( "Image request is %s %d %d", inf.file.latin1(), inf.width, inf.height ); |
27 | return s << inf.file << inf.width << inf.height; | ||
23 | } | 28 | } |
24 | QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { | 29 | QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { |
25 | s >> inf.file >> inf.pixmap >> inf.width >> inf.height; | 30 | s >> inf.file >> inf.pixmap >> inf.width >> inf.height; |
26 | return s; | 31 | return s; |
27 | } | 32 | } |
28 | QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { | 33 | QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { |
29 | return s << i.kind << i.file << i.info; | 34 | return s << i.kind << i.file << i.info; |
30 | } | 35 | } |
31 | QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { | 36 | QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { |
32 | s >> i.kind >> i.file >> i.info; | 37 | s >> i.kind >> i.file >> i.info; |
33 | return s; | 38 | return s; |
34 | } | 39 | } |
35 | 40 | ||
36 | 41 | ||
37 | 42 | ||
38 | SlaveMaster* SlaveMaster::m_master = 0; | 43 | SlaveMaster* SlaveMaster::m_master = 0; |
39 | 44 | ||
40 | SlaveMaster::SlaveMaster() | 45 | SlaveMaster::SlaveMaster() |
41 | : m_started( false ) | 46 | : m_started( false ) |
42 | { | 47 | { |
43 | QCopChannel *chan= new QCopChannel( "QPE/opie-eye",this ); | 48 | QCopChannel *chan= new QCopChannel( "QPE/opie-eye",this ); |
44 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&)), | 49 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&)), |
45 | this, SLOT(recieve(const QCString&,const QByteArray&)) ); | 50 | this, SLOT(recieve(const QCString&,const QByteArray&)) ); |
46 | } | 51 | } |
47 | 52 | ||
48 | SlaveMaster::~SlaveMaster() { | 53 | SlaveMaster::~SlaveMaster() { |
49 | } | 54 | } |
50 | 55 | ||
51 | SlaveMaster* SlaveMaster::self() { | 56 | SlaveMaster* SlaveMaster::self() { |
52 | if ( !m_master ) | 57 | if ( !m_master ) |
53 | m_master = new SlaveMaster; | 58 | m_master = new SlaveMaster; |
54 | return m_master; | 59 | return m_master; |
55 | } | 60 | } |
56 | 61 | ||
57 | void SlaveMaster::thumbInfo( const QString& str) { | 62 | void SlaveMaster::thumbInfo( const QString& str) { |
58 | m_inThumbInfo.append( str ); | 63 | m_inThumbInfo.append( str ); |
59 | 64 | ||
60 | if ( !m_started ) { | 65 | if ( !m_started ) { |
61 | QTimer::singleShot( 0, this, SLOT(slotTimerStart())); | 66 | QTimer::singleShot( 0, this, SLOT(slotTimerStart())); |
62 | m_started = true; | 67 | m_started = true; |
63 | } | 68 | } |
64 | } | 69 | } |
65 | 70 | ||
66 | void SlaveMaster::imageInfo( const QString& str ) { | 71 | void SlaveMaster::imageInfo( const QString& str ) { |
67 | m_inImageInfo.append( str ); | 72 | m_inImageInfo.append( str ); |
68 | if ( !m_started ) { | 73 | if ( !m_started ) { |
69 | QTimer::singleShot( 0, this, SLOT(slotTimerStart())); | 74 | QTimer::singleShot( 0, this, SLOT(slotTimerStart())); |
70 | m_started = true; | 75 | m_started = true; |