automatically removed Places autotagging if no location library is

wanted
pull/1/head
orbiter 12 years ago
parent 214a087cdf
commit d86d2be5c3

@ -316,10 +316,18 @@ public class DictionaryLoader_p {
}
// check status again
boolean keepPlacesTagging = false;
for (final LibraryProvider.Dictionary dictionary: LibraryProvider.Dictionary.values()) {
prop.put(dictionary.nickname + "Status", dictionary.file().exists() ? 1 : dictionary.fileDisabled().exists() ? 2 : 0);
int newstatus = dictionary.file().exists() ? 1 : dictionary.fileDisabled().exists() ? 2 : 0;
if (newstatus == 1) keepPlacesTagging = true;
prop.put(dictionary.nickname + "Status", newstatus);
}
// if all locations are deleted or deactivated, remove also the vocabulary
if (!keepPlacesTagging) {
LibraryProvider.autotagging.removePlaces();
}
return prop; // return rewrite values for templates
}
}

@ -110,7 +110,7 @@ public class AutotaggingLibrary {
}
public void addPlaces(Locations locations) {
if (locations.isEmpty()) return; // otherwise we get a navigation that does nothing
if (locations.isEmpty()) return; // otherwise we get a navigation that does nothing
Tagging voc = new Tagging("Locations", locations);
try {
voc.setObjectspace("http://dbpedia.org/resource/");
@ -122,6 +122,10 @@ public class AutotaggingLibrary {
}
}
public void removePlaces() {
this.vocabularies.remove("Locations");
}
public int size() {
return this.vocabularies.size();
}

Loading…
Cancel
Save