forked from qt-creator/qt-creator
maemo device configuration was not saved on MacOS
The code relies on getting the dialog accepted after the editFinished singnals. This does not work on MacOS. Reviewed-by: ck
This commit is contained in:
@@ -98,13 +98,16 @@ MaemoSettingsWidget::MaemoSettingsWidget(QWidget *parent)
|
|||||||
m_ui(new Ui_MaemoSettingsWidget),
|
m_ui(new Ui_MaemoSettingsWidget),
|
||||||
m_devConfs(MaemoDeviceConfigurations::instance().devConfigs()),
|
m_devConfs(MaemoDeviceConfigurations::instance().devConfigs()),
|
||||||
m_nameValidator(new NameValidator(m_devConfs)),
|
m_nameValidator(new NameValidator(m_devConfs)),
|
||||||
m_keyDeployer(0)
|
m_keyDeployer(0),
|
||||||
|
m_saveSettingsRequested(false)
|
||||||
{
|
{
|
||||||
initGui();
|
initGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoSettingsWidget::~MaemoSettingsWidget()
|
MaemoSettingsWidget::~MaemoSettingsWidget()
|
||||||
{
|
{
|
||||||
|
if (m_saveSettingsRequested)
|
||||||
|
MaemoDeviceConfigurations::instance().setDevConfigs(m_devConfs);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoSettingsWidget::searchKeywords() const
|
QString MaemoSettingsWidget::searchKeywords() const
|
||||||
@@ -225,7 +228,8 @@ void MaemoSettingsWidget::fillInValues()
|
|||||||
|
|
||||||
void MaemoSettingsWidget::saveSettings()
|
void MaemoSettingsWidget::saveSettings()
|
||||||
{
|
{
|
||||||
MaemoDeviceConfigurations::instance().setDevConfigs(m_devConfs);
|
// We must defer this step because of a stupid bug on MacOS. See QTCREATORBUG-1675.
|
||||||
|
m_saveSettingsRequested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeviceConfig &MaemoSettingsWidget::currentConfig()
|
MaemoDeviceConfig &MaemoSettingsWidget::currentConfig()
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ private:
|
|||||||
MaemoDeviceConfig m_lastConfigSim;
|
MaemoDeviceConfig m_lastConfigSim;
|
||||||
NameValidator * const m_nameValidator;
|
NameValidator * const m_nameValidator;
|
||||||
MaemoSshRunner *m_keyDeployer;
|
MaemoSshRunner *m_keyDeployer;
|
||||||
|
bool m_saveSettingsRequested;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user