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.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/slave/slavereciever.cpp b/noncore/graphics/opie-eye/slave/slavereciever.cpp index c8e33d4..bbbbb30 100644 --- a/noncore/graphics/opie-eye/slave/slavereciever.cpp +++ b/noncore/graphics/opie-eye/slave/slavereciever.cpp | |||
@@ -52,17 +52,17 @@ QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { | |||
52 | 52 | ||
53 | SlaveObjects* slaveObjects() { | 53 | SlaveObjects* slaveObjects() { |
54 | if ( !_slaveObj ) | 54 | if ( !_slaveObj ) |
55 | _slaveObj = new SlaveObjects; | 55 | _slaveObj = new SlaveObjects; |
56 | return _slaveObj; | 56 | return _slaveObj; |
57 | } | 57 | } |
58 | 58 | ||
59 | SlaveReciever::SlaveReciever( QObject* par) | 59 | SlaveReciever::SlaveReciever( QObject* par) |
60 | : QObject( par ) | 60 | : QObject( par ), m_refs( 0 ) |
61 | { | 61 | { |
62 | m_inf = new QTimer(this); | 62 | m_inf = new QTimer(this); |
63 | connect(m_inf,SIGNAL(timeout()), | 63 | connect(m_inf,SIGNAL(timeout()), |
64 | this, SLOT(slotImageInfo())); | 64 | this, SLOT(slotImageInfo())); |
65 | m_pix = new QTimer(this); | 65 | m_pix = new QTimer(this); |
66 | connect(m_pix,SIGNAL(timeout()), | 66 | connect(m_pix,SIGNAL(timeout()), |
67 | this, SLOT(slotThumbNail())); | 67 | this, SLOT(slotThumbNail())); |
68 | 68 | ||
@@ -115,25 +115,32 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) | |||
115 | m_inPix.append(pix); | 115 | m_inPix.append(pix); |
116 | }else if ( string == "pixmapInfos(PixmapInfos)" ) { | 116 | }else if ( string == "pixmapInfos(PixmapInfos)" ) { |
117 | PixmapList list; | 117 | PixmapList list; |
118 | stream >> list; | 118 | stream >> list; |
119 | for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) { | 119 | for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) { |
120 | qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height ); | 120 | qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height ); |
121 | m_inPix.append(*it); | 121 | m_inPix.append(*it); |
122 | } | 122 | } |
123 | }else if ( string == "refUp()" ) { | ||
124 | m_refs++; | ||
125 | }else if ( string == "refDown()" ) { | ||
126 | m_refs--; | ||
123 | } | 127 | } |
124 | 128 | ||
125 | if (!m_inf->isActive() && !m_inList.isEmpty() ) | 129 | if (!m_inf->isActive() && !m_inList.isEmpty() ) |
126 | m_inf->start(5); | 130 | m_inf->start(5); |
127 | 131 | ||
128 | if (!m_pix->isActive() && !m_inPix.isEmpty() ) | 132 | if (!m_pix->isActive() && !m_inPix.isEmpty() ) |
129 | m_pix->start(5); | 133 | m_pix->start(5); |
130 | 134 | ||
131 | QPEApplication::setKeepRunning(); | 135 | if ( m_refs ) |
136 | QPEApplication::setKeepRunning(); | ||
137 | else | ||
138 | qApp->quit(); | ||
132 | 139 | ||
133 | } | 140 | } |
134 | 141 | ||
135 | PixmapList SlaveReciever::outPix()const { | 142 | PixmapList SlaveReciever::outPix()const { |
136 | return m_outPix; | 143 | return m_outPix; |
137 | } | 144 | } |
138 | 145 | ||
139 | StringList SlaveReciever::outInf()const{ | 146 | StringList SlaveReciever::outInf()const{ |