author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/settings/aqpkg/ipkg.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index 3761b67..866afed 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp | |||
@@ -267,56 +267,56 @@ void Ipkg :: removeStatusEntry() | |||
267 | 267 | ||
268 | readFile.close(); | 268 | readFile.close(); |
269 | writeFile.close(); | 269 | writeFile.close(); |
270 | 270 | ||
271 | // Remove old status file and put tmp stats file in its place | 271 | // Remove old status file and put tmp stats file in its place |
272 | remove( statusFile ); | 272 | remove( statusFile ); |
273 | rename( outStatusFile, statusFile ); | 273 | rename( outStatusFile, statusFile ); |
274 | } | 274 | } |
275 | 275 | ||
276 | int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | 276 | int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) |
277 | { | 277 | { |
278 | // If one is already running - should never be but just to be safe | 278 | // If one is already running - should never be but just to be safe |
279 | if ( proc ) | 279 | if ( proc ) |
280 | { | 280 | { |
281 | delete proc; | 281 | delete proc; |
282 | proc = 0; | 282 | proc = 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | // OK we're gonna use OProcess to run this thing | 285 | // OK we're gonna use OProcess to run this thing |
286 | proc = new OProcess(); | 286 | proc = new OProcess(); |
287 | aborted = false; | 287 | aborted = false; |
288 | 288 | ||
289 | 289 | ||
290 | // Connect up our slots | 290 | // Connect up our slots |
291 | connect(proc, SIGNAL(processExited(OProcess *)), | 291 | connect(proc, SIGNAL(processExited(OProcess*)), |
292 | this, SLOT( processFinished())); | 292 | this, SLOT( processFinished())); |
293 | 293 | ||
294 | connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), | 294 | connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), |
295 | this, SLOT(commandStdout(OProcess *, char *, int))); | 295 | this, SLOT(commandStdout(OProcess*,char*,int))); |
296 | 296 | ||
297 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), | 297 | connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), |
298 | this, SLOT(commandStderr(OProcess *, char *, int))); | 298 | this, SLOT(commandStderr(OProcess*,char*,int))); |
299 | 299 | ||
300 | for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) | 300 | for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) |
301 | { | 301 | { |
302 | *proc << (*it).latin1(); | 302 | *proc << (*it).latin1(); |
303 | } | 303 | } |
304 | 304 | ||
305 | // Start the process going | 305 | // Start the process going |
306 | finished = false; | 306 | finished = false; |
307 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) | 307 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) |
308 | { | 308 | { |
309 | emit outputText( tr("Couldn't start ipkg process" ) ); | 309 | emit outputText( tr("Couldn't start ipkg process" ) ); |
310 | } | 310 | } |
311 | } | 311 | } |
312 | 312 | ||
313 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | 313 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) |
314 | { | 314 | { |
315 | QString lineStr = buffer; | 315 | QString lineStr = buffer; |
316 | if ( lineStr[buflen-1] == '\n' ) | 316 | if ( lineStr[buflen-1] == '\n' ) |
317 | buflen --; | 317 | buflen --; |
318 | lineStr = lineStr.left( buflen ); | 318 | lineStr = lineStr.left( buflen ); |
319 | emit outputText( lineStr ); | 319 | emit outputText( lineStr ); |
320 | 320 | ||
321 | // check if we are installing dependant packages | 321 | // check if we are installing dependant packages |
322 | if ( option == "install" || option == "reinstall" ) | 322 | if ( option == "install" || option == "reinstall" ) |