forked from qt-creator/qt-creator
Core: Stop crash in systemsettings
Do not crash when updating the Git path settings. Task-number: QTCREATORBUG-16305 Change-Id: Ia6b7f529aa243b5e0b2778aeaddbbd86da9e265a Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -56,6 +56,9 @@ SystemSettings::SystemSettings()
|
|||||||
setCategory(Constants::SETTINGS_CATEGORY_CORE);
|
setCategory(Constants::SETTINGS_CATEGORY_CORE);
|
||||||
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
|
setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE));
|
||||||
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
|
setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON));
|
||||||
|
|
||||||
|
connect(VcsManager::instance(), &VcsManager::configurationChanged,
|
||||||
|
this, &SystemSettings::updatePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *SystemSettings::widget()
|
QWidget *SystemSettings::widget()
|
||||||
@@ -138,9 +141,6 @@ QWidget *SystemSettings::widget()
|
|||||||
}
|
}
|
||||||
|
|
||||||
updatePath();
|
updatePath();
|
||||||
|
|
||||||
connect(VcsManager::instance(), &VcsManager::configurationChanged,
|
|
||||||
this, &SystemSettings::updatePath);
|
|
||||||
}
|
}
|
||||||
return m_widget;
|
return m_widget;
|
||||||
}
|
}
|
||||||
@@ -200,6 +200,9 @@ void SystemSettings::resetFileBrowser()
|
|||||||
|
|
||||||
void SystemSettings::updatePath()
|
void SystemSettings::updatePath()
|
||||||
{
|
{
|
||||||
|
if (!m_page)
|
||||||
|
return;
|
||||||
|
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = Environment::systemEnvironment();
|
||||||
QStringList toAdd = VcsManager::additionalToolsPath();
|
QStringList toAdd = VcsManager::additionalToolsPath();
|
||||||
env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator()));
|
env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator()));
|
||||||
|
Reference in New Issue
Block a user