Changeset 769 for trunk/tools/runonphone
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 6 edited
- 19 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/tools/runonphone/main.cpp
r651 r769 45 45 #include <QScopedPointer> 46 46 #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" 50 50 51 51 #include "trksignalhandler.h" … … 134 134 } 135 135 136 if (serialPortName.isEmpty()) {137 if (loglevel > 0)136 if (serialPortName.isEmpty()) { 137 if (loglevel > 0) 138 138 outstream << "Detecting serial ports" << endl; 139 139 QList <SerialPortId> ports = enumerateSerialPorts(); 140 140 foreach(SerialPortId id, ports) { 141 if (loglevel > 0)141 if (loglevel > 0) 142 142 outstream << "Port Name: " << id.portName << ", " 143 143 << "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))) 150 150 serialPortName = id.portName; 151 else if (!id.friendlyName.isEmpty() &&152 !serialPortFriendlyName.isEmpty() &&153 id.friendlyName.contains(serialPortFriendlyName))154 151 else if (!id.friendlyName.isEmpty() 152 && !serialPortFriendlyName.isEmpty() 153 && id.friendlyName.contains(serialPortFriendlyName)) 154 serialPortName = id.portName; 155 155 } 156 156 } 157 if (serialPortName.isEmpty()) {157 if (serialPortName.isEmpty()) { 158 158 errstream << "No phone found, ensure USB cable is connected or specify manually with -p" << endl; 159 159 return 1; … … 163 163 QScopedPointer<trk::Launcher> launcher; 164 164 165 if (sisFile.isEmpty()) {165 if (sisFile.isEmpty()) { 166 166 launcher.reset(new trk::Launcher(trk::Launcher::ActionCopyRun)); 167 167 launcher->setCopyFileName(exeFile, QString("c:\\sys\\bin\\") + exeFile); … … 173 173 launcher->setInstallFileName("c:\\data\\testtemp.sis"); 174 174 } 175 if (loglevel > 0)175 if (loglevel > 0) 176 176 outstream << "Connecting to target via " << serialPortName << endl; 177 #ifdef Q_OS_WIN178 launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);179 #else180 177 launcher->setTrkServerName(serialPortName); 181 #endif182 178 183 179 launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile); 184 180 launcher->setCommandLineArgs(cmdLine); 185 181 186 if (loglevel > 1)182 if (loglevel > 1) 187 183 launcher->setVerbose(1); 188 184 … … 217 213 218 214 QString errorMessage; 219 if (!launcher->startServer(&errorMessage)) {215 if (!launcher->startServer(&errorMessage)) { 220 216 errstream << errorMessage << endl; 221 217 return 1; -
trunk/tools/runonphone/runonphone.pro
r651 r769 5 5 CONFIG -= app_bundle 6 6 7 include( trk/trk.pri)7 include(symbianutils/symbianutils.pri) 8 8 9 9 SOURCES += main.cpp \ … … 12 12 HEADERS += trksignalhandler.h \ 13 13 serenum.h 14 15 DEFINES += SYMBIANUTILS_INCLUDE_PRI 14 16 15 17 windows { -
trunk/tools/runonphone/serenum_stub.cpp
r651 r769 48 48 { 49 49 QList<SerialPortId> list; 50 qWarning() << "enumerateSerialPorts not implemented" << endl;50 qWarning() << "enumerateSerialPorts not implemented"; 51 51 return list; 52 52 } -
trunk/tools/runonphone/serenum_unix.cpp
r651 r769 52 52 QDir dir("/dev/serial/by-id/"); 53 53 QFileInfoList ports(dir.entryInfoList()); 54 foreach (QFileInfoinfo, ports) {54 foreach (const QFileInfo &info, ports) { 55 55 if (!info.isDir()) { 56 56 SerialPortId id; -
trunk/tools/runonphone/trksignalhandler.cpp
r651 r769 59 59 void TrkSignalHandler::copyingStarted() 60 60 { 61 if (d->loglevel > 0)61 if (d->loglevel > 0) 62 62 d->out << "Copying..." << endl; 63 63 } … … 65 65 void TrkSignalHandler::canNotConnect(const QString &errorMessage) 66 66 { 67 d->err << "Cannot Connect - " << errorMessage << endl;67 d->err << "Cannot connect - " << errorMessage << endl; 68 68 } 69 69 … … 85 85 void TrkSignalHandler::installingStarted() 86 86 { 87 if (d->loglevel > 0)87 if (d->loglevel > 0) 88 88 d->out << "Installing..." << endl; 89 89 } … … 96 96 void TrkSignalHandler::installingFinished() 97 97 { 98 if (d->loglevel > 0)98 if (d->loglevel > 0) 99 99 d->out << "Installing finished" << endl; 100 100 } … … 102 102 void TrkSignalHandler::startingApplication() 103 103 { 104 if (d->loglevel > 0)104 if (d->loglevel > 0) 105 105 d->out << "Starting app..." << endl; 106 106 } … … 108 108 void TrkSignalHandler::applicationRunning(uint pid) 109 109 { 110 if (d->loglevel > 0)110 if (d->loglevel > 0) 111 111 d->out << "Running..." << endl; 112 112 } … … 119 119 void TrkSignalHandler::finished() 120 120 { 121 if (d->loglevel > 0)121 if (d->loglevel > 0) 122 122 d->out << "Done." << endl; 123 123 QCoreApplication::quit(); … … 126 126 void TrkSignalHandler::applicationOutputReceived(const QString &output) 127 127 { 128 d->out << output ;128 d->out << output << flush; 129 129 } 130 130 131 131 void TrkSignalHandler::copyProgress(int percent) 132 132 { 133 if (d->loglevel > 0) {133 if (d->loglevel > 0) { 134 134 d->out << percent << "% "; 135 135 d->out.flush(); 136 if (percent==100)136 if (percent==100) 137 137 d->out << endl; 138 138 } … … 141 141 void TrkSignalHandler::stateChanged(int state) 142 142 { 143 if (d->loglevel > 1)143 if (d->loglevel > 1) 144 144 d->out << "State" << state << endl; 145 145 } … … 165 165 } 166 166 167 TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() :168 169 170 167 TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() 168 : out(stdout), 169 err(stderr), 170 loglevel(0) 171 171 { 172 172 … … 180 180 181 181 TrkSignalHandler::TrkSignalHandler() 182 : d(new TrkSignalHandlerPrivate()) 182 183 { 183 d = new TrkSignalHandlerPrivate();184 184 } 185 185
Note:
See TracChangeset
for help on using the changeset viewer.