forked from qt-creator/qt-creator
Python: Check for changes before applying
Storing the python settings seems to be rather costly and may take some time. Perform an early return if nothing has changed. Change-Id: I509e83f503d2af31a7464df893e0e4e69e99a277 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -467,6 +467,10 @@ void PythonSettings::init()
|
||||
|
||||
void PythonSettings::setInterpreter(const QList<Interpreter> &interpreters, const QString &defaultId)
|
||||
{
|
||||
if (defaultId == interpreterOptionsPage().defaultInterpreter().id
|
||||
&& interpreters == interpreterOptionsPage().interpreters()) {
|
||||
return;
|
||||
}
|
||||
interpreterOptionsPage().setInterpreter(interpreters);
|
||||
interpreterOptionsPage().setDefaultInterpreter(defaultId);
|
||||
saveSettings();
|
||||
|
||||
@@ -44,6 +44,11 @@ public:
|
||||
const QString &name,
|
||||
const Utils::FilePath &command);
|
||||
|
||||
inline bool operator==(const Interpreter &other) const
|
||||
{
|
||||
return id == other.id && name == other.name && command == other.command;
|
||||
}
|
||||
|
||||
QString id = QUuid::createUuid().toString();
|
||||
QString name;
|
||||
Utils::FilePath command;
|
||||
|
||||
Reference in New Issue
Block a user