summaryrefslogtreecommitdiff
path: root/core/launcher/qcopbridge.cpp
Unidiff
Diffstat (limited to 'core/launcher/qcopbridge.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/qcopbridge.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index b45f0cc..9bca360 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -120,97 +120,97 @@ void QCopBridge::newConnection( int socket )
120#ifndef QT_NO_COP 120#ifndef QT_NO_COP
121 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; 121 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
122#endif 122#endif
123 123
124 if ( sendSync ) { 124 if ( sendSync ) {
125 pi ->startSync(); 125 pi ->startSync();
126 sendSync = FALSE; 126 sendSync = FALSE;
127 } 127 }
128} 128}
129 129
130void QCopBridge::closed( QCopBridgePI *pi ) 130void QCopBridge::closed( QCopBridgePI *pi )
131{ 131{
132 emit connectionClosed( pi->peerAddress() ); 132 emit connectionClosed( pi->peerAddress() );
133 openConnections.removeRef( pi ); 133 openConnections.removeRef( pi );
134 if ( openConnections.count() == 0 ) { 134 if ( openConnections.count() == 0 ) {
135 /* ### FIXME libqtopia merge */ 135 /* ### FIXME libqtopia merge */
136#if 0 136#if 0
137 QPEApplication::setTempScreenSaverMode( QPEApplication::Enable ); 137 QPEApplication::setTempScreenSaverMode( QPEApplication::Enable );
138#endif 138#endif
139#ifndef QT_NO_COP 139#ifndef QT_NO_COP
140 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 140 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
141#endif 141#endif
142 } 142 }
143} 143}
144 144
145void QCopBridge::closeOpenConnections() 145void QCopBridge::closeOpenConnections()
146{ 146{
147 QCopBridgePI *pi; 147 QCopBridgePI *pi;
148 for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() ) 148 for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() )
149 pi->close(); 149 pi->close();
150} 150}
151 151
152 152
153void QCopBridge::desktopMessage( const QCString &command, const QByteArray &data ) 153void QCopBridge::desktopMessage( const QCString &command, const QByteArray &data )
154{ 154{
155 if ( command == "startSync()" ) { 155 if ( command == "startSync()" ) {
156 // we need to buffer it a bit 156 // we need to buffer it a bit
157 sendSync = TRUE; 157 sendSync = TRUE;
158 startTimer( 20000 ); 158 startTimer( 20000 );
159 } 159 }
160 160
161 if ( m_mode & Qtopia1_7 ) { 161 if ( m_mode & Qtopia1_7 ) {
162 // send the command to all open connections 162 // send the command to all open connections
163 QCopBridgePI *pi; 163 QCopBridgePI *pi;
164 for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() ) { 164 for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() ) {
165 pi->sendDesktopMessage( command, data ); 165 pi->sendDesktopMessage( command, data );
166 } 166 }
167 } 167 }
168 if ( m_mode & Sharp ) 168 if ( ( m_mode & Sharp ) || (m_mode & IntelliSync) )
169 sendDesktopMessageOld( command, data ); 169 sendDesktopMessageOld( command, data );
170} 170}
171 171
172#ifndef OPIE_NO_OLD_SYNC_CODE 172#ifndef OPIE_NO_OLD_SYNC_CODE
173/* 173/*
174 * Old compat mode 174 * Old compat mode
175 */ 175 */
176void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArray& args) { 176void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArray& args) {
177 command.stripWhiteSpace(); 177 command.stripWhiteSpace();
178 178
179 int paren = command.find( "(" ); 179 int paren = command.find( "(" );
180 if ( paren <= 0 ) { 180 if ( paren <= 0 ) {
181 qDebug("DesktopMessage: bad qcop syntax"); 181 qDebug("DesktopMessage: bad qcop syntax");
182 return; 182 return;
183 } 183 }
184 184
185 QString params = command.mid( paren + 1 ); 185 QString params = command.mid( paren + 1 );
186 if ( params[params.length()-1] != ')' ) { 186 if ( params[params.length()-1] != ')' ) {
187 qDebug("DesktopMessage: bad qcop syntax"); 187 qDebug("DesktopMessage: bad qcop syntax");
188 return; 188 return;
189 } 189 }
190 190
191 params.truncate( params.length()-1 ); 191 params.truncate( params.length()-1 );
192 192
193 QStringList paramList = QStringList::split( ",", params ); 193 QStringList paramList = QStringList::split( ",", params );
194 QString data; 194 QString data;
195 if ( paramList.count() ) { 195 if ( paramList.count() ) {
196 QDataStream stream( args, IO_ReadOnly ); 196 QDataStream stream( args, IO_ReadOnly );
197 for ( QStringList::Iterator it = paramList.begin(); it != paramList.end(); ++it ) { 197 for ( QStringList::Iterator it = paramList.begin(); it != paramList.end(); ++it ) {
198 QString str; 198 QString str;
199 if ( *it == "QString" ) { 199 if ( *it == "QString" ) {
200 stream >> str; 200 stream >> str;
201 } else if ( *it == "QCString" ) { 201 } else if ( *it == "QCString" ) {
202 QCString cstr; 202 QCString cstr;
203 stream >> cstr; 203 stream >> cstr;
204 str = QString::fromLocal8Bit( cstr ); 204 str = QString::fromLocal8Bit( cstr );
205 } else if ( *it == "int" ) { 205 } else if ( *it == "int" ) {
206 int i; 206 int i;
207 stream >> i; 207 stream >> i;
208 str = QString::number( i ); 208 str = QString::number( i );
209 } else if ( *it == "bool" ) { 209 } else if ( *it == "bool" ) {
210 int i; 210 int i;
211 stream >> i; 211 stream >> i;
212 str = QString::number( i ); 212 str = QString::number( i );
213 } else { 213 } else {
214 qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() ); 214 qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() );
215 return; 215 return;
216 } 216 }