Changeset 769 for trunk/tools/runonphone


Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
1 deleted
6 edited
19 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/runonphone/main.cpp

    r651 r769  
    4545#include <QScopedPointer>
    4646#include <QTimer>
    47 #include "trkutils.h"
    48 #include "trkdevice.h"
    49 #include "launcher.h"
     47#include "symbianutils/trkutils.h"
     48#include "symbianutils/trkdevice.h"
     49#include "symbianutils/launcher.h"
    5050
    5151#include "trksignalhandler.h"
     
    134134    }
    135135
    136     if(serialPortName.isEmpty()) {
    137         if(loglevel > 0)
     136    if (serialPortName.isEmpty()) {
     137        if (loglevel > 0)
    138138            outstream << "Detecting serial ports" << endl;
    139139        QList <SerialPortId> ports = enumerateSerialPorts();
    140140        foreach(SerialPortId id, ports) {
    141             if(loglevel > 0)
     141            if (loglevel > 0)
    142142                outstream << "Port Name: " << id.portName << ", "
    143143                     << "Friendly Name:" << id.friendlyName << endl;
    144             if(serialPortName.isEmpty()) {
    145                 if(!id.friendlyName.isEmpty() &&
    146                    serialPortFriendlyName.isEmpty() &&
    147                     (id.friendlyName.contains("symbian", Qt::CaseInsensitive) ||
    148                        id.friendlyName.contains("s60", Qt::CaseInsensitive) ||
    149                        id.friendlyName.contains("nokia", Qt::CaseInsensitive)))
     144            if (serialPortName.isEmpty()) {
     145                if (!id.friendlyName.isEmpty()
     146                        && serialPortFriendlyName.isEmpty()
     147                        && (id.friendlyName.contains("symbian", Qt::CaseInsensitive)
     148                            || id.friendlyName.contains("s60", Qt::CaseInsensitive)
     149                            || id.friendlyName.contains("nokia", Qt::CaseInsensitive)))
    150150                        serialPortName = id.portName;
    151                 else if (!id.friendlyName.isEmpty() &&
    152                          !serialPortFriendlyName.isEmpty() &&
    153                         id.friendlyName.contains(serialPortFriendlyName))
    154                         serialPortName = id.portName;
     151                else if (!id.friendlyName.isEmpty()
     152                        && !serialPortFriendlyName.isEmpty()
     153                        && id.friendlyName.contains(serialPortFriendlyName))
     154                    serialPortName = id.portName;
    155155            }
    156156        }
    157         if(serialPortName.isEmpty()) {
     157        if (serialPortName.isEmpty()) {
    158158            errstream << "No phone found, ensure USB cable is connected or specify manually with -p" << endl;
    159159            return 1;
     
    163163    QScopedPointer<trk::Launcher> launcher;
    164164
    165     if(sisFile.isEmpty()) {
     165    if (sisFile.isEmpty()) {
    166166        launcher.reset(new trk::Launcher(trk::Launcher::ActionCopyRun));
    167167        launcher->setCopyFileName(exeFile, QString("c:\\sys\\bin\\") + exeFile);
     
    173173        launcher->setInstallFileName("c:\\data\\testtemp.sis");
    174174    }
    175     if(loglevel > 0)
     175    if (loglevel > 0)
    176176        outstream << "Connecting to target via " << serialPortName << endl;
    177 #ifdef Q_OS_WIN
    178     launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);
    179 #else
    180177    launcher->setTrkServerName(serialPortName);
    181 #endif
    182178
    183179    launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile);
    184180    launcher->setCommandLineArgs(cmdLine);
    185181
    186     if(loglevel > 1)
     182    if (loglevel > 1)
    187183        launcher->setVerbose(1);
    188184
     
    217213
    218214    QString errorMessage;
    219     if(!launcher->startServer(&errorMessage)) {
     215    if (!launcher->startServer(&errorMessage)) {
    220216        errstream << errorMessage << endl;
    221217        return 1;
  • trunk/tools/runonphone/runonphone.pro

    r651 r769  
    55CONFIG -= app_bundle
    66
    7 include(trk/trk.pri)
     7include(symbianutils/symbianutils.pri)
    88
    99SOURCES += main.cpp \
     
    1212HEADERS += trksignalhandler.h \
    1313    serenum.h
     14
     15DEFINES += SYMBIANUTILS_INCLUDE_PRI
    1416
    1517windows {
  • trunk/tools/runonphone/serenum_stub.cpp

    r651 r769  
    4848{
    4949    QList<SerialPortId> list;
    50     qWarning() << "enumerateSerialPorts not implemented" << endl;
     50    qWarning() << "enumerateSerialPorts not implemented";
    5151    return list;
    5252}
  • trunk/tools/runonphone/serenum_unix.cpp

    r651 r769  
    5252    QDir dir("/dev/serial/by-id/");
    5353    QFileInfoList ports(dir.entryInfoList());
    54     foreach(QFileInfo info, ports) {
     54    foreach (const QFileInfo &info, ports) {
    5555        if (!info.isDir()) {
    5656            SerialPortId id;
  • trunk/tools/runonphone/trksignalhandler.cpp

    r651 r769  
    5959void TrkSignalHandler::copyingStarted()
    6060{
    61     if(d->loglevel > 0)
     61    if (d->loglevel > 0)
    6262        d->out << "Copying..." << endl;
    6363}
     
    6565void TrkSignalHandler::canNotConnect(const QString &errorMessage)
    6666{
    67     d->err << "Cannot Connect - " << errorMessage << endl;
     67    d->err << "Cannot connect - " << errorMessage << endl;
    6868}
    6969
     
    8585void TrkSignalHandler::installingStarted()
    8686{
    87     if(d->loglevel > 0)
     87    if (d->loglevel > 0)
    8888        d->out << "Installing..." << endl;
    8989}
     
    9696void TrkSignalHandler::installingFinished()
    9797{
    98     if(d->loglevel > 0)
     98    if (d->loglevel > 0)
    9999        d->out << "Installing finished" << endl;
    100100}
     
    102102void TrkSignalHandler::startingApplication()
    103103{
    104     if(d->loglevel > 0)
     104    if (d->loglevel > 0)
    105105        d->out << "Starting app..." << endl;
    106106}
     
    108108void TrkSignalHandler::applicationRunning(uint pid)
    109109{
    110     if(d->loglevel > 0)
     110    if (d->loglevel > 0)
    111111        d->out << "Running..." << endl;
    112112}
     
    119119void TrkSignalHandler::finished()
    120120{
    121     if(d->loglevel > 0)
     121    if (d->loglevel > 0)
    122122        d->out << "Done." << endl;
    123123    QCoreApplication::quit();
     
    126126void TrkSignalHandler::applicationOutputReceived(const QString &output)
    127127{
    128     d->out << output;
     128    d->out << output << flush;
    129129}
    130130
    131131void TrkSignalHandler::copyProgress(int percent)
    132132{
    133     if(d->loglevel > 0) {
     133    if (d->loglevel > 0) {
    134134        d->out << percent << "% ";
    135135        d->out.flush();
    136         if(percent==100)
     136        if (percent==100)
    137137            d->out << endl;
    138138    }
     
    141141void TrkSignalHandler::stateChanged(int state)
    142142{
    143     if(d->loglevel > 1)
     143    if (d->loglevel > 1)
    144144        d->out << "State" << state << endl;
    145145}
     
    165165}
    166166
    167 TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() :
    168         out(stdout),
    169         err(stderr),
    170         loglevel(0)
     167TrkSignalHandlerPrivate::TrkSignalHandlerPrivate()
     168    : out(stdout),
     169    err(stderr),
     170    loglevel(0)
    171171{
    172172
     
    180180
    181181TrkSignalHandler::TrkSignalHandler()
     182    : d(new TrkSignalHandlerPrivate())
    182183{
    183     d = new TrkSignalHandlerPrivate();
    184184}
    185185
Note: See TracChangeset for help on using the changeset viewer.