forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/13.0'
Conflicts: src/plugins/cmakeprojectmanager/cmaketool.cpp src/plugins/python/pythonutils.cpp src/plugins/qtsupport/baseqtversion.cpp Change-Id: Ia3e35c763ff9475d17ad922718b54152209893b8
This commit is contained in:
@@ -419,6 +419,7 @@ public:
|
||||
, m_mainGroup(new QGroupBox(Tr::tr("Use Python Language Server")))
|
||||
|
||||
{
|
||||
m_editor->setParent(this);
|
||||
m_mainGroup->setCheckable(true);
|
||||
|
||||
auto mainGroupLayout = new QVBoxLayout;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/mimeutils.h>
|
||||
#include <utils/persistentcachestore.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QReadLocker>
|
||||
@@ -201,20 +200,10 @@ static bool isUsableHelper(QHash<FilePath, bool> *cache, const QString &keyStrin
|
||||
auto it = cache->find(python);
|
||||
if (it == cache->end()) {
|
||||
const Key key = keyFromString(keyString);
|
||||
const auto store = PersistentCacheStore::byKey(key);
|
||||
if (store && store->value(keyFromString(python.toString())).toBool()) {
|
||||
cache->insert(python, true);
|
||||
return true;
|
||||
}
|
||||
Process process;
|
||||
process.setCommand({python, QStringList{"-m", commandArg, "-h"}});
|
||||
process.runBlocking();
|
||||
const bool usable = process.result() == ProcessResult::FinishedWithSuccess;
|
||||
if (usable) {
|
||||
Store newStore = store.value_or(Store{});
|
||||
newStore.insert(keyFromString(python.toString()), true);
|
||||
PersistentCacheStore::write(key, newStore);
|
||||
}
|
||||
it = cache->insert(python, usable);
|
||||
}
|
||||
return *it;
|
||||
|
||||
Reference in New Issue
Block a user