Changeset 846 for trunk/src/corelib/io/qprocess.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/corelib/io/qprocess.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 89 89 90 90 #include <qbytearray.h> 91 #include <q datetime.h>91 #include <q.h> 92 92 #include <qcoreapplication.h> 93 93 #include <qsocketnotifier.h> … … 1393 1393 } 1394 1394 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 1395 1439 /*! 1396 1440 If QProcess has been assigned a working directory, this function returns … … 1665 1709 return false; 1666 1710 if (d->processState == QProcess::Starting) { 1667 Q TimestopWatch;1711 Q stopWatch; 1668 1712 stopWatch.start(); 1669 1713 bool started = waitForStarted(msecs); … … 1702 1746 return false; 1703 1747 if (d->processState == QProcess::Starting) { 1704 Q TimestopWatch;1748 Q stopWatch; 1705 1749 stopWatch.start(); 1706 1750 bool started = waitForStarted(msecs); … … 1880 1924 1881 1925 /*! 1882 Starts the program \a program in a new process, if one is notalready1926 Starts the already 1883 1927 running, passing the command line arguments in \a arguments. The OpenMode 1884 1928 is set to \a mode. … … 1890 1934 process will continue running. 1891 1935 1892 \note Arguments that contain spaces are not passed to the1893 process as separate arguments.1894 1895 1936 \note Processes are started asynchronously, which means the started() 1896 1937 and error() signals may be delayed. Call waitForStarted() to make 1897 1938 sure the process has started (or has failed to start) and those signals 1898 1939 have been emitted. 1940 1941 1899 1942 1900 1943 \bold{Windows:} Arguments that contain spaces are wrapped in quotes. … … 2046 2089 cause a panic in Symbian due to platform security. 2047 2090 2048 \sa \l{Symbian Platform Security Requirements}2091 \sa {Symbian Platform Security Requirements} 2049 2092 \sa kill() 2050 2093 */ … … 2064 2107 \c PowerMgmt. If absent, the process will panic with KERN-EXEC 46. 2065 2108 2066 \sa \l{Symbian Platform Security Requirements}2109 \sa {Symbian Platform Security Requirements} 2067 2110 \sa terminate() 2068 2111 */ … … 2103 2146 console is forwarded to the calling process. 2104 2147 2105 The environment and working directory are inherited bythe calling2148 The environment and working directory are inherited the calling 2106 2149 process. 2107 2150 2108 2151 On Windows, arguments that contain spaces are wrapped in quotes. 2152 2153 2154 2155 2109 2156 */ 2110 2157 int QProcess::execute(const QString &program, const QStringList &arguments) … … 2113 2160 process.setReadChannelMode(ForwardedChannels); 2114 2161 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; 2117 2165 } 2118 2166 … … 2129 2177 process.setReadChannelMode(ForwardedChannels); 2130 2178 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; 2133 2182 } 2134 2183
Note:
See TracChangeset
for help on using the changeset viewer.