forked from qt-creator/qt-creator
Update Qt validity in options when changing Android device settings
When changing the Android device settings and pressing "Apply", the information in the "Qt Versions" tab is no longer correct. The Abi information is parsed from the mkspec, and that depends on the NDK setting in the environment. When the NDK in the device settings changes, it updates the toolchains, and that triggers a re-validation of the Qt info in QtOptionsPageWidget::validInformation, but since the Android Qt version already has tried parsing the mkspec, and got (possibly empty) Abi information, it never is parsed and updated again. We need a way to force BaseQtVersion to update these things again. Fixes: QTCREATORBUG-23095 Change-Id: I9cb55ad1a73db942804637344e4c856c7e95afd3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -870,6 +870,7 @@ FilePath AndroidConfig::qtLiveApkPath() const
|
|||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
|
||||||
{
|
{
|
||||||
|
emit m_instance->aboutToUpdate();
|
||||||
m_instance->m_config = devConfigs;
|
m_instance->m_config = devConfigs;
|
||||||
|
|
||||||
m_instance->save();
|
m_instance->save();
|
||||||
|
@@ -209,6 +209,7 @@ public:
|
|||||||
static QProcessEnvironment toolsEnvironment(const AndroidConfig &config);
|
static QProcessEnvironment toolsEnvironment(const AndroidConfig &config);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void aboutToUpdate();
|
||||||
void updated();
|
void updated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -49,7 +49,12 @@ namespace Internal {
|
|||||||
|
|
||||||
AndroidQtVersion::AndroidQtVersion()
|
AndroidQtVersion::AndroidQtVersion()
|
||||||
: QtSupport::BaseQtVersion()
|
: QtSupport::BaseQtVersion()
|
||||||
|
, m_guard(std::make_unique<QObject>())
|
||||||
{
|
{
|
||||||
|
QObject::connect(AndroidConfigurations::instance(),
|
||||||
|
&AndroidConfigurations::aboutToUpdate,
|
||||||
|
m_guard.get(),
|
||||||
|
[this] { resetCache(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidQtVersion::isValid() const
|
bool AndroidQtVersion::isValid() const
|
||||||
|
@@ -58,6 +58,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void parseMkSpec(ProFileEvaluator *) const override;
|
void parseMkSpec(ProFileEvaluator *) const override;
|
||||||
private:
|
private:
|
||||||
|
std::unique_ptr<QObject> m_guard;
|
||||||
mutable QStringList m_androidAbis;
|
mutable QStringList m_androidAbis;
|
||||||
mutable int m_minNdk = -1;
|
mutable int m_minNdk = -1;
|
||||||
};
|
};
|
||||||
|
@@ -2169,6 +2169,11 @@ Abis BaseQtVersion::qtAbisFromLibrary(const FilePathList &coreLibraries)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseQtVersion::resetCache() const
|
||||||
|
{
|
||||||
|
d->m_hasQtAbis = false;
|
||||||
|
d->m_mkspecReadUpToDate = false;
|
||||||
|
}
|
||||||
|
|
||||||
// QtVersionFactory
|
// QtVersionFactory
|
||||||
|
|
||||||
|
@@ -245,6 +245,8 @@ protected:
|
|||||||
// helper function for desktop and simulator to figure out the supported abis based on the libraries
|
// helper function for desktop and simulator to figure out the supported abis based on the libraries
|
||||||
static ProjectExplorer::Abis qtAbisFromLibrary(const Utils::FilePathList &coreLibraries);
|
static ProjectExplorer::Abis qtAbisFromLibrary(const Utils::FilePathList &coreLibraries);
|
||||||
|
|
||||||
|
void resetCache() const;
|
||||||
|
|
||||||
void ensureMkSpecParsed() const;
|
void ensureMkSpecParsed() const;
|
||||||
virtual void parseMkSpec(ProFileEvaluator *) const;
|
virtual void parseMkSpec(ProFileEvaluator *) const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user