forked from qt-creator/qt-creator
ExtensionManager: Let QtC developer test data sets explicitly
The extansion query service is currently only reachable from within the internal network. So far, if the request failed, and if Qt Creator was configured with WITH_TESTS, a set of test json got loaded. That test data confuses people in the team. This change makes loading of test data explicit, and comments it off by default. Change-Id: I89236064b6af32be7559bb6d36cbf0d42982085d Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -362,6 +362,12 @@ int ExtensionsBrowser::extraListViewWidth() const
|
||||
|
||||
void ExtensionsBrowser::fetchExtensions()
|
||||
{
|
||||
#ifdef WITH_TESTS
|
||||
// Uncomment for testing with local json data.
|
||||
// Available: "augmentedplugindata", "defaultpacks", "varieddata", "thirdpartyplugins"
|
||||
// d->model->setExtensionsJson(testData("defaultpacks")); return;
|
||||
#endif // WITH_TESTS
|
||||
|
||||
using namespace Tasking;
|
||||
|
||||
const auto onQuerySetup = [](NetworkQuery &query) {
|
||||
@@ -379,13 +385,6 @@ void ExtensionsBrowser::fetchExtensions()
|
||||
query.setNetworkAccessManager(NetworkAccessManager::instance());
|
||||
};
|
||||
const auto onQueryDone = [this](const NetworkQuery &query, DoneWith result) {
|
||||
if (result != DoneWith::Success) {
|
||||
#ifdef WITH_TESTS
|
||||
// Available: "augmentedplugindata", "defaultpacks", "varieddata", "thirdpartyplugins"
|
||||
d->model->setExtensionsJson(testData("defaultpacks"));
|
||||
#endif // WITH_TESTS
|
||||
return;
|
||||
}
|
||||
const QByteArray response = query.reply()->readAll();
|
||||
d->model->setExtensionsJson(response);
|
||||
};
|
||||
|
Reference in New Issue
Block a user