Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qdoc3/command.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the tools applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5050QT_BEGIN_NAMESPACE
    5151
    52 void executeCommand( const Location& location, const QString& format,
    53                      const QStringList& args )
     52void executeCommand(const Location& location,
     53                    const QString& format,
     54                    const QStringList& args)
    5455{
    5556    QString actualCommand;
    56     for ( int i = 0; i < (int) format.length(); i++ ) {
     57    for (int i = 0; i < (int) format.length(); i++) {
    5758        int ch = format[i].unicode();
    58         if ( ch > 0 && ch < 8 ) {
     59        if (ch > 0 && ch < 8) {
    5960            actualCommand += args[ch - 1];
    60         } else {
     61        }
     62        else {
    6163            actualCommand += format[i];
    6264        }
     
    6466
    6567    QString toolName = actualCommand;
    66     int space = toolName.indexOf( QLatin1Char(' ') );
    67     if ( space != -1 )
    68         toolName.truncate( space );
     68    int space = toolName.indexOf(QLatin1Char(' '));
     69    if (space != -1)
     70        toolName.truncate(space);
    6971
    7072    QProcess process;
    7173    process.start(QLatin1String("sh"),
    72         QStringList() << QLatin1String("-c") << actualCommand );
     74        QStringList() << QLatin1String("-c") << actualCommand);
    7375    process.waitForFinished();
    7476
    7577    if (process.exitCode() == 127)
    76         location.fatal( tr("Couldn't launch the '%1' tool")
    77                         .arg(toolName),
    78                         tr("Make sure the tool is installed and in the"
    79                            " path.") );
     78        location.fatal(tr("Couldn't launch the '%1' tool")
     79                       .arg(toolName),
     80                       tr("Make sure the tool is installed and in the"
     81                          " path."));
    8082
    8183    QString errors = QString::fromLocal8Bit(process.readAllStandardError());
    82     while ( errors.endsWith(QLatin1Char('\n')) )
    83         errors.truncate( errors.length() - 1 );
    84     if ( !errors.isEmpty() )
    85         location.fatal( tr("The '%1' tool encountered some problems")
    86                         .arg(toolName),
    87                         tr("The tool was invoked like this:\n%1\n"
    88                            "It emitted these errors:\n%2")
    89                         .arg(actualCommand).arg(errors) );
     84    while (errors.endsWith(QLatin1Char('\n')))
     85        errors.truncate(errors.length() - 1);
     86    if (!errors.isEmpty())
     87        location.fatal(tr("The '%1' tool encountered some problems")
     88                       .arg(toolName),
     89                       tr("The tool was invoked like this:\n%1\n"
     90                          "It emitted these errors:\n%2")
     91                       .arg(actualCommand).arg(errors));
    9092}
    9193
Note: See TracChangeset for help on using the changeset viewer.