summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/slave/slavereciever.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/slave/slavereciever.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/slave/slavereciever.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/noncore/graphics/opie-eye/slave/slavereciever.cpp b/noncore/graphics/opie-eye/slave/slavereciever.cpp
index bbbbb30..82b3d23 100644
--- a/noncore/graphics/opie-eye/slave/slavereciever.cpp
+++ b/noncore/graphics/opie-eye/slave/slavereciever.cpp
@@ -4,11 +4,15 @@
4 4
5#include "slavereciever.h" 5#include "slavereciever.h"
6#include "slaveiface.h" 6#include "slaveiface.h"
7 7
8/* OPIE */
9#include <opie2/odebug.h>
8#include <qpe/qcopenvelope_qws.h> 10#include <qpe/qcopenvelope_qws.h>
9#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12using namespace Opie::Core;
10 13
14/* QT */
11#include <qtimer.h> 15#include <qtimer.h>
12 16
13static SlaveObjects* _slaveObj = 0; 17static SlaveObjects* _slaveObj = 0;
14 18
@@ -36,9 +40,9 @@ QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) {
36 * GUI sends no QPIxmap!!! 40 * GUI sends no QPIxmap!!!
37 */ 41 */
38QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { 42QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) {
39 s >> inf.file >> inf.width >> inf.height; 43 s >> inf.file >> inf.width >> inf.height;
40 qWarning( "Recieved %s %d %d", inf.file.latin1(), inf.width, inf.height ); 44 owarn << "Recieved " << inf.file.latin1() << " " << inf.width << " " << inf.height << "" << oendl;
41 return s; 45 return s;
42} 46}
43QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { 47QDataStream &operator<<( QDataStream& s, const ImageInfo& i) {
44 return s << i.kind << i.file << i.info; 48 return s << i.kind << i.file << i.info;
@@ -81,9 +85,9 @@ SlaveReciever::SlaveReciever( QObject* par)
81SlaveReciever::~SlaveReciever() { 85SlaveReciever::~SlaveReciever() {
82} 86}
83 87
84void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) { 88void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) {
85 qWarning( "String is %s", string.data() ); 89 owarn << "String is " << string.data() << "" << oendl;
86 QDataStream stream(ar, IO_ReadOnly ); 90 QDataStream stream(ar, IO_ReadOnly );
87 QStringList lst; 91 QStringList lst;
88 static ImageInfo inf; 92 static ImageInfo inf;
89 static PixmapInfo pix; 93 static PixmapInfo pix;
@@ -93,9 +97,9 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar)
93 m_inList.append(inf); 97 m_inList.append(inf);
94 }else if ( string == "thumbInfos(QStringList)" ) { 98 }else if ( string == "thumbInfos(QStringList)" ) {
95 stream >> lst; 99 stream >> lst;
96 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 100 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
97 qWarning( "Adding thumbinfo for file "+ *it ); 101 owarn << "Adding thumbinfo for file "+ *it << oendl;
98 inf.file = (*it); 102 inf.file = (*it);
99 m_inList.append(inf); 103 m_inList.append(inf);
100 } 104 }
101 }else if ( string == "fullInfo(QString)" ) { 105 }else if ( string == "fullInfo(QString)" ) {
@@ -104,9 +108,9 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar)
104 m_inList.append(inf); 108 m_inList.append(inf);
105 }else if ( string == "fullInfos(QStringList)" ) { 109 }else if ( string == "fullInfos(QStringList)" ) {
106 stream >> lst; 110 stream >> lst;
107 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 111 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
108 qWarning( "Adding fullInfo for"+ *it ); 112 owarn << "Adding fullInfo for"+ *it << oendl;
109 inf.file = (*it); 113 inf.file = (*it);
110 inf.kind = true; 114 inf.kind = true;
111 m_inList.append(inf); 115 m_inList.append(inf);
112 } 116 }
@@ -116,9 +120,9 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar)
116 }else if ( string == "pixmapInfos(PixmapInfos)" ) { 120 }else if ( string == "pixmapInfos(PixmapInfos)" ) {
117 PixmapList list; 121 PixmapList list;
118 stream >> list; 122 stream >> list;
119 for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) { 123 for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) {
120 qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height ); 124 owarn << "Got " << (*it).width << " " << (*it).height << " " + (*it).file << oendl;
121 m_inPix.append(*it); 125 m_inPix.append(*it);
122 } 126 }
123 }else if ( string == "refUp()" ) { 127 }else if ( string == "refUp()" ) {
124 m_refs++; 128 m_refs++;
@@ -180,9 +184,9 @@ void SlaveReciever::slotThumbNail() {
180 for(it = map->begin(); it != map->end(); ++it ) { 184 for(it = map->begin(); it != map->end(); ++it ) {
181 SlaveInterface* iface = it.data(); 185 SlaveInterface* iface = it.data();
182 if( iface->supports(inf.file ) ) { 186 if( iface->supports(inf.file ) ) {
183 /* pixmap */ 187 /* pixmap */
184 qWarning( "Asking for thumbNail in size %d %d for "+inf.file, inf.width, inf.height ); 188 owarn << "Asking for thumbNail in size " << inf.width << " " << inf.height << " for "+inf.file << oendl;
185 inf.pixmap = iface->pixmap(inf.file, 64, 64); 189 inf.pixmap = iface->pixmap(inf.file, 64, 64);
186 m_outPix.append( inf ); 190 m_outPix.append( inf );
187 break; 191 break;
188 } 192 }
@@ -199,25 +203,25 @@ void SlaveReciever::slotThumbNail() {
199void SlaveReciever::slotSend() { 203void SlaveReciever::slotSend() {
200 204
201 m_out->stop(); 205 m_out->stop();
202 206
203 qWarning( "Sending %d %d", outPix().count(), outInf().count() ); 207 owarn << "Sending " << outPix().count() << " " << outInf().count() << "" << oendl;
204 /* queue it and send */ 208 /* queue it and send */
205 /* if this ever gets a service introduce request queues 209 /* if this ever gets a service introduce request queues
206 * so we can differinatate between different clients 210 * so we can differinatate between different clients
207 */ 211 */
208 if (! m_outPix.isEmpty() ) { 212 if (! m_outPix.isEmpty() ) {
209 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(PixmapList)" ); 213 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(PixmapList)" );
210 answer << outPix(); 214 answer << outPix();
211 for ( PixmapList::Iterator it = m_outPix.begin();it!=m_outPix.end();++it ) { 215 for ( PixmapList::Iterator it = m_outPix.begin();it!=m_outPix.end();++it ) {
212 qWarning( "Sending out %s %d %d", (*it).file.latin1(), (*it).width, (*it).height ); 216 owarn << "Sending out " << (*it).file.latin1() << " " << (*it).width << " " << (*it).height << "" << oendl;
213 } 217 }
214 } 218 }
215 if ( !m_outList.isEmpty() ) { 219 if ( !m_outList.isEmpty() ) {
216 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(StringList)" ); 220 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(StringList)" );
217 answer << outInf(); 221 answer << outInf();
218 for ( StringList::Iterator it = m_outList.begin();it!=m_outList.end();++it ) { 222 for ( StringList::Iterator it = m_outList.begin();it!=m_outList.end();++it ) {
219 qWarning( "Sending out2 " + (*it).file ); 223 owarn << "Sending out2 " + (*it).file << oendl;
220 } 224 }
221 } 225 }
222 226
223 m_outList.clear(); 227 m_outList.clear();