1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-12 20:49:16 +03:00

Removed lots of calls to BaseNoGui.getPlatform(): static is evil

This commit is contained in:
Federico Fissore
2015-05-22 15:42:05 +02:00
parent 46e065b76d
commit ab7b7351f5
11 changed files with 84 additions and 136 deletions

View File

@@ -586,7 +586,7 @@ public class BaseNoGui {
}
static public void initPackages() throws Exception {
indexer = new ContributionsIndexer(BaseNoGui.getSettingsFolder());
indexer = new ContributionsIndexer(BaseNoGui.getSettingsFolder(), BaseNoGui.getPlatform());
File indexFile = indexer.getIndexFile("package_index.json");
File defaultPackageJsonFile = new File(getContentFile("dist"), "package_index.json");
if (!indexFile.isFile() || (defaultPackageJsonFile.isFile() && defaultPackageJsonFile.lastModified() > indexFile.lastModified())) {
@@ -797,7 +797,7 @@ public class BaseNoGui {
PreferencesData.removeAllKeysWithPrefix(prefix);
for (ContributedTool tool : indexer.getInstalledTools()) {
File installedFolder = tool.getDownloadableContribution().getInstalledFolder();
File installedFolder = tool.getDownloadableContribution(getPlatform()).getInstalledFolder();
if (installedFolder != null) {
PreferencesData.set(prefix + tool.getName() + ".path", installedFolder.getAbsolutePath());
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", installedFolder.getAbsolutePath());