{
qDebug("Control Panel");
- QString ecpPath = QDir(QCoreApplication::applicationDirPath() +
- QDir::separator() + SDK_EMULATOR_BIN_PATH + SDK_ECP_FILE).absolutePath();
-
- QFileInfo ecpFileInfo(ecpPath);
- if (!ecpFileInfo.exists()) {
+ QString jar = QDir(QCoreApplication::applicationDirPath() +
+ QDir::separator() + SDK_EMULATOR_BIN_PATH +
+ SDK_ECP_FILE_JAR).absolutePath();
+ if (!QFileInfo(jar).exists()) {
+ // check ecp jar
showMsgBox(QMessageBox::Warning,
- MSG_ECP_NOT_EXIST + ecpFileInfo.absoluteFilePath());
+ MSG_ECP_NOT_EXIST + jar);
return;
}
- QString basePortOpt =
- "base.port=" + QString::number(parent->getUiInfo()->getBasePort());
- QString vmNameOpt = "vmname=" + parent->getUiInfo()->getVmName();
- QString vmProfileOpt = "profile=" + QString::fromLocal8Bit(get_profile_name());
-
- QString command;
+ QString command = QDir(QCoreApplication::applicationDirPath() +
+ QDir::separator() + SDK_EMULATOR_BIN_PATH +
+ SDK_ECP_FILE).absolutePath();
QStringList arguments;
+ if (QFileInfo(command).exists()) {
+ // we have standalone command for ECP
+ // we respect standalone command, so nothing to do
+ } else {
+ // we do not have standalone command for ECP
+ // we may have SWT based ECP
- /* find java path */
- const char *path;
-
- get_java_path(&path);
+ // find java path
+ const char *path;
+ get_java_path(&path);
- if (path) {
- command = QString::fromLocal8Bit(path);
- } else {
- // can not enter here...
- showMsgBox(QMessageBox::Warning, MSG_INVALID_JAVA_PATH);
- return;
- }
+ if (path) {
+ command = QString::fromLocal8Bit(path);
+ } else {
+ // can not enter here...
+ showMsgBox(QMessageBox::Warning, MSG_INVALID_JAVA_PATH);
+ return;
+ }
#if defined(__x86_64__) || defined(_WIN64)
- arguments << "-d64";
+ arguments << "-d64";
#endif
#ifdef CONFIG_DARWIN
- /* SWT Display must be created on main thread due to Cocoa restrictions */
- arguments << "-XstartOnFirstThread";
+ /* SWT Display must be created on main thread due to Cocoa restrictions */
+ arguments << "-XstartOnFirstThread";
#endif
+ arguments << "-jar" << jar;
+ }
+
+ QString basePortOpt =
+ "base.port=" + QString::number(parent->getUiInfo()->getBasePort());
+ QString vmNameOpt = "vmname=" + parent->getUiInfo()->getVmName();
+ QString vmProfileOpt = "profile=" + QString::fromLocal8Bit(get_profile_name());
+
QString httpProxyAddr;
QString httpProxyPort;
const char *http_proxy_addr = get_http_proxy_addr();
arguments << httpProxyAddr << httpProxyPort;
}
- arguments << "-jar" << ecpPath << vmNameOpt << basePortOpt << vmProfileOpt;
- qDebug() << command << arguments;
+ arguments << vmNameOpt << basePortOpt << vmProfileOpt;
+ QString loggingCommand = QString("staring ecp: \"" + command + "\"");
+ for (int i = 0; i < arguments.size(); ++i) {
+ loggingCommand += " \"" + arguments.at(i) + "\"";
+ }
+ qInfo() << qPrintable(loggingCommand);
try {
QProcess::startDetached(command, arguments);