Commit 4d775ac5 authored by Tobias Hunger's avatar Tobias Hunger

Kits: Fix editing of sysroot and mkspec

Task-number: QTCREATORBUG-8586

Change-Id: I074d7e85524e4dccef26c46391892477269648ce
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 47c3037c
......@@ -56,7 +56,8 @@ namespace Internal {
SysRootInformationConfigWidget::SysRootInformationConfigWidget(Kit *k, QWidget *parent) :
KitConfigWidget(parent),
m_kit(k)
m_kit(k),
m_ignoreChange(false)
{
setToolTip(tr("The root directory of the system image to use.<br>"
"Leave empty when building for the desktop."));
......@@ -79,7 +80,8 @@ QString SysRootInformationConfigWidget::displayName() const
void SysRootInformationConfigWidget::refresh()
{
m_chooser->setFileName(SysRootKitInformation::sysRoot(m_kit));
if (!m_ignoreChange)
m_chooser->setFileName(SysRootKitInformation::sysRoot(m_kit));
}
void SysRootInformationConfigWidget::makeReadOnly()
......@@ -94,7 +96,9 @@ QWidget *SysRootInformationConfigWidget::buttonWidget() const
void SysRootInformationConfigWidget::pathWasChanged()
{
m_ignoreChange = true;
SysRootKitInformation::setSysRoot(m_kit, m_chooser->fileName());
m_ignoreChange = false;
}
// --------------------------------------------------------------------------
......
......@@ -71,6 +71,7 @@ private slots:
private:
Kit *m_kit;
Utils::PathChooser *m_chooser;
bool m_ignoreChange;
};
// --------------------------------------------------------------------------
......
......@@ -44,7 +44,8 @@ namespace Internal {
QmakeKitConfigWidget::QmakeKitConfigWidget(ProjectExplorer::Kit *k, QWidget *parent) :
ProjectExplorer::KitConfigWidget(parent),
m_kit(k),
m_lineEdit(new QLineEdit)
m_lineEdit(new QLineEdit),
m_ignoreChange(false)
{
setToolTip(tr("The mkspec to use when building the project with qmake.<br>"
"This setting is ignored when using other build systems."));
......@@ -70,12 +71,15 @@ void QmakeKitConfigWidget::makeReadOnly()
void QmakeKitConfigWidget::refresh()
{
m_lineEdit->setText(QmakeKitInformation::mkspec(m_kit).toString());
if (!m_ignoreChange)
m_lineEdit->setText(QmakeKitInformation::mkspec(m_kit).toUserOutput());
}
void QmakeKitConfigWidget::mkspecWasChanged(const QString &text)
{
m_ignoreChange = true;
QmakeKitInformation::setMkspec(m_kit, Utils::FileName::fromString(text));
m_ignoreChange = false;
}
} // namespace Internal
......
......@@ -62,6 +62,7 @@ private:
ProjectExplorer::Kit *m_kit;
QLineEdit *m_lineEdit;
bool m_ignoreChange;
};
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment