Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/corelib/io/qprocess.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    8989
    9090#include <qbytearray.h>
    91 #include <qdatetime.h>
     91#include <q.h>
    9292#include <qcoreapplication.h>
    9393#include <qsocketnotifier.h>
     
    13931393}
    13941394
     1395
     1396
     1397
     1398
     1399
     1400
     1401
     1402
     1403
     1404
     1405
     1406
     1407
     1408
     1409
     1410
     1411
     1412
     1413
     1414
     1415
     1416
     1417
     1418
     1419
     1420
     1421
     1422
     1423
     1424
     1425
     1426
     1427
     1428
     1429
     1430
     1431
     1432
     1433
     1434
     1435
     1436
     1437
     1438
    13951439/*!
    13961440    If QProcess has been assigned a working directory, this function returns
     
    16651709        return false;
    16661710    if (d->processState == QProcess::Starting) {
    1667         QTime stopWatch;
     1711        Q stopWatch;
    16681712        stopWatch.start();
    16691713        bool started = waitForStarted(msecs);
     
    17021746        return false;
    17031747    if (d->processState == QProcess::Starting) {
    1704         QTime stopWatch;
     1748        Q stopWatch;
    17051749        stopWatch.start();
    17061750        bool started = waitForStarted(msecs);
     
    18801924
    18811925/*!
    1882     Starts the program \a program in a new process, if one is not already
     1926    Starts the already
    18831927    running, passing the command line arguments in \a arguments. The OpenMode
    18841928    is set to \a mode.
     
    18901934    process will continue running.
    18911935
    1892     \note Arguments that contain spaces are not passed to the
    1893     process as separate arguments.
    1894 
    18951936    \note Processes are started asynchronously, which means the started()
    18961937    and error() signals may be delayed. Call waitForStarted() to make
    18971938    sure the process has started (or has failed to start) and those signals
    18981939    have been emitted.
     1940
     1941
    18991942
    19001943    \bold{Windows:} Arguments that contain spaces are wrapped in quotes.
     
    20462089    cause a panic in Symbian due to platform security.
    20472090
    2048     \sa \l {Symbian Platform Security Requirements}
     2091    \sa {Symbian Platform Security Requirements}
    20492092    \sa kill()
    20502093*/
     
    20642107    \c PowerMgmt. If absent, the process will panic with KERN-EXEC 46.
    20652108
    2066     \sa \l {Symbian Platform Security Requirements}
     2109    \sa {Symbian Platform Security Requirements}
    20672110    \sa terminate()
    20682111*/
     
    21032146    console is forwarded to the calling process.
    21042147
    2105     The environment and working directory are inherited by the calling
     2148    The environment and working directory are inherited the calling
    21062149    process.
    21072150
    21082151    On Windows, arguments that contain spaces are wrapped in quotes.
     2152
     2153
     2154
     2155
    21092156*/
    21102157int QProcess::execute(const QString &program, const QStringList &arguments)
     
    21132160    process.setReadChannelMode(ForwardedChannels);
    21142161    process.start(program, arguments);
    2115     process.waitForFinished(-1);
    2116     return process.exitCode();
     2162    if (!process.waitForFinished(-1))
     2163        return -2;
     2164    return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;
    21172165}
    21182166
     
    21292177    process.setReadChannelMode(ForwardedChannels);
    21302178    process.start(program);
    2131     process.waitForFinished(-1);
    2132     return process.exitCode();
     2179    if (!process.waitForFinished(-1))
     2180        return -2;
     2181    return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;
    21332182}
    21342183
Note: See TracChangeset for help on using the changeset viewer.