forked from qt-creator/qt-creator
debugger: use host from profile for the attach to qml option
Change-Id: I81903ba752b9758fb4b9e342d40ac756716caecf Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -432,7 +432,6 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
|
|||||||
class AttachToQmlPortDialogPrivate
|
class AttachToQmlPortDialogPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QLineEdit *hostLineEdit;
|
|
||||||
QSpinBox *portSpinBox;
|
QSpinBox *portSpinBox;
|
||||||
ProfileChooser *profileChooser;
|
ProfileChooser *profileChooser;
|
||||||
};
|
};
|
||||||
@@ -444,10 +443,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
|||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
setWindowTitle(tr("Start Debugger"));
|
setWindowTitle(tr("Start Debugger"));
|
||||||
|
|
||||||
d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
|
d->profileChooser = new ProfileChooser(this);
|
||||||
|
|
||||||
d->hostLineEdit = new QLineEdit(this);
|
|
||||||
d->hostLineEdit->setText(QString::fromUtf8("localhost"));
|
|
||||||
|
|
||||||
d->portSpinBox = new QSpinBox(this);
|
d->portSpinBox = new QSpinBox(this);
|
||||||
d->portSpinBox->setMaximum(65535);
|
d->portSpinBox->setMaximum(65535);
|
||||||
@@ -459,7 +455,6 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
|
|||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout();
|
QFormLayout *formLayout = new QFormLayout();
|
||||||
formLayout->addRow(tr("Target:"), d->profileChooser);
|
formLayout->addRow(tr("Target:"), d->profileChooser);
|
||||||
formLayout->addRow(tr("&Host:"), d->hostLineEdit);
|
|
||||||
formLayout->addRow(tr("&Port:"), d->portSpinBox);
|
formLayout->addRow(tr("&Port:"), d->portSpinBox);
|
||||||
|
|
||||||
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
||||||
@@ -475,16 +470,6 @@ AttachToQmlPortDialog::~AttachToQmlPortDialog()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachToQmlPortDialog::setHost(const QString &host)
|
|
||||||
{
|
|
||||||
d->hostLineEdit->setText(host);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString AttachToQmlPortDialog::host() const
|
|
||||||
{
|
|
||||||
return d->hostLineEdit->text();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AttachToQmlPortDialog::setPort(const int port)
|
void AttachToQmlPortDialog::setPort(const int port)
|
||||||
{
|
{
|
||||||
d->portSpinBox->setValue(port);
|
d->portSpinBox->setValue(port);
|
||||||
|
@@ -91,9 +91,6 @@ public:
|
|||||||
explicit AttachToQmlPortDialog(QWidget *parent);
|
explicit AttachToQmlPortDialog(QWidget *parent);
|
||||||
~AttachToQmlPortDialog();
|
~AttachToQmlPortDialog();
|
||||||
|
|
||||||
QString host() const;
|
|
||||||
void setHost(const QString &host);
|
|
||||||
|
|
||||||
int port() const;
|
int port() const;
|
||||||
void setPort(const int port);
|
void setPort(const int port);
|
||||||
|
|
||||||
|
@@ -1606,19 +1606,11 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
|||||||
DebuggerStartParameters sp;
|
DebuggerStartParameters sp;
|
||||||
AttachToQmlPortDialog dlg(mainWindow());
|
AttachToQmlPortDialog dlg(mainWindow());
|
||||||
|
|
||||||
const QVariant qmlServerAddress = configValue(_("LastQmlServerAddress"));
|
|
||||||
if (qmlServerAddress.isValid()) {
|
|
||||||
dlg.setHost(qmlServerAddress.toString());
|
|
||||||
} else {
|
|
||||||
dlg.setHost(sp.qmlServerAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
const QVariant qmlServerPort = configValue(_("LastQmlServerPort"));
|
const QVariant qmlServerPort = configValue(_("LastQmlServerPort"));
|
||||||
if (qmlServerPort.isValid()) {
|
if (qmlServerPort.isValid())
|
||||||
dlg.setPort(qmlServerPort.toInt());
|
dlg.setPort(qmlServerPort.toInt());
|
||||||
} else {
|
else
|
||||||
dlg.setPort(sp.qmlServerPort);
|
dlg.setPort(sp.qmlServerPort);
|
||||||
}
|
|
||||||
|
|
||||||
const QVariant profileId = configValue(_("LastProfile"));
|
const QVariant profileId = configValue(_("LastProfile"));
|
||||||
if (profileId.isValid())
|
if (profileId.isValid())
|
||||||
@@ -1627,14 +1619,12 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
|||||||
if (dlg.exec() != QDialog::Accepted)
|
if (dlg.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setConfigValue(_("LastQmlServerAddress"), dlg.host());
|
|
||||||
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
setConfigValue(_("LastQmlServerPort"), dlg.port());
|
||||||
setConfigValue(_("LastProfile"), dlg.profile()->id().toString());
|
setConfigValue(_("LastProfile"), dlg.profile()->id().toString());
|
||||||
|
|
||||||
fillParameters(&sp, dlg.profile());
|
fillParameters(&sp, dlg.profile());
|
||||||
sp.qmlServerAddress = dlg.host();
|
sp.qmlServerAddress = sp.connParams.host;
|
||||||
sp.qmlServerPort = dlg.port();
|
sp.qmlServerPort = dlg.port();
|
||||||
|
|
||||||
sp.startMode = AttachToRemoteProcess;
|
sp.startMode = AttachToRemoteProcess;
|
||||||
sp.closeMode = KillAtClose;
|
sp.closeMode = KillAtClose;
|
||||||
sp.languages = QmlLanguage;
|
sp.languages = QmlLanguage;
|
||||||
|
Reference in New Issue
Block a user